# FLOAT value representation issue?

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 :

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)

-
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: en.wikipedia.org/wiki/Single_precision_floating-point_format 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

$$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}.$$

-
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