# Stuck with IEEE-754 format (binary to decimal conversion)

I am stuck with a problem,

Now here is the formula applied to a question,

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)`

-

## 2 Answers

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$

-

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/

-
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 11, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.9245986342430115, "perplexity_flag": "middle"}