7-26
FLOATING-POINT UNIT
is bit 62. Here, the integer is explicitly set to 1 for normalized numbers, infinities, and NaNs,
and to 0 for zero and denormalized numbers.
The exponent of each real data type is encoded in biased format. The biasing constant is 127 for
the single-real format, 1023 for the double-real format, and 16,383 for the extended-real format.
Table 7-9 shows the encodings for all the classes of real numbers (that is, zero, denormalized-
finite, normalized-finite, and
?
) and NaNs for each of the three real data-types. It also gives the
format for the real indefinite value.
When storing real values in memory, single-real values are stored in 4 consecutive bytes in
memory; double-real values are stored in 8 consecutive bytes; and extended-real values are
stored in 10 consecutive bytes.
As a general rule, values should be stored in memory in double-real format. This format
provides sufficient range and precision to return correct results with a minimum of programmer
attention. The single-real format is appropriate for applications that are constrained by memory;
however, it provides less precision and a greater chance of overflow. The single-real format is
also useful for debugging algorithms, because rounding problems will manifest themselves
more quickly in this format. The extended-real format is normally reserved for holding interme-
diate results in the FPU registers and constants. Its extra length is designed to shield final results
from the effects of rounding and overflow/underflow in intermediate calculations. However,
when an application requires the maximum range and precision of the FPU (for data storage,
computations, and results), values can be stored in memory in extended-real format.
The real indefinite value is a QNaN encoding that is stored by several floating-point instructions
in response to a masked floating-point invalid operation exception (refer to Table 7-21).
Table 7-8. Length, Precision, and Range of FPU Data Types
Data TypeLengthPrecision
(Bits)
Approximate Normalized Range
Binary
Decimal
Binary Real
Single real
32
242
126
to 2
127
1.18
?
10
38
to 3.40
?
10
38
Double real
64
532
1022
to 2
1023
2.23
?
10
308
to 1.79
?
10
308
Extended real80
642
16382
to 2
16383
3.37
?
10
4932
to 1.18
?
10
4932
Binary Integer
Word integer16
152
15
to 2
15
1
32,768 to 32,767
Short integer32
312
31
to 2
31
1
2.14
?
10
9
to 2.14
?
10
9
Long integer64
632
63
to 2
63
1
9.22
?
10
18
to 9.22
?
10
18
Packed BCD
Integers
8018 (decimal
digits)
Not Pertinent
(10
18
+ 1) to (10
18
1)