Technical data

Appendix
27.3 Data Types and Parameter Types
Programming with STEP 7
Manual, 05/2010, A5E02789666-01 591
27.3.2.3 Format of the Data Type REAL (Floating-Point Numbers)
Numbers in floating-point format are represented in the general form "number = m * b to the power
of E." The base "b" and the exponent "E" are integers; the mantissa "m" is a rational number.
This type of number representation has the advantage of being able to represent both very large
and very small values within a limited space. With the limited number of bits for the mantissa and
exponent, a wide range of numbers can be covered.
The disadvantage is in the limited accuracy of calculations. For example, when forming the sum of
two numbers, the exponents must be matched by shifting the mantissa (hence floating decimal
point) since only numbers with the same exponent can be added.
Floating-point number format in STEP 7
Floating-point numbers in STEP 7 conform to the basic format, single width, described in the
ANSI/IEEE standard 754-1985, IEEE Standard for Binary Floating-Point Arithmetic. They consist
of the following components:
The sign S
The exponent e = E + bias, increased by a constant (bias = +127)
The fractional part of the mantissa m.
The whole number part of the mantissa is not stored with the rest, because it is always equal to
1 within the valid number range.
The three components together occupy one double word (32 bits):
The following table shows the values of the individual bits in floating-point format.
Component of the Floating-Point Number Bit Number Value
Sign S 31
Exponent e
30 2 to the power of 7
... ... ...
Exponent e
24 2 to the power of 1
Exponent e
23 2 to the power of 0
Mantissa m
22 2 to the power of -1
... ... ...
Mantissa m
1 2 to the power of -22
Mantissa m
0 2 to the power of -23