Omron CS1G/H-CPUxxH Instructions Manual page 595

Sysmac cs series; sysmac cj series
Hide thumbs Also See for CS1G/H-CPUxxH:
Table of Contents

Advertisement

Double-precision Floating-point Instructions (CS1-H, CJ1-H, CJ1M, or CS1D Only)
Overflows, Underflows,
and Illegal Calculations
Precautions in Handling
Special Values
Double-precision Floating-point Calculation Results
Comparing Single-precision and Double-precision Calculations
574
Overflows will be output as either positive or negative infinity, depending on
the sign of the result. Underflows will be output as either positive or negative
zero, depending on the sign of the result.
Illegal calculations will result in NaN. Illegal calculations include adding infinity
to a number with the opposite sign, subtracting infinity from a number with the
opposite sign, multiplying zero and infinity, dividing zero by zero, or dividing
infinity by infinity.
The value of the result may not be correct if an overflow occurs when convert-
ing a floating-point number to an integer.
The following precautions apply to handling zero, infinity, and NaN.
• The sum of positive zero and negative zero is positive zero.
• The difference between zeros of the same sign is positive zero.
• If any operand is a NaN, the results will be a NaN.
• Positive zero and negative zero are treated as equivalent in comparisons.
• Comparison or equivalency tests on one or more NaN will always be true
for != and always be false for all other instructions.
When the absolute value of the result is greater than the maximum value that
can be expressed for floating-point data, the Overflow Flag 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 will only turn ON when both the exponent (e) and the man-
tissa (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 will
turn ON.
This example shows the differences in between single-precision and double-
precision calculations when the following vector expressed in polar coordi-
nates is converted to rectangular coordinates A (x,y).
In this example, the 4-digit BCD angle ( θ , in degrees) is read from D00000
and the 4-digit BCD distance (r) is read from D01000.
Y
0
π
θ
j
r = re
360
A (x, y) = A (rcos θ,rsin θ)
r
r
θ
X
Section 3-16

Advertisement

Table of Contents
loading

Table of Contents