HP C A.06.05 Reference Manual

HP C/HP-UX Implementation Topics
IEEE Floating-Point Format
Chapter 10240
IEEE Floating-Point Format
The internal representation of floating-point numbers conforms to the IEEE floating-point
standard, ANSI/IEEE 754-1985, as shown in Figure 10-1.
Figure 10-1 Internal Representation of Floating-Point Numbers
The s field contains the sign of the number. The exp field contains the biased exponent (exp =
E + bias, where E is the real exponent) of the number. The values of bias and the maximum
and minimum values of the unbiased exponent appear in the following table:
E
min
-1 is used to encode 0 and denormalized numbers.
E
max
+1 is used to encode infinities and NaNs.
Table 10-2 Floating-point Bias, and Unbiased Exponents Values
float double long double
bias +127 +1023 +16383
Emax +127 +1023 +16383
Emin -126 -1022 -16382
Float
Double
Long Double
s
sexp
exp
exp
mantissa
mantissa
mantissa
1
s
1
1
823
11 52
15 112
bits
bits
bits