LREAL - Manual - SIMATIC S7 Connector - Industrial Edge - Industrial Edge App

SIMATIC S7 Connector

Product
SIMATIC S7 Connector
Product Version
v2.2.1
Edition
08/2024
Language
en-US (original)

Operands of the data type LREAL have a length of 64 bits and are used to represent floating-point numbers. An operand of the LREAL data type consists of the following three components:

  • Sign: The sign is determined by the signal state of bit 63. The bit 63 assumes the value 0 (positive) or 1 (negative).
  • 11-bit exponents to base 2: The exponent is increased by a constant (base, +1023), so that it has a value range of 0 to 2047.
  • 52-bit mantissa: Only the fraction part of the mantissa is shown. The integer part of the mantissa is always 1 with normalized floating-point numbers and is not stored.

The LREAL data type is processed with a precision of 15 digits.

The following table shows the properties of data type LREAL:

Length (bits) Format Value range Examples of value input
64 Floating-point numbers according to IEEE754 -1.7976931348623157e+308 to -2.2250738585072014e-308
±0.0
+2.2250738585072014e-308 to +1.7976931348623157e+308
1.0e-5; LREAL#1.0e-5
64 Floating-point numbers -1.7976931348623157e+308 to -2.2250738585072014e-308
±0.0
+2.2250738585072014e-308 to +1.7976931348623157e+308
1.0; LREAL#1.0

NOTE

With floating-point numbers, only the precision defined by the IEEE754 standard is stored. Additionally specified decimals are rounded off according to IEEE754.

The number of decimal places may decrease for frequently nested arithmetic calculations.

If more decimal places are specified than can be stored by the data type, the number is rounded to the corresponding value of the precision allowed by this value range.