Approximation $\log_2(x)$ Can anyone share an easy way to approximate $\log_2(x)$, given $x$ is between $0$ and 1?
I'm trying to solve this using an old fashioned calculator (i.e. no logs)
Thanks!
EDIT: I realize that I stepped a bit ahead. The x comes in the form of a fraction, e.g. 3/8, which is indeed between 0 and 1, but could also be written as log2(3) - log2(8). I am hoping there is a quick way to approximate this calculation to let's say 2 decimals
 A: Using that $\log_2(x)=\mbox{ln}(x)/\mbox{ln}(2)$, now you can use the Taylor expansion:
\begin{equation}
\mbox{ln}(x)=\mbox{ln}\left((x-1)+1\right)=\sum_{k=1}^{\infty}\frac{(-1)^{k-1}}{k}(x-1)^k
\end{equation}
The same expansion can be used for determining the $\mbox{ln}(2)$. The first terms of the expansion are
\begin{equation}
\log_2(x)=\frac{1}{\mbox{ln}(2)}\left[(x-1)-(x-1)^2/2+...\right]
\end{equation}
This expansion is working better around $x=1$. These kind of expansion are commonly used in calculators or programming languages to compute analytic functions.
EDIT: Another possibility to compute the natural logarithm is to use the generalized continued fraction
\begin{equation}
\log((x-1)+1)=\cfrac{2(x-1)}{(x-1)+2-\cfrac{(x-1)^2}{3((x-1)+2)-\cfrac{4(x-1)^2}{5((x-1)+2)-\cfrac{9(x-1)^2}{7((x-1)+2)-\cdots}}}}
\end{equation}
I think this option will be converging faster than the Taylor expansion
As a final approximation, I would recommend you also to have a look at the Padé expansion of the logarithm. Having a fast look to the old questions in this website I found Approximating Logs and Antilogs by hand,
where user153012 gives next Padé approximation to compute the logarithm $\phi_3(x)\leq\mbox{ln}(x)\leq\psi_3(x)$ where the lower bound is
$$\phi_3(x)=\frac{x(60+60x+11x^2)}{3(20+30x+12x^2+x^3)},$$
and the upper
$$\psi_3(x)=\frac{x(30+21x+x^2)}{3(10+12x+3x^2)}.$$
A: First normalize the value to the range $[1,2)$, multiplying by $2$ as long as necessary (the number of multiplies will form the integer part of the logarithm).
Then use the formula
$$\log_2\left(\frac{1+t}{1-t}\right)=\frac2{\ln(2)}\left(t+\frac{t^3}3+\frac{t^5}5\cdots\right)$$ evaluating for 
$$t=\frac{x-1}{x+1}$$which will be in range $[0,\dfrac13)$. It will converge reasonably quickly, about one correct decimal per term. 

Another option is to keep a tabulated list of constants such as $1.5,1.25,1.125\cdots$ together with their logarithms, and use
$$x>C_i\to \log_2(x)=\log_2\left(\frac x{C_i}\right)+\log(C_i).$$
At the same time as you divide $x$ by the constants (but keeping $x>1$), you accumulate the logarithms of these constants. When $x\approx1$, you have it. You can choose the set of constants that suits you best.
A: If your input involves just multiplication or division of small natural numbers and you don't need accuracy exceeding 4 decimal numbers, then logarithmic tables could be the simplest solution.
See for example


*

*http://www.rapidtables.com/math/algebra/logarithm/Logarithm_Table.htm

*http://myhandbook.info/table_2log.html
For much bigger or smaller numbers you may apply standard reduction:
$$\log_2 (x\cdot 2^n) = \log_2 x + n$$
$$\log_2 (x/ 2^n) = \log_2 x - n$$
with some pre-selected powers, say
$2^3 = 8$, $2^5 = 32$, $2^8=256$, $2^{10} = 1024$, $2^{15}=32768$, $2^{20} = 1048576$...

You may also search the Web for some online $\log_2$ calculator, like this one.
A: $$\log(2)=\sum_{n=1}^{\infty}\frac{1}{n2^n}$$
$$(1/2)+(1/(2\cdot2^2))+(1/(3\cdot2^3))+(1/(4\cdot2^4))+(1/(5\cdot2^5))+(1/(6\cdot2^6))+(1/(7\cdot2^7))+(1/(8\cdot2^8))+(1/(9\cdot2^9))+(1/(10\cdot2^{10}))=0.6930...$$
Even by hand this is giving a simple procedure of finding $\log(2)$ in base $2$
