In: Computer Science
the speed of light in centimeters is 2.99 x 10^10. Give the bit pattern to represent this number as a double-precision floating point value according to the IEEE standard. (Hint: You might want to convert it first to a binary number and then wangle it into floating point)
Now, we'll convert it into 64-bit double-precision floating-point number.
Representation of 64-bit:
1(sign bit) | 11(exponent bit) | 52(mantissa) |
STEP 1:
Normalizing a scientific number means that the decimal point is moved to the left-most possible position by adjusting the exponent accordingly.
For example:
Similarly,
STEP 2:
The normalization of the binary number resulted in the adjusted exponent of 34.
As per IEEE Standard 1023 needs to be added in the exponent.
Exponent = 1023 + 24 = 1057
STEP 3:
Mantisaa = 1011110110001011011100101100000000000000000000000000
STEP 4:
sign = 0 (positve number)
Double-precision representation of (29900000000) in binary is:
0 | 10000100001 | 1011110110001011011100101100000000000000000000000000 |