Oracle® Solaris Studio 12.4: Numerical Computation Guide

Exit Print View

Updated: January 2015
 
 

2.2.2 Single Format

The IEEE single format consists of three fields: a 23-bit fraction f; an 8-bit biased exponent e; and a 1-bit sign s. These fields are stored contiguously in one 32-bit word, as shown in the following figure. Bits 0:22 contain the 23-bit fraction, f, with bit 0 being the least significant bit of the fraction and bit 22 being the most significant; bits 23:30 contain the 8-bit biased exponent, e, with bit 23 being the least significant bit of the biased exponent and bit 30 being the most significant; and the highest-order bit 31 contains the sign bit, s.

Figure 2-1  Single Storage Format

image:Representation of bits in single-storage format.

Table 2–2 shows the correspondence between the values of the three constituent fields s, e and f, on the one hand, and the value represented by the single- format bit pattern on the other; u means that the value of the indicated field is irrelevant to the determination of the value of the particular bit patterns in single format.

Table 2-2  Values Represented by Bit Patterns in IEEE Single Format
Single-Format Bit Pattern
Value
0 < e < 255
(–1)s × 2e–127 × 1.f ( normal numbers)
e = 0; f ≠ 0
(at least one bit in f is nonzero)
(–1)s × 2126 × 0.f ( subnormal numbers)
e = 0; f = 0
(all bits in f are zero)
(–1)s × 0.0 (signed zero)
s = 0; e = 255; f = 0 (all bits in f are zero)
+INF (positive infinity)
s = 1; e = 255; f = 0 (all bits in f are zero)
–INF (negative infinity)
s = u; e = 255; f ≠ 0
(at least one bit in f is nonzero)
NaN (Not-a-Number)

Notice that when e < 255, the value assigned to the single format bit pattern is formed by inserting the binary radix point immediately to the left of the fraction's most significant bit, and inserting an implicit bit immediately to the left of the binary point, thus representing in binary positional notation a mixed number (whole number plus fraction, wherein 0 ≤ fraction < 1).

The mixed number thus formed is called the single-format significand. The implicit bit is so named because its value is not explicitly given in the single- format bit pattern, but is implied by the value of the biased exponent field.

For the single format, the difference between a normal number and a subnormal number is that the leading bit of the significand (the bit to left of the binary point) of a normal number is 1, whereas the leading bit of the significand of a subnormal number is 0. Single-format subnormal numbers were called single-format denormalized numbers in IEEE Standard 754.

The 23-bit fraction combined with the implicit leading significand bit provides 24 bits of precision in single-format normal numbers.

Examples of important bit patterns in the single-storage format are shown in Table 2–3. The maximum positive normal number is the largest finite number representable in IEEE single format. The minimum positive subnormal number is the smallest positive number representable in IEEE single format. The minimum positive normal number is often referred to as the underflow threshold. (The decimal values for the maximum and minimum normal and subnormal numbers are approximate; they are correct to the number of figures shown.)

Table 2-3  Bit Patterns in Single-Storage Format and Their IEEE Values
Common Name
Bit Pattern (Hex)
Decimal Value
+0
00000000
0.0
–0
80000000
–0.0
1
3f800000
1.0
2
40000000
2.0
maximum normal number
7f7fffff
3.40282347e+38
minimum positive normal number
00800000
1.17549435e–38
maximum subnormal number
007fffff
1.17549421e–38
minimum positive subnormal number
00000001
1.40129846e–45
+∞
7f800000
Infinity
–∞
ff800000
–Infinity
Not-a-Number
7fc00000
NaN

A NaN (Not a Number) can be represented with any of the many bit patterns that satisfy the definition of a NaN. The hex value of the NaN shown in Table 2–3 is just one of the many bit patterns that can be used to represent a NaN.