Page 1 of 1

Posted: 31 Jan 2016, 15:45
by oli_lab
is there a difference between float ant TPrecision ?

in what case should I use one or the other ?

thanx !

Posted: 01 Feb 2016, 12:54
by sm_jamieson
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.

Posted: 01 Feb 2016, 12:55
by sm_jamieson
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;