Using floating point numbers
Use floating point numbers for solving extensive calculations,
especially for multiplication and division or when you are working
with very large or very small numbers!
Accuracy
The mantissa indicates the accuracy of the floating point number as
follows:
••
Accuracy with a 24-bit mantissa:
2
-24
= 0.000000059604 (corresponds to 7 decimal places)
If the sign of the mantissa is "0" the number is positive; if the sign is
"1" it is a negative number in its two’s complement representation.
The floating point value ’0’ is represented as the binary value
80000000H (32 bits, see below).
Coding floating point numbers
Coding a floating point number:
31 30 24 23 22
0
V
2
6
...
. ... 2
0
V
2
-1
.... . . .
. . ... 2
-23
Exponent
Mantissa
Specification of the data format for floating point numbers at the
PG:
KG
Permissible numerical range
±
0.1469368 x 10
-38
to
±
0.1701412 x 10
39
Input/output on PG
a)
in a logic block:
You want to load the number N = 12.34567 as a floating point
number.
Input:
:LKG2
STEP 5 Programming Language
CPU 948 Programming Guide
2 - 10
C79000-G8576-C848-04
Summary of Contents for CPU 948
Page 10: ...Contents CPU 948 Programming Guide 1 2 C79000 G8576 C848 04 ...
Page 32: ...Contents CPU 948 Programming Guide 2 2 C79000 G8576 C848 04 ...
Page 72: ...Data Blocks CPU 948 Programming Guide 2 42 C79000 G8576 C848 04 ...
Page 74: ...Contents CPU 948 Programming Guide 3 2 C79000 G8576 C848 04 ...
Page 154: ...Contents CPU 948 Programming Guide 4 2 C79000 G8576 C848 04 ...
Page 200: ...Contents CPU 948 Programming Guide 5 2 C79000 G8576 C848 04 ...
Page 308: ...Contents CPU 948 Programming Guide 7 2 C79000 G8576 C848 04 ...
Page 324: ...Examples of Parameter Assignment CPU 948 Programming Guide 7 18 C79000 G8576 C848 04 ...
Page 326: ...Contents CPU 948 Programming Guide 8 2 C79000 G8576 C848 04 ...
Page 370: ...Addressable System Data Area CPU 948 Programming Guide 8 46 C79000 G8576 C848 04 ...
Page 372: ...Contents CPU 948 Programming Guide 9 2 C79000 G8576 C848 04 ...
Page 486: ...Contents CPU 948 Programming Guide 11 2 C79000 G8576 C848 04 ...
Page 522: ...PG Functions via the S5 Bus CPU 948 Programming Guide 11 38 C79000 G8576 C848 04 ...
Page 524: ...Contents CPU 948 Programming Guide 12 2 C79000 G8576 C848 04 ...
Page 538: ...Contents CPU 948 Programming Guide 13 2 C79000 G8576 C848 04 ...
Page 546: ...List of Key Words CPU 948 Programming Guide Index 6 C79000 G8576 C848 04 ...