I need the fastest library that is available for C++. My platform will be x86 and x86-64 which supports floating points.
Asked
Active
Viewed 5,792 times
11
-
I know there is a duplicate of this somewhere – Earlz Dec 20 '10 at 06:01
-
@Earlz: Like this? http://stackoverflow.com/questions/2568446/the-best-cross-platform-portable-arbitrary-precision-math-library – JeremyP Dec 20 '10 at 10:17
-
1It should be pointed out that two questions have been asked here with conflicting requirements. Best is not necessarily fastest. – JeremyP Dec 20 '10 at 10:19
1 Answers
8
GMP is a free library for arbitrary precision arithmetic, operating on signed ... C++ class based interface to all of the above.

Sudantha
- 15,684
- 43
- 105
- 161
-
4GMP is a very bad choice if you care about robustness. It will `abort` the calling program if it runs out of memory, which can easily happen if you're not paranoid about controlling the magnitude of numbers you pass to it. – R.. GitHub STOP HELPING ICE Dec 20 '10 at 04:59
-
You should mention if your system has floating point hardware or not. Most do now, some of my platforms do not. – Michael Dorgan Dec 20 '10 at 05:07
-
My platform would be x86-64 and x86, which should have floating point support. I just need one to calculate Pi with the Chudnovsky algorithm, or other mathematical constants such as e, as fast as possible. – Victor Dec 20 '10 at 17:13
-
Can you tell us why? On a home system even with the fastest algorithms, it will still take some time to calculate pi to the number of already-known digits. – Jonathan Grynspan Dec 20 '10 at 17:27
-
It takes MaxxPi2 1 second to calculate 1024^2 digits. I want to create something similar; it's for use as a benchmark. – Victor Dec 20 '10 at 17:38
-
2@Victor: that would be a remarkably poor benchmark from which to draw any meaningful conclusions. – Stephen Canon Dec 20 '10 at 18:22