Converting base2 scientific notation to base10 scientific notation

3.4k Views Asked by At

I would now like to know how to convert a value in base2 scientific notation (is that the correct terminology?), say 1.93 * 2 ^ 88, into the form of A * 10 ^ B.

I want to do this without expressing the first form as a complete number and converting it back to the 2nd form.

I can get by exponent by doing 88 * (ln2 / ln10) = 26.49...

So I have A * 10 ^ 26 now.

How can I solve for A?

Complete equation: 1.93 * 2 ^ 88 = A * 10 ^ 26.


This has been moved/duplicated from https://softwareengineering.stackexchange.com/questions/231692/converting-base2-scientific-notation-to-base10-scientific-notation.

2

There are 2 best solutions below

3
On BEST ANSWER

I am not sure I properly understood your problem; so, forgive me if what I write is just stupid.

You want to convert $a 2^b$ to $c 10^d$. Obviously, you noticed that $d=\lfloor \log (a 2^b)\rfloor$. So, now you need $c$ which is given by $c=a 10^{-d} 2^{b}$ what you get easily using logarithms.

Please tell me if I understood or not the problem.

0
On

I would take a slightly different approach: solve for both the significand and exponent concurrently.

Suppose the original number is $S \times 2^n.$ First convert the entire number into a base-ten logarithm like this:

\begin{align} X &= \log_{10} (S \times 2^n) \\ &= \log_{10} (S) + \log_{10}(2^n) \\ &= \log_{10} (S) + n\log_{10}(2) \\ &= \frac{\ln(S)}{\ln(10)} + n \frac{\ln(2)}{\ln(10)}. \end{align}

Now the original number is $10^X.$ To express this in scientific notation, let \begin{align} k &= \lfloor X \rfloor, \\ M &= X - k, \\ A &= 10^M, \end{align}

and in this way we find that $S \times 2^n = A \times 10^k.$

Applying this to your example, \begin{align} X &= \log_{10}(1.93 \times 2^{88}) \\ &= \frac{\ln(1.93)}{\ln(10)} + 88 \frac{\ln(2)}{\ln(10)} \\ &\approx 0.285557 + 88 \times 0.301030 \\ &\approx 26.7762 \end{align}

Since $10^{0.7762} \approx 5.97,$ the result is $$ 1.93 \times 2^{88} = 5.97 \times 10^{26}. $$