Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Im learning how the mantisse and exponent are working in the float representation

Ivve managed to catch the idea from here

however i have a problem analyzing a value.

from this picture : enter image description here

please look at line #7 (at the right side).

they wrote :

2^(-126)  = 1.18*10^(-38)

how did they do this conversion ?

can you please specify the steps for me to future convertion ? (like this)

share|cite|improve this question
Are you asking about converting the bit string to $2^{-126}$ or converting $2^{-126}$ to $1.18 \cdot 10^{-38}$? The former is explained here: The latter is just a primitive approximation. – Karolis Juodelė Jun 1 '12 at 16:17
@KarolisJuodelė im asking about that approximation......but i cant understand it. – Royi Namir Jun 1 '12 at 18:48
up vote 1 down vote accepted

$$2^k = (10^{\log_{10}(2)})^k = 10^{\lfloor \log_{10}(2) \cdot k \rfloor + \varepsilon} = 10^{\varepsilon} \times 10^{\lfloor \log_{10}(2) \cdot k \rfloor} $$

where $\lfloor \cdot \rfloor$ means round to $-\infty$ and $\varepsilon \in [0, 1)$ is the remaining fractional part of the exponent. Then $10^{\varepsilon} \in [1, 10)$. For $k= -126$ you get $\log_{10}(2) \cdot -126 \approx -37.9298$ and so

$$2^{-126} \approx 10^{0.0702} \times 10^{-38} \approx 1.175 \times 10^{-38}.$$

share|cite|improve this answer
can ypu please explain 10^{\lfloor \log_{10}(2) \cdot k \rfloor + \varepsilon} ? – Royi Namir Jun 1 '12 at 18:38
$k \cdot \log_{10} 2$ is a real number, while the scientific notation requires an integer. $\varepsilon$ is the fractional part of this number. – Karolis Juodelė Jun 1 '12 at 18:52

Your Answer


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.