REAL / LREALΒΆ

The data types REAL and LREAL are floating point types necessary when working with floating-point numbers.

Data Type Lower Limit Upper Limit Memory
REAL -3.402823e+38 3.402823e+38 32 Bit
LREAL -1.7976931348623158e+308 1.7976931348623158e+308 64 Bit

Hint

Support for the LREAL data type depends on the target device in use. Please refer to the respective documentation whether or not the 64-bit type LREAL is converted into REAL (with possible data loss) when compiling the application.

Hint

If the value of the REAL/LREAL number is outside the integer value range, the conversion yields an undefined result ehen converting types from REAL or LREAL toSINT, USINT, INT, UINT, DINT, UDINT, LINT or ULINT. This result depends on the target system. An exception error is also possible.  To obtain code that is independent of the target system, the application must catch value range violations.

If the REAL/LREAL number is within the integer value range, then the conversion operates the same way on all systems.

See also