The Endless Pursuit of Pi

Why Humanity Kept Computing π

Reading

Published: 2026-06-16

How many times does the diameter fit into the circumference of a circle? Wind a string around it and you quickly find it is "about $3$ and a bit." But the moment you try to pin down exactly what that "bit" is, you set off on a chase that lasted humanity four thousand years. That "and a bit" is the circle ratio $\pi$ ―― the most famous number in mathematics, one whose digits never come to an end no matter how far you compute.

When you write $\pi = 3.14159\ldots$, those dots go on forever. Its decimal expansion never ends and never settles into a repeating pattern (it cannot be written as a ratio of two integers ―― it is irrational). That is precisely why computing the circle ratio is always a problem of approximation ―― how close to the true value can you get? In this article we follow the story of that endless chase, and glimpse the very origin of what we call numerical computation.

Squeezing the Circle Between Polygons

What tormented the ancients was the circle ―― a curve. You can measure the length of a straight line, but a curved circumference resists any ruler. The first brilliant answer to this puzzle came from Archimedes, a Greek mathematician of the third century BCE.

His idea was this: consider a regular polygon that fits snugly inside the circle, and another that wraps snugly around it from the outside. A polygon's sides are straight, so their total length can be computed. The circumference is then longer than the inner polygon and shorter than the outer one ―― that is, taking a circle of diameter $1$ (whose circumference is exactly $\pi$), $\pi$ is squeezed between two numbers.

Add more sides and the polygons hug the circle ever more closely (Figure 1). Archimedes patiently worked all the way up to a 96-sided polygon and derived the splendid range $\dfrac{223}{71} < \pi < \dfrac{22}{7}$, that is $3.1408\ldots < \pi < 3.1428\ldots$ (the lower end lies about $0.024\%$ and the upper end about $0.040\%$ from the true value). With no computer ―― not even today's written notation for arithmetic ―― he reached this far by hand alone. Approximating a circle with polygons lets you savor this "squeeze" a little more slowly.

Bracketing pi with regular polygons inscribed in and circumscribed about a circle; as the number of sides grows from 6 to 12 to 24 the range shrinks.
Figure 1: Bracketing the circle ratio with a regular polygon inscribed in (blue) and circumscribed about (orange) a circle. As the sides grow from 6 to 12 to 24, the range squeezing $\pi$ from above and below narrows toward it. Archimedes pushed this to a 96-gon and obtained $3.1408\ldots < \pi < 3.1428\ldots$.

A note: this is already real numerical computation

Archimedes' method already contains the entire skeleton of modern numerical computation. You approximate a true value you cannot reach directly (the circumference) by something tractable (a polygon). The finer the steps (the more sides), the higher the accuracy. And you bracket the value from above and below to estimate the error bound. More than two thousand years ago, people already understood the importance of giving an answer together with its error.

Infinite Sums ―― a New Weapon

The polygon method is reliable, but more digits require doubling the number of sides again and again, computing square roots to high precision at every step ―― brutally laborious. What changed the game was the infinite series, a new weapon pioneered by the Kerala school in India (14th–16th centuries) that flourished in Europe from the seventeenth century onward. Formulas that express $\pi$ as a sum of infinitely many terms were discovered one after another.

The famous Leibniz formula (also called the Madhava–Leibniz formula, since Madhava of the Kerala school already knew it), for instance, is strikingly simple.

$$ \frac{\pi}{4} = 1 - \frac{1}{3} + \frac{1}{5} - \frac{1}{7} + \frac{1}{9} - \cdots $$

Just add and subtract the reciprocals of the odd numbers, alternating signs, and $\pi$ appears ―― a beautiful formula. Yet it approaches its limit painfully slowly: even after $100$ terms the error is still about $0.01$, after $1000$ terms about $0.001$, and after $10{,}000$ terms about $0.0001$ ―― every extra correct digit demands ten times as many terms (Figure 2) ―― slower, in fact, than polygons, which gain a digit for roughly $3$ times as many sides. So people searched desperately for series that converge faster. Using cleverly engineered formulas like the one in computing π with Machin's formula, virtuosos of hand calculation wrote out hundreds of digits of $\pi$ on paper.

