The exponent e ranges between 0 and , where n is the number of bits in the exponent field. It has a bias of ; the mathematical exponent is . Several cases arise:
The magnitude of is at most half a unit in the last place of . The signs of the two values can differ.
Byte order of data
Although these figures describe floating-point values as strings of bits, they do not say how these bits are arranged in memory. Two conventions are in widespread use, and their differences can undermine an application's portability in the absence of tools to insulate the application from the underlying machine architecture. Figure 55 illustrates a double value x as a sequence of 8 bytes.
Byte order determines which byte is at the lowest memory address, the next lowest, and so on. Only two conventions are in common use. On big endian platforms, byte 0--the byte with the most significant bits of the value--is at the lowest memory address, byte 1 is at the next lowest, and so on until byte 7, which resides at the highest address. Little endian platforms are just the opposite: byte 7 is at the lowest address and byte 0 is at the highest.
X86 is a little endian architecture. Both PowerPC and PA-RISC, typical of new architectures, have a control register that is set (typically at startup and then never changed) to indicate either big or little endian addressing. "Byte order" on page 252 discusses the effect of byte order on portability.
Details of
floating-point formats
Table 5 gives the relevant parameters of the floating-point types.
Number system |
Platform |
Width |
Range of e |
Bias |
Width of e |
Implicit 1 bit? |
Width of f |
|
Details of floating-point storage formats |
Illustrative 6-bit numbers |
None | to | Y | ||||
float | All | to | Y | |||||
double | All | to | Y | |||||
long double | X86 | to | N | |||||
long double | PA-RISC | to | Y | |||||
long double | PowerPC | to | Y |
NOTE
On X86 platforms, values with the smallest exponent and a leading bit of 1 or larger exponents and leading bit of 0 lie outside the CommonPoint computational model. See Chapter 13 for details.
Formats with an
implicit leading bit
All formats--except long double on X86 platforms--have an implicit leading significant bit. They share other properties as well. The biased exponent ranges from 0 to
, where k is the width of the exponent field in bits. The biased exponent 0 is used to encode the value zero and subnormal numbers; in this case the implicit bit is defined to be 0, not 1, and the exponent is that of the smallest normal number. The biased exponent
is used to encode signed infinity (when f is zero) and NaNs. The lone explicit
leading 1 bit
Only the long double type on X86 platforms has an explicit leading bit in the significand. Its fraction f is 63 bits wide, for a total significand width of 64 bits. On that platform, the leading bit must be 0 for numbers with the smallest exponent and must be 1 for numbers with larger exponents.
[Contents]
[Previous]
[Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Generated with WebMaker