How To Calculate Base-2 Logarithm Without A Calculator

Cevic
4 min readJan 24, 2021

In this article I’m going to go over a technique for evaluating the base-2 logarithm of any number, especially huge ones, but first, let me review what a logarithm is: as Wikipedia says,

The logarithm is the inverse function to exponentiation. That means the logarithm of a given number x is the exponent to which another fixed number, the base b, must be raised, to produce that number x.

To put it simply, when I write log2 512, where 2 is the base, what I mean is: “if 2 to the x equals 512, how much is x?” In this case, the answer is 9.

Graph of the base-2 logarithm near the origin.

Base-2 logarithms in particular are extremely useful in computer science, since computers use bits, or binary digits, to store data; so for example if you want to know “How many bits do I need to store every number up to 10,000,000?”, the answer is simply log2 10,000,000.

Now that you know something about what logarithms are and what they are used for, there’s one last thing you need to know to use this method: you have to memorize the first 10 powers of 2, or you can even compute those when you need to, you just have to double the value to get to the next one.

--

--

Cevic
Cevic

Written by Cevic

Hi guys, I’m 19 years old, i live in Italy and I’m currently studiyng Computer Engineering in college.

No responses yet