How to convert any base 10 integer to a rational power of 2?

For example, through (lots of) trial and error with a calculator, I figured out that:

1.551e+25 is approximately equal to 2^83.6814

Is there an equation or algorithm for a conversion like this?

Thanks!

• Take logs base $2$ and round? – lulu Apr 24 at 20:40

Given a number $$N$$ you want to find a number $$x$$ such that $$2^x\approx N$$. By definition $$x=\log_2N=\frac{\log N}{\log 2}.$$ This will not be a rational number in general, but you can round it to get a good approximation.