Operands of the data type REAL have a length of 32 bits and are used to represent floating-point numbers. An operand of the REAL data type consists of the following three components:
- Sign: The sign is determined by the signal state of bit 31. The bit 31 assume the value 0 (positive) or 1 (negative).
- 8-bit exponents to basis 2: The exponent is increased by a constant (base, +127), so that it has a value range of 0 to 255.
- 23-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 REAL data type is processed with a precision of 6 digits.
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 value corresponding to the precision allowed by this value range.
The following table shows the properties of data type REAL:
Length (bits) | Format | Value range | Examples of value input |
---|---|---|---|
32 | Floating-point numbers according to IEEE754 | -3.402823e+38 to -1.175495e-38 ±0.0 +1.175495e-38 to +3.402823e+38 |
1.0e-5; REAL#1.0e-5 |
32 | Floating-point numbers | -3.402823e+38 to -1.175495e-38 ±0.0 +1.175495e-38 to +3.402823e+38 |
1.0; REAL#1.0 |