Core.DataTypes.SimpleDataType.Float
Jump to navigation
Jump to search
Classification
Name | Float |
Short Description | 64-bit floating-point number with sign |
Class | Simple Data Type |
Base Data Type | SimpleType |
Default Value | 0.0 |
Provide a Literal | Yes |
SpecifiedBy | ISO 13209-2 |
Standard Compliant | Yes |
Description
The Float data type identifies OTX in a 64-bit floating-point number with sign according to IEEE 754: 1985, range of values is double(± 5.0 × 10 -324 to ± 1.7 × 10 308 with a precision 15-16 digits).
Core Conversion
The following table shows the rules for conversion to another data type:
Conversion | Result | Sample |
ToBoolean | Returns false if 0.0, otherwise true | Boolean b = ToBoolean(123.456); // Returns true |
ToInteger | Returns the integer part (the digits to the left of the decimal point – truncation) | Integer i = ToInteger(123.456); // Returns 123 |
ToFloat | Returns the copy of the value | Float f = ToFloat(123.456); // Returns 123.456 |
ToString | Returns the value in decimal string representation | String s = ToString(123.456); // Returns "123.456" |
ToByteField | Returns the 64-bit double precision encoded value according to [IEEE 754:2008] | ByteField bf = ToByteField(123.456); // Returns 405EDD2F1A9FBE77 |
Sample
Float FloatVariable;