0

How do I convert $0$ $00000001$ $00000000000000000000000$ into a floating point number?

Apparently the sign is +

I've started with $00000001$ which is 1 in decimal.

Then I applied formula $exponent = c -127 \Rightarrow exponent = -126$ and I got stuck.

John Lennon
  • 1,302

2 Answers2

1

Hint: IEEE singles have a hidden implied highest bit in the mantissa. Therefore your number is the smallest normalised positive single (32-bit) number, and the answer is $2^{-126} \approx 0.117549435\cdot10^{-37}$

gammatester
  • 18,827
1

I'm assuming this is IEEE754 single precision. In which case

The sign bit is 0 so the the number is positive

The exponent $e$ is $00000001_2 = 1$

The mantissa $m$ is $1.00000000000000000000000_2 = 1 $ The leading 1 is implied.

The number is thus

$m \times 2^{e-127} = 1 \times 2^{-126} \approx 1.17549435082228750796873653722 \times 10^{-38}$

There is an interactive tool here

And more information on Wikipedia here

Warren Hill
  • 3,092