howto calculate pi to large (eg 10^6) places

Joseph Landman landman at
Mon Sep 15 07:58:32 EDT 2003

Hi Joe:

  There are many methods available.  You can exploit various of the
expansions which yield pi or 1/pi.  You will need an extended precision
library, such as David Bailey's MP, or similar.

  As for algorithms, you have several choices.  The
Bailey-Borwein-Plouffe method will give you hexadecimal digits, though
it might not be as compute intensive as you wish.  See for
some nice details on some of this.

  Note:  some of the good folks at Cray used to do this with their
machines.  One of the "burn-in" tests was generating a few
hundred-million digits.


On Mon, 2003-09-15 at 07:19, Joseph Mack wrote:
> I was reading Petr Beckmann's book on the history of pi, which includes a chapter
> on the digit hunters (people who calculated pi to large numbers of digits).
> He says that (repeatedly) calculating pi to large numbers of places is a good way
> of testing whether a machine is functioning accurately.
> I just looked with google for such a program but couldn't find anything that went 
> beyond the bit width (32 or 64) of the host machine. Does anyone know where
> I can get the code? How do you do a calculation to 10^6 places on a 32 bit
> machine?
> Thanks Joe
Joseph Landman, Ph.D
Scalable Informatics LLC
email: landman at
phone: +1 734 612 4615

Beowulf mailing list, Beowulf at
To change your subscription (digest mode or unsubscribe) visit

More information about the Beowulf mailing list