You may find this hard to believe, but there are people still alive today who once did their mathematical calculations by sliding sticks back and forth. No keypads, no batteries, no LEDs. Just sticks.

Yes, it sounds like a device from the Stone Age, but as late as the 1970s scientists and engineers commonly used such a stick-sliding device, known as a slide rule, to perform multiplication and division and other tasks like extracting square roots. Working versions of these instruments still are on display in museums today.

But as primitive as they sound, slide rules could not have been invented in the Stone Age or even in ancient Greece. They owe their existence to a much later mathematical development that is celebrating its 400th anniversary this year: the invention of logarithms.

Back in those days, when the Scientific Revolution was just revving up, doing math was tedious and frustrating. Measurements of features of the Earth, navigational problems, astronomical phenomena, all demanded high-level calculational prowess from the practitioners of those disciplines. But when the numbers involved were large, manipulating them was messy. Even the best math wizards made almost as many mistakes as baseball umpires do today.

Then in 1614 John Napier, a Scottish landowner and theologian with some mathematical training, published Mirifici logarithmorum canonis descriptio, or A Description of the Admirable Table of Logarithms. It introduced a new method for quickly performing complicated calculations. It was a godsend. As one logarithm user noted much later, logarithms effectively doubled a mathematician’s useful lifetime.

Napier’s mathematical wizardry wasn’t universally appreciated, though, as rumors swirled that he was actually a dark wizard, à la Lord Voldemort. For one thing, Napier’s grass seemed to be greener than other landowners. And he allegedly trained a magical black rooster to identify thieves among his workers.

From a modern perspective, though, it seems more likely that he was just clever. His scientific interests led him to take an interest in agricultural experimentation, including studies on how to make the best manure. That might explain the greener grass. As for the rooster, it seems that Napier secretly covered it with coal dust and put in it a dark room. He then told the workers one-by-one to go into the room and touch the bird, which supposedly would crow only at the guilty party. Obviously all the innocent workers went in and touched the rooster, while the true perpetrator only pretended to. Hence Napier could then identify the culprit as the only one of the workers with clean hands.

Napier’s logarithmic wizardry was rooted in trigonometry. As the Middle Ages ended, many practical problems — such as mapmaking and surveying — required sophisticated methods for calculating with lines and angles. Various savants of the era had noticed that relationships among trigonometric functions — you know, sines, cosines, that stuff — could be used to simplify certain calculations. Multiplying two numbers, for instance, could be accomplished by a process called prosthaphaeresis. It involved addition of the numbers’ cosines, which could be looked up in trigonometric tables.

Napier developed a method for short-cutting that process, deriving logarithms of sines. His book provided tables of logarithms that essentially reduced multiplication to addition, division to subtraction. Since logarithms are, in essence, exponents, or powers of numbers, they could also be exploited for calculating things like square and cube roots.

Napier had spent nearly two decades computing millions of logarithm values before publishing the tables in his book. Still, he published several years before the Swiss watchmaker Joost Bürgi, who also gets credit for developing the logarithm idea during roughly the same time period.

Napier’s and Bürgi’s systems for conceptualizing logarithms weren’t quite the same, and neither matches modern versions precisely. Today’s commonly used base 10 logarithms were introduced in primitive form by Henry Briggs after Napier died in 1617. (Briggs acknowledged, though, that it was Napier’s idea to do so.)

It wasn’t long until others figured out how to put the logarithms to use in mechanical calculations using sticks. Inscribing numbers on the sticks at intervals proportional to their logarithms made it possible to multiply numbers by proper positioning of the sticks. Edmund Gunter, a London clergyman and friend of Briggs, had the germ of the idea in 1620. But the honor of first to slide the sticks is usually accorded to William Oughtred, an Episcopal minister, who also devised a circular version of the slide rule in the 1620s. (Oughtred is also famous for suggesting the use of “x” to signify multiplication.)

Later on, other scales were added to the sticks for extracting roots or calculating trigonometric functions, plus a lot of other scales that I never learned how to use. Electronic calculators came along just in time.