294
The following data can be expressed by floating-point data:
• –
• –3.402823 x 10
38
value –1.175494 x 10
–38
• 0
• 1.175494 x 10
–38
value 3.402823 x 10
38
• +
• Not a number (NaN)
–1.175494 x 10
–38
1.175494 x 10
–38
–
+
–3.402823 x 10
38
3.402823 x 10
38
–1 0 1
The formats for NaN, ±, and 0 are as follows:
NaN*: e = 255, f ≠ 0
+: e = 255, f = 0, s= 0
–: e = 255, f = 0, s= 1
0: e = 0
*NaN is a valid floating-point number. Executing instructions involving data con-
version or calculations may result in NaN.
When the absolute value of the result is greater than the maximum value that
can be expressed for floating-point data, the Overflow Flag (A50009) will turn
ON and the result will be output as ±. If the result is positive, it will be output as
+; if negative, then –.
The Equals Flag (A50006) will only turn ON when both the exponent (e) and the
mantissa (f) are zero after a calculation. A calculation result will also be output as
zero when the absolute value of the result is less than the minimum value that
can be expressed for floating-point data. In that case the Underflow Flag
(A50010) will turn ON.
In this program example, the X-axis and Y-axis coordinates (x, y) are provided by
4-digit BCD content of D00000 and D00001. The distance (r) from the origin and
the angle (θ, in degrees) are found and output to D00100 and D00101. In the
result, everything to the right of the decimal point is truncated.
Floating-point Data
Special Numbers
Floating-point Data
Calculation Results
Example
Floating-point Math Instructions
Section 5-21