Welcome to %s forums

BrainModular Users Forum

Login Register

TPrecision vs float

Create your own modules in C++
Post Reply
User avatar
oli_lab
Member
Posts: 1261
Location: Brittany, France
Contact:

Unread post by oli_lab » 31 Jan 2016, 15:45

is there a difference between float ant TPrecision ?

in what case should I use one or the other ?

thanx !
http://oli-lab.org

Win11 Ryzen9/32GB RAM - RME MADIFACE - SSL alpha link 4-16 - OSC capable interfaces

follow OLI_LAB adventures on Mastodon
@olivar_premier@mastodon.social

sm_jamieson
Member
Posts: 551
Contact:

Unread post by sm_jamieson » 01 Feb 2016, 12:54

The sdk file "UsineDefinitions.h" contains the line:

typedef float TPrecision;

So they are the same thing.

I suppose the point about using TPrecision, is that in theory it could change - but its very unlikely. I must admit I just use float in my user module code.

I know there was a discussion on the forums about using "double" for increased precision and/or range or numbers supported. The conclusion was that "double" increased the storage and processing requirements too much.

sm_jamieson
Member
Posts: 551
Contact:

Unread post by sm_jamieson » 01 Feb 2016, 12:55

NOTE: there is similar situation with bool and LongBool. In that case they are not the same thing though, and the SDK always uses LongBool. User module code can still use bool for its own use of course.

The SDK definition is:

//-----------------------------------------------------------------------------
/// Custom bool type to match the 4 bytes DELPHI LongBool type.
typedef int LongBool;

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests