The main story is the IEEE standard binary floating point number:
When the IEEE754 standard is indicated by the floating point, each floating point number consists of three parts: symbol bit S, index portion E and the mantissa portion M.
We know that the number of scientific counts of 10-based number is like a = -3.5 × 105
Here, there is a negative number here, 3.5 is the mantissa, two valid numbers, and the rear of the index of 10 is 5.
We can represent it as -3.5e5
Similarly, the number of binary numbers can also be expressed by scientific counting, such as 5 this number, if used in binary, the integer is 101, if the scientific count method can be expressed as 1.25 × 24, here is the ten into, the number of tails Changed to binary is 1.01 (that is, 101 moves forward with two decimal points, and the decimal is exactly the same), the rear index 4 is converted to the binary, then we can write it with a binary scientific count method to write into 1.01e10.
When we determine its precision (effective bit) in accordance with such a count, you can represent a real number with a bit string of 1 and 0.
The floating point is generally used in the following four basic formats:
(1) Single precision format (32 bits): After removing the symbol bit 1 position, e accounts for 8 bits, and M accounts for 23 digits.
(2) Extended single precision format: E> = 11 bits, M31.
(3) Double intensive format: (64-bit); E = 11 bits, m = 52 bits.
(4) Extended double precision format: E> = 15 bits, m> 63 bits.
What we are most important is to master the representation of single-precision format. In the IEEE754 standard, the agreement of the decided decimal point hidden in the left side, usually the number is 1, so that the number of effective digits of the mantissa is only 24 digits, that is, the tail is 1.m. The value of the index is referred to herein, in order to represent the positive and negative of the index, the degree of the degree is transmitted, the shift code value is 127, the order code value is from 1 to 254 to -126 to 127, in IEEE754 All numerical bits have been used, explicitly explicitly expressed in infinity and 0, and the "non-specific amount" is also introduced, so that the number of absolute values is more accurately represented. Please see the following table:
S (1 bit) e (8-bit) m (23-bit) n (32 bits)
符 0 0 (-1) s · 2e-127 ·
1.m) is the number of specifications
0 does not equal 0 (-1) s · 2-126 · (
0.m) is a non-specific number
No equal to 0 (-1) s · 2e-127 between 1 to 254 · 2E-127 ·
1.m) is the number of specifications
255 is not equal to 0 nan (non-numerical)
555 0 infinite
Among them, red characters 0, 1 indicate implicit positions, pay attention
When the numeric N is a non-specific amount or 0, the implied position is 0.
Remembered the above form to calculate all the single-precision binary floating point of all IEEE standards, we focus on the two-way conversion of the specified digital, and understand the idea of binary floating point representation.