Chapter 13. Computing π

It is truly amazing that a number so easily described—the ratio of a circle's circumference to its diameter—could have occupied the minds of so many eminent mathematicians over the centuries. The number π is both irrational and transcendental,[1] and people have been attempting to devise formulas and algorithms that compute estimates of its value or that can generate as many of its exact digits as possible.

In this chapter, we'll look at some of these attempts. The BigFunctions class we wrote in Chapter 12 will enable us to test some of the formulas and algorithms.

Estimates of π and Ramanujan's Formulas

Some people claim that the Christian Bible implies that the value of π is 3. Other estimates that were used throughout history ...

Get Java™ Number Cruncher: The Java Programmer's Guide to Numerical Computing now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.