HP 3000 Manuals

IEEE Floating-Point Format [ HP C/iX Reference Manual ] MPE/iX 5.0 Documentation


HP C/iX Reference Manual

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 9-1.

[]
Figure 9-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: ------------------------------------------------------------------------------------------------- | | | | | | | float | double | long double | | | | | | ------------------------------------------------------------------------------------------------- | | | | | | bias | +127 | +1023 | +16383 | | | | | | | Emax | +127 | +1023 | +16383 | | | | | | | Emin | -126 | -1022 | -16382 | | | | | | ------------------------------------------------------------------------------------------------- Emin-1 is used to encode 0 and denormalized numbers. Emax+1 is used to encode infinities and NaNs. NaNs are binary floating-point numbers that have all ones in the exponent and a nonzero fraction. NaN is the term used for a binary floating-point number that has no value (that is, "Not A Number"). If E is within the range Emin <= E <= Emax the mantissa field contains the number in a normalized form, preceded by an implicit 1 and binary point. In accordance with the IEEE standard, floating-point operations are performed with traps not enabled, and the result of such an operation is that defined by the standard. This means, for example, that dividing a positive finite number by zero will yield positive infinity, and no trap will occur. Dividing zero by zero or infinity by infinity will yield a NaN, again with no trap. For a discussion of infinity arithmetic and operations with NaNs, in the context of the IEEE standard, see the HP Precision Architecture and Instruction Set Reference Manual (HP part number 09740-90014). Note that infinities and NaNs propagate through a sequence of operations. For example, adding any finite number to infinity will yield infinity. An operation on a NaN will yield a NaN. This means that you may be able to perform a sequence of calculations and then check just the final result for infinity or NaN.


MPE/iX 5.0 Documentation