Easy programs for constants computation Easy programs for constants computation

This page contains some easy C source code for constants computation.

1  Classical approaches

Any comments are welcome : sebah.pascal@fnac.net.

2  Fast approaches

The following C files contain a short and very basic approach of the binary splitting method to compute e (see the algorithm description in Binary splitting method).

Those C codes are just learning programs to permit a better understanding of the techniques used (FFT and binary splitting). Many speed or memory optimizations can be done. A really efficient program (such as the one used for PiFast for example) could save a factor of order 10 for the time and 4 for the memory.

The program runs in quasi-linear time. Here are the timings on my machine (PentiumII 350) :

Number of digits Memory used Time
250000 9.2 Mo 24 seconds
500000 18.4 Mo 54 seconds
1 million 36.8 Mo 124 seconds
2 millions 73.7 Mo 286 seconds

Any comments are welcome : xgourdon@yahoo.fr,


Back to

mathematical constants and computation


File translated from TEX by TTH, version 2.32.
On 7 Jul 2000, 00:56.