For example, a series left by the Indian mathematician Nilakantha uses the same simple adding and subtracting of fractions, yet approaches $\pi$ far faster than Leibniz's formula.

$$ \pi = 3 + \frac{4}{2\cdot 3\cdot 4} - \frac{4}{4\cdot 5\cdot 6} + \frac{4}{6\cdot 7\cdot 8} - \cdots $$
A graph comparing how fast two infinite series approach pi; the Leibniz series swings widely and converges slowly while the Nilakantha series nearly coincides with the true value within a few terms.
Figure 2: How fast each infinite series approaches $\pi$. The Leibniz series (orange) swings widely above and below the true value and converges slowly ―― even after $20$ terms it is still stuck around $3.09$. The Nilakantha series (blue) all but lands on the true value $\pi$ within a few terms. The fewer the terms needed for a small error, the "faster" the series.

Since you are using a series, you must stop adding somewhere. The part you "cut off" becomes the error ―― a feeling you can get a grip on in the feel of truncating a series. A fast series, then, is simply one that "achieves a small error with few terms." Without anyone quite noticing, the race for digits of $\pi$ had become the central problem of numerical computation itself: how to approximate cleverly.

How Computers Changed the Race for Digits

When computers arrived in the twentieth century, the pursuit of $\pi$ entered a new phase. Machines blew past in an instant the digit counts that humans had spent lifetimes obtaining. But the fascinating thing is that the race did not end there ―― it accelerated. A million digits, a billion, a trillion ―― and now it reaches hundreds of trillions (Figure 3).

A graph of the number of correct digits of pi over history on a log scale; nearly flat from antiquity through the Middle Ages, then exploding after computers arrive in the mid-20th century, exceeding 100 trillion digits.
Figure 3: How the number of correctly known digits of $\pi$ has changed over time (the vertical axis is logarithmic). From Archimedes through the Middle Ages it is almost flat, but once computers appear in the mid-twentieth century the digit count explodes, today surpassing $100$ trillion.

Why compute so many? In practice a dozen or so digits of $\pi$ is more than enough ―― even handling a circle the size of the observable universe to the precision of a single hydrogen atom takes fewer than forty digits (NASA JPL estimates $37$ decimal places). We keep extending the count anyway because computing $\pi$ serves as a yardstick for the power of new algorithms and computers. Think of a fast new method? Try it on $\pi$. Build a new supercomputer? Compute $\pi$ to check that every corner of it works. Over a long computation, it can even happen that a cosmic ray strikes memory and a single bit flips for a moment (a transient error, with the hardware undamaged, called a "soft error" ―― here "soft" does not mean software, but "not a permanent failure"). Such a chance corruption shows up, from a discrepancy in even a single digit, just by running the same computation again and comparing. And by deliberately also computing with a different formula and cross-checking, you can catch even nastier faults ―― a bug in the program, or a CPU design flaw that "returns the same wrong answer every time." A $\pi$ that matches to an enormous number of digits is the surest proof that the machine ran to the end without a single mistake. The circle ratio became, somewhere along the way, the arena for testing one's technical mettle.

A note: throw a needle and π appears

There is more than one road to $\pi$. Draw parallel lines a distance $d$ apart on the floor and drop a needle of length $L$ ($L \le d$) on them at random, over and over; the needle crosses a line with probability $\dfrac{2L}{\pi d}$, so the fraction of throws that cross makes $\pi$ surface ―― the delightful experiment known as Buffon's needle. This idea of approaching an answer using dice-like randomness, together with the even simpler method of scattering points in a square (Figure 4), leads on to estimating π by the Monte Carlo method. Polygons, series, and now chance ―― it is exhilarating that tools from utterly different worlds all lead to one and the same number.

A figure of estimating pi by the Monte Carlo method: random points scattered in a square, counting those inside the quarter circle.
Figure 4: Estimating $\pi$ by the Monte Carlo method. Scatter random points uniformly in a square; four times the fraction that land inside the quarter circle approaches $\pi$ (here $\approx 3.13$ with $900$ points). A road quite unlike polygons or series ―― one that uses chance. It converges slowly, though, and is not used for high-precision computation of $\pi$ itself; it is famous instead as a teaching example of reaching an answer through randomness.

