DOC

How calculators work

What the Log Key Is Really Approximating

The log key is not consulting an infinite table. It reduces the input, approximates a smaller problem, and rebuilds the answer.

The log key is one of the calculator’s most suspicious-looking buttons. Press it and a long decimal appears almost immediately. There is no visible table, no tiny mathematician inside the case, and no time for a series with hundreds of terms.

The honest answer is more interesting: the calculator turns a large problem into a controlled local approximation. The exact recipe varies by implementation, so no single diagram should be mistaken for the algorithm in every handheld model. The shared idea is reduction, approximation, and correction.

large inputreduce the scalesmall local problemapproximate and rebuildlog result

First, separate scale from detail

An input such as 130 is not equally difficult in every part. It has a scale component, because it is near a power of ten, and a detail component, because it is 1.3 times that power. Logarithm identities let a routine separate those pieces:

log(130) = log(13) + log(10).

The machine can handle the scale through an exponent-like adjustment and concentrate its approximation work on a smaller interval. The purpose is not to pretend that logarithms are simple. It is to keep the hard part well behaved.

A number separated into a power scale and mantissa beside a logarithm curve
Reduction keeps the approximation focused on the part of the input that still needs close attention.

The curve is approximated in a neighborhood

Once the input is in a useful range, a numerical routine can approximate the logarithm with a polynomial, a rational expression, a series, a table-assisted correction, or another method. NIST’s Digital Library of Mathematical Functions catalogs several computational methods for elementary functions, which is a useful reminder that calculators are implementations, not magical definitions.

reducemove the argument into a friendly range
approximateuse a local numerical form
correctrestore the discarded scale

The approximation is chosen because it behaves predictably in that small range. A method that would be clumsy across every positive number may be efficient after the input has been normalized.

A logarithm curve assembled from small approximation tiles
The smooth curve on the screen can be assembled from a finite numerical recipe.

Precision is part of the design

The routine has to balance speed, memory, range, and error. More terms can improve accuracy but consume time or storage. A wider table can shorten the correction but costs memory. A routine can also choose different paths for inputs near 1, near a power of the base, or near a boundary where cancellation becomes risky.

wide curvezoomsmall intervalcorrectstable answer

That is why a scientific calculator’s log function is a design achievement disguised as a button. It compresses a family of numerical decisions into one gesture.

A magnifying lens revealing correction marks on a narrow section of a logarithm curve
Good numerical design is often the art of making a difficult curve locally manageable.
The log key is a shortcut through a landscape, not a stored answer to every possible input.

Sources and further reading