In double precision floating point the bias is 1023.
The general representation formula is:
(-1)^s * (1+mantissa) * 2^(Exponent – 1023)
The value of decimal number is computed as:
The sign is stored in bit 63. The exponent can be computed from bits 62-52 by subtracting 1023. The mantissa is stored in bits 0-51.
An invisible leading bit (i.e. it is not actually stored) with value 1.0 is placed in front, then bit 51 has a value of 1/2, bit 50 has value 1/4 etc. As a result, the mantissa has a value between 1.0 and 2
Sign
bit Exponent Mantissa
0 100 0000 0010 0110 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
(-1)^0 2^3 1 + 1/4 + 1/8
1 * 8 * 1.375 =11
Comments
Leave a comment