Technical data
Floating point numbers
Floating point numbers are positive and negative fractions. They
always occupy a double word (32 bits). A floating point number is
represented as an exponential number. The mantissa is 16 or 24 bits
long and the exponent is 8 bits long.
In the CPU 928B, the default mantissa (assuming you have not
changed the setting) is 16-bits long (bits 8 to 23) for adding,
subtracting, multiplying and dividing. The least significant (on the
right) bits 0 to 7 always have the value "0".
If you require floating point calculations with a higher accuracy (and
can accept a slightly longer runtime), program the setting "floating
point arithmetic with 24-bit mantissa" in DX 0 (see Chapter 7).
The exponent indicates the order of magnitude of the floating point
number. The sign of the exponent tells you whether the value of the
floating point number is greater or less than 0.1.
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)
•• Accuracy with a 16-bit mantissa:
2
-16
= 0,000015258 (corresponds to 4 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).
STEP 5 Programming Language
CPU 928B Programming Guide
2 - 10 C79000-B8576-C898-01