So I am trying to convert 46bfc000 (which is a floating-point number in IEEE single precision) into a decimal value.
I can get a approximate value, but not the exact value. So here is my work for my approximate value:
1) Convert into binary: 0100 0110 1011 1111 1100 0000 0000 0000
2) Find b-exp: 141-127
3) Convert what is after the decimal value: 2^-1 + 2^-5... = .552726746
4) Now follow this equation format: (1)sign bit * (1. + value in step 3) * 2^b-exp
5) Calculate: +1 X (1.5527226746) X 2^14 = 25439.87501
Now I know that the exact value is: 24544. But I am wondering if there is a way for me to get the exact number, or is it impossible to convert a IEEE single precision binary to a decimal value?
sign * (2^len + mantissa) * 2^(exp - bias - len)
, where mantissa is the 23 bit integer value and len = 23. So then it becomes1 * 0xBFC000 * 2^(14 - 23) = 0xBFC000 / 0x200 = 0x5FE0 = 24544
. – Rudy Velthuis