What's the best (for speed) arbitrary-precision library for C++? [duplicate]
Asked Answered
F

1

11

I need the fastest library that is available for C++. My platform will be x86 and x86-64 which supports floating points.

Fontana answered 20/12, 2010 at 4:30 Comment(3)
I know there is a duplicate of this somewhereSelfimportant
@Earlz: Like this? #2568946Moderate
It should be pointed out that two questions have been asked here with conflicting requirements. Best is not necessarily fastest.Moderate
W
8

GMPLIB

GMP is a free library for arbitrary precision arithmetic, operating on signed ... C++ class based interface to all of the above.

Wardieu answered 20/12, 2010 at 4:34 Comment(6)
GMP 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.Pardoner
You should mention if your system has floating point hardware or not. Most do now, some of my platforms do not.Ichang
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.Fontana
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.Scopula
It takes MaxxPi2 1 second to calculate 1024^2 digits. I want to create something similar; it's for use as a benchmark.Fontana
@Victor: that would be a remarkably poor benchmark from which to draw any meaningful conclusions.Deaton

© 2022 - 2024 — McMap. All rights reserved.