Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I am stuck with a problem, enter image description here

Now here is the formula applied to a question, enter image description here

The red colored bits show the exponent(e) while, the yellow bits are fraction (f). Now I am confused with how did the author convert the fraction (f) into 1-2^(-23). I understand that he has converted from binary to decimal to get this value but how do I convert such a big number from binary to decimal?

EDIT:

One trick that my teacher told me was to convert from binary to hexadecimal and then convert the value to decimal easily. But doing that has given me a value 8388607 which is not equal to 1 - 2 ^(-23)

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

The conversion from $23$ bits, all $1$ to $1-2^{23}$ comes from the fact that summing $\sum_{i=1}^{23}2^{-i}=1-2^{-23}$. The final conversion is from $-2^{128}$ (the $2^{104}$ is negligible) to $-3.4E38$, which is done using the base $10$ logarithm of $2$. $\log_{10}2^{128}=128\log_{10}2\approx 128\cdot.30103\approx 38.532$, so $2^{128} \approx 3.4E38$

share|improve this answer
add comment

I think that knowledge about U2 (a.k.a ZU2) binary coding and number conversions might be helpful :

http://en.wikipedia.org/wiki/Two%27s_complement

For exercises with IEEE-754 you might like this on-line calc:

http://www.binaryconvert.com/

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.