# Manually Computing Logarithms To Grok Calculators

Logarithms are everywhere in mathematics and derived fields, but we rarely think about how trigonometric functions, exponentials, square roots and others are calculated after we punch the numbers into a calculator of some description and hit ‘calculate’. How do we even know that the answer which it returns is remotely correct? This was the basic question that [Zachary Chartrand] set out to answer for [3Blue1Brown]’s Summer of Math Exposition 3 (SoME-3). Inspired by learning to script Python, he dug into how such calculations are implemented by the scripting language, which naturally led to the standard C library. Here he found an interesting implementation for the natural algorithm and the way geometric series convergence is sped up.

The short answer is that fundamental properties of these series are used to decrease the number of terms and thus calculations required to get a result. One example provided in the article reduces the naïve approach from 36 terms down to 12 with some optimization, while the versions used in the standard C library are even more optimized. This not only reduces the time needed, but also the memory required, both of which makes many types of calculations more feasible on less powerful systems.

Even if most of us are probably more than happy to just keep mashing that ‘calculate’ button and (rightfully) assume that the answer is correct, such a glimpse at the internals of the calculations involved definitely provides a measure of confidence and understanding, if not the utmost appreciation for those who did the hard work to make all of this possible.

# Console Calculator Moves One Step Closer To Original Design

With smartphone apps and spreadsheets being the main ways people crunch their numbers nowadays, there’s not much call for a desktop calculator. Or any other physical calculator, for that matter. Which is all the more reason to appreciate this  Wang 300-series calculator console’s revival through a new electronic backend.

If you haven’t made the acquaintance of the Wang calculator series, [Bob Alexander]’s previous Wang project is a perfect introduction. Despite looking very much like an overbuilt early-70s desktop calculator, what you see in the video below is just a terminal, one of four that could connect to a shared “Electronics Package” where most of the actual computational work was done. The package was big and is currently hard to come by, at least at a reasonable price, but the consoles, with their Nixie displays and sturdy keypads, are relatively abundant.

[Bob]’s previous venture into reviving his console involved embedding a PIC32-based controller, turning it into the standalone desktop calculator it never was. To keep more with the original design philosophy, [Bob]’s second stab at the problem moves much of the same circuitry from inside the console into a dedicated outboard package, albeit one much smaller than the original. The replacement package extends and enhances the console functionality a bit, adding a real-time clock and a Nixie exercise routine to ward off the dreaded cathode poisoning. [Bob] also recreates the original Wang logarithmic method of multiplication and division, which is a nice touch with its distinctive flashing display.

Seeing the Wang console hooked up to a package through that thick cable and Centronics connector is oddly satisfying. We’d love to see [Bob] take this to the logical extent and support multiple consoles, but that might be pushing things a bit.