Living With "Never Divides Evenly"

What the story of $\pi$ teaches is an obvious yet profound fact: mathematics has partners that never divide neatly. $\pi$ cannot be written as a fraction (it is irrational), and as a decimal it never ends. There was never any "last digit" to begin with. So when we use it as a number, all we can do is use a value brought close enough to the precision we need, knowing it carries an error.

This is no sour grapes. It is the very starting point of the field of numerical computation. Most quantities in the world, like $\pi$, refuse to fit into neat forms. Most square roots and logarithms, and most numbers in nature ―― none of these can be written out in finitely many digits. That is exactly why we need techniques for obtaining not "the true value itself" but "a value close enough," together with a justified error. The circle ratio is the oldest and most famous exercise on which humanity has honed those techniques over two thousand years.

Coda ―― Endless, and All the Better for It

From Archimedes' polygons, through the virtuosos who wielded infinite series, to supercomputers racing for digits ―― the tools changed, yet humanity kept chasing one and the same number. Knowing full well that no end will come, still pressing for one more digit ―― this seemingly pointless obsession is exactly what forged the algorithms of approximation and raised the field of numerical computation.

"Deal wisely with numbers that never divide evenly, all the while estimating the error." That is the wisdom the circle ratio left us. Carry this feeling with you to the basic level next, and look a step deeper into floating-point numbers and the true nature of error. You should see the endless story of $\pi$ transforming into solid computational technique.

Summary

Over the two thousand years and more since Archimedes, the methods for computing $\pi$ changed as follows.

EraMethodResult
3rd century BCSqueeze the circle between inscribed and circumscribed regular polygons (Archimedes)With a 96-gon, $\dfrac{223}{71} < \pi < \dfrac{22}{7}$ (error about $0.04\%$)
14th century onward (India)
17th century onward (Europe)
Express $\pi$ as an infinite series$\dfrac{\pi}{4} = 1 - \dfrac{1}{3} + \dfrac{1}{5} - \dfrac{1}{7} + \cdots$ (Madhava–Leibniz) and others
20th century onwardLarge-scale computation by machineOver 100 trillion digits

Points to remember

  • The polygon method is reliable but inefficient: more digits require doubling the number of sides again and again, with high-precision square roots each time. What broke through that limit were fast series that gain a fixed number of digits per term (such as Machin's formula); a slow series like Leibniz's is actually less efficient than polygons.
  • For practical purposes, a dozen or so digits are plenty. Even handling a circle the size of the observable universe to the precision of a single hydrogen atom needs fewer than forty.
  • Digits keep being pushed anyway because computing $\pi$ serves as a test bench for algorithms and machines. Recomputing with a different formula and comparing catches programming mistakes, and even faults that return the same wrong answer every time.
  • $\pi$ is irrational, so its decimal expansion never ends; there is no "last digit". All we can do is use a sufficiently close value with a known error bound — and that is precisely the starting point of numerical analysis.

Further Reading

Frequently Asked Questions

Why does the decimal expansion of π never end?

π has been proven to be irrational, so it cannot be written as a ratio of two integers (a fraction). Written as a decimal it therefore never ends and never repeats. This is a property of the number itself, not of the notation, so no matter how far you compute you never reach a "last digit." That is exactly why computing π is always a problem of finding an approximation.

What good is computing trillions of digits?

Practical calculations need at most a dozen or so digits of π, and trillions of digits are almost never directly useful. But the race for digits has mattered greatly as a testbed for new fast algorithms and as a benchmark for checking that a supercomputer works correctly. More than π itself, the ingenuity of computing it quickly and accurately is what has pushed numerical computation forward.

How far has π been computed?

It reached 100 trillion digits in 2022 and 314 trillion in 2025 (as of the end of 2025). But this is a world of record-breaking, entirely separate from the number of digits any practical or scientific calculation needs (a dozen or so). The record keeps being broken whenever a new machine or algorithm appears.

What does computing π test in a computer?

It exercises large memory transfers, the precision of floating-point arithmetic, and long-running stability all at once. Because even a single wrong bit shows up in the final digits, recomputing with a different formula and comparing reveals any error. That is why computing π has been used as a reliability benchmark for checking that every corner of a machine works correctly.