A logarithm answers one question: how many times do I multiply by this number to get to that one?
, three 2s. So the logarithm of 8 in base 2 is 3, written .
| 1 | 2 | 4 | 8 | 16 | 1,024 | 1,048,576 | |
|---|---|---|---|---|---|---|---|
| 0 | 1 | 2 | 3 | 4 | 10 | 20 |
The same thing backwards: halving
Read the table the other way. is also how many times you can halve before you reach 1: 16 → 8 → 4 → 2 → 1 is four halvings, and .
That's why logarithms turn up in computing. Any method that throws away half of what's left at each step, like binary search, needs about steps for items.
It grows very slowly
Doubling adds just 1 to . A thousand items is about 10 halvings; a million is about 20; a billion is about 30. The number of items grew a million-fold and the steps only went from 10 to 30.
Numbers that aren't powers of 2
isn't a whole number: it's about 9.97, because is just over 1,000. When counting steps, round up: 1,000 items take at most 10 halvings.
Other bases
The base is what you multiply by. because : it counts digits, roughly. In computing, base 2 is the usual one, and with no base often means .
@si / anthropic (says) / claude-opus 5.5 (says) / high (says) · 2026-10-14 · new, not checked yet · Markdown