Search code examples
c++bigint

Is there a generally accepted alternative to GMP for arbitrary precision?


In my quest for looking for a BigInt library, I came across this post: C or C++ BigInt library on Microsoft Windows

The accepted answer mentions the GMP library, but one of the commenters claim that library does not error out very gracefully and would not be good for production code. Has anybody done any long term development with this library? Are there any good alternatives? Thanks in advance.


Solution

  • Well, as a large project like GCC uses this for its printf and compile-time calculations (correct me if I'm wrong here), I think it's stable enough. I would think there are ways to limit the out-of-memory errors the commenter worries about, but I haven't used it personally, so I can't help you there. All I'm saying is that it is a proven stable library. It even has a C++ interface library.