Technical data

Appendix
27.3 Data Types and Parameter Types
Programming with STEP 7
592 Manual, 05/2010, A5E02789666-01
Using the three components S, e, and m, the value of a number represented in this form is defined
by the formula:
Number = 1.m 2 to the power of (e - bias)
Where:
e: 1 e 254
Bias: bias = 127. This means that an additional sign is not required for the exponent.
S: for a positive number, S = 0 and for a negative number, S = 1.
Value Range of Floating-Point Numbers
Using the floating-point format shown above, the following results:
The smallest floating-point number = 1.0 2 to the power of (1-127) = 1.0 2 to the power of
(-126)
= 1.175 495E-38 and
The largest floating-point number = 2-2 to the power of (-23) 2 to the power of (254-127) =
2-2 to the power of (-23) 2 to the power of (+127)
= 3.402 823E+38
The number zero is represented with e = m = 0; e = 255 and m = 0 stands for "infinite."
Format Range
1)
Floating-point numbers according to the
ANSI/IEEE standard
-3.402 823E+38 to -1.175 495E-38
and 0 and
+1.175 495E-38 to +3.402 823E+38
The following table shows the signal state of the bits in the status word for the results of
instructions with floating-point numbers that do not lie within the valid range:
Invalid Range for a Result CC1 CC0 OV OS
-1.175494E-38 < result < -1.401298E-45 (negative number)
underflow
0 0 1 1
+1.401298E-45 < result < +1.175494E-38 (positive number)
underflow
0 0 1 1
Result < -3.402823E+38 (negative number) overflow 0 1 1 1
Result > 3.402823E+38 (positive number) overflow 1 0 1 1
Not a valid floating-point number or invalid instruction (input value
outside the valid value range)
1 1 1 1
Note when using mathematical operations:
The result "Not a valid floating-point number" is obtained, for example, when you attempt to extract
the square root from -2. You should therefore always evaluate the status bits first in math
operations before continuing calculations based on the result.
Note when modifying variables:
If the values for floating-point operations are stored in memory double words, for example, you can
modify these values with any bit patterns. However, not every bit pattern is a valid number.