Java Reference
In-Depth Information
Actual Significand: 1.fffffffffffffffffffffff (24 digits)
Stored Significand: fffffffffffffffffffffff (23 digits)
If you always represent the significand of a binary floating-point number in normalized form, there is a gap
around zero on the number line. The minimum number in magnitude that can be represented in IEEE
single-precision format can be computed as follows:
Sign : It can be 0 or 1, denoting a pocsitive or negative number. For this example, let's
assume the sign bit as 0 to indicate a positive number.
Exponent : The minimum exponent value is -126. Recall that the exponent values -127 and 128
are reserved to represent special floating-point numbers. The minimum biased exponent will
be -126 + 127 = 1. The binary representation of the biased exponent 1 in 8-bit is 00000001.
Significand : The minimum value of significand in the normalized form will consist of the
leading 1 bit and all 23 fraction bits set to 0 as 1.00000000000000000000000.
If you combine the binary representation of a normalized floating-point number with the minimum possible values
for the exponent and significand, the actual number stored in the computer will look like the one shown in Table 3-7 .
Table 3-7. Minimum Possible Normalized Number
Sign
Exponent
Significand
0
00000001
00000000000000000000000
1-bit
8-bit
23-bit
The value of the minimum floating-point number in decimal is 1.0 x 2 -126 . Therefore, 1.0 x 2 -126 is the first
representable normalized number after zero, leaving a gap around zero on the number line.
If you store only normalized floating-point numbers using IEEE single-precision format, all numbers less than
1.0 x 2 -126 in magnitude must be rounded to zero. This will cause a serious problem when dealing with tiny numbers
in a program. In order to store numbers smaller than 1.0 x 2 -126 the numbers must be denormalized.
Special Floating-Point Numbers
This section describes special floating-point numbers and their representations in the IEEE single-precision format.
Signed Zeros
The IEEE floating-point format allows for two zeros, +0.0 (or 0.0) and -0.0. Zero is represented by the minimum exponent
value -127 for the single-precision format. The significand is 0.0 for zero. Since the sign bit can be 0 or 1, there are two
zeros: +0.0 and -0.0. The binary representations of zeros in the single-precision format are shown in Table 3-8 .
Table 3-8. Binary Representations of Positive and Negative Zeros in the Single-Precision Format
Number
Sign
Exponent
Significand
0.0
0
00000000
00000000000000000000000
-0.0
1
00000000
00000000000000000000000
 
Search WWH ::




Custom Search