6 Programming
Special Values
Values such as positive infinity, negative infinity, +0, 0, and nonnumeric data are called special val-
ues. Nonnumeric data refers to data that you cannot express as a floating-point number and there-
fore cannot be treated as a numeric value. Although +0 and 0 both mathematically mean 0, they
are different for the purpose of data processing. This is discussed later in this section. The values for
the sign s, exponent e, and mantissa f of special numbers are given in the following table.
Data type name
REAL
Data type name
LREAL
Subnormal Numbers
You cannot use the floating-point format to express values close to 0 (i.e., values with an extremely
small absolute value). Therefore, you can use subnormal numbers to expand the valid range of num-
bers near 0. You can use subnormal numbers to express values with a smaller absolute value than
with the normal data format (normal numbers). Any number where the exponent e = 0 and the man-
tissa f 0 is a subnormal number and its value is expressed as shown below.
• REAL Data
Number = (1)
• LREAL Data
Number = (1)
Example: Expressing 0.75 2
1
This is a positive number, so s = 0.
2
0.75 in binary is 0.11.
3
From (0.11)
4
From the above expression, f = 01100000000000000000000.
Therefore, you can express 0.75 2
REAL data (32 bits)
Subnormal numbers have less effective digits than normal numbers. Therefore, if a calculation with
normal numbers results in a subnormal number or if a subnormal number results in the middle of
such a calculation, the effective digits of the result may be less than the effective digits of a normal
number.
6-36
Special values
0
1
+0
0
0
1
Nonnumeric
---
Special values
0
1
+0
0
0
1
Nonnumeric
---
126
23
(f 2
s
2
)
1022
52
(f 2
s
2
)
127
as REAL Data
127
126
23
2
(f 2
= 2
2
127
as shown in the following figure.
Sign
Exponent
0
00000000
01100000000000000000000
31 30
23 22
Sign s
Exponent e
255
255
0
0
255
Sign s
Exponent e
2047
2047
0
0
2047
) we can see that f = (0.11)
Mantissa
0
NJ-series CPU Unit Software User's Manual (W501)
Mantissa f
0
0
0
0
Not 0
Mantissa f
0
0
0
0
Not 0
2
22
.
2