CalcPi documentation
Installation
Windows
Go to the download page and download the appropriate package for your computer. If you have a 64-bit Windows, download either CalcPi_*_MSVC64_Setup.exe or CalcPi_*_MinGW64_Setup.exe. Both are equally fast, the MinGW64 setup is smaller because MSVC64 setup contains the Visual C++ redistributables. If you have a 32-bit Windows, download CalcPi_*_MSVC32_Setup.exe. After downloading the setup, double-click it and follow the instructions.
If you prefer the portable version (without installation), download either calc_pi_*_msvc64.zip or calc_pi_*_msvc32.zip, depending on your Windows version. If you have problems running them, you probably need the Visual C++ redistributables. Download them from this page.
OS X, Linux, *BSD...
Only Windows binaries are provided. If you want to run the tool on other platforms, you will have to compile it yourself. See the project wiki for instructions.
User interface
After starting the tool, you will see a window similar to this:
First, choose one of the following algorithms using the drop-down menu:
- PI: Parallel Chudnovsky (GMP): This algorithm calculates pi using a parallel implementation of the Chudnovsky algorithm, based on GMP/MPIR multiprecision arithmetic. The code was published here.
- PI: Chudnovsky (GMP): This algorithm calculates pi using the Chudnovsky algorithm, based on GMP/MPIR multiprecision arithmetic. The code was published here.
- PI: MPFR: This algorithm calculates pi using the routine mpfr_const_pi of the library MPFR.
- E: MPFR: Calculates e (base of the natural logarithm) using the routine mpfr_exp of the library MPFR.
Algorithm name | Multi-threading | Progress bar | Maximum number of digits |
PI: Parallel Chudnovsky (GMP) | X | X | unknown (only by memory) |
PI: Chudnovsky (GMP) | X | unknown (only by memory) | |
PI: MPFR | 646456992 | ||
E: MPFR | 646456992 |
Now, you can either run a benchmark to determine the speed of the algorithm on your computer and the memory consumption of the algorithm, or directly enter the desired number of digits and then hit the "Go!" button.
The "Benchmark!" runs the algorithm with an increasing number of digits, starting with 1000 digits, and stopping after 5-10 seconds. With the measured runtimes and memory consumptions, two functions are fitted. If the user then enters a new number of digits, the estimated run time and the estimated memory will be calculated by using the fitted functions.
The estimated values will be
- Within a few percents of the correct values for runtimes less than 5 seconds
- Within 100-200 percent of the correct values (i.e. factor 1-2 off) for runtimes less than a couple of minutes
- Completely bogus for runtimes more than a couple of minutes
Then, enter the requested number of digits and hit "Go!". Some algorithms will show a progress bar.
After the calculation is done, the result is shown in the lower half of the window. You can scroll down to see the computed digits. The digits are grouped in tens, and 50 digits are shown per line. To the right, the offset of the first digit is shown.
If you want to store the result in a file, use the menu item File
-> Save result.
Developers documentation
For documentation on how to compile CalcPi yourself, see the
developer documentation in the Wiki.