Technical data

Appendix
27.3 Data Types and Parameter Types
Programming with STEP 7
Manual, 05/2010, A5E02789666-01 593
Accuracy when Calculating Floating-Point Numbers
!
Caution
Calculations involving a long series of values including very large and very small numbers can
produce inaccurate results.
The floating-point numbers in STEP 7 are accurate to 6 decimal places. You can therefore only
specify a maximum of 6 decimal places when entering floating-point constants.
Note
The calculation accuracy of 6 decimal places means, for example, that the addition of number1 + number2 =
number1 if number1 is greater than number2 10 to the power of y, where y>6:
100 000 000 + 1 = 100 000 000.
Examples of Numbers in Floating-Point Format
The following figure shows the floating-point format for the following decimal values:
10.0
Pi (3.141593)
Square root of 2 (1.414214)
The number 10.0 in the first example results from its floating-point format (hexadecimal
representation: 4120 0000) as follows:
e = 2 to the power of 7 + 2 to the power of 1
= 2 + 128 = 130
m = 2 to the power of (-2) = 0.25
This results in:
(1 + m) 2 to the power of (e - bias) = 1.25 2 to the power of 3 = 10.0
[1.25 2 to the power of (130-127) = 1.25 2 to the power of 3 = 10.0]