Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

c++

bigint

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.

like image 598
Chad Harrison Avatar asked Jun 10 '11 14:06

Chad Harrison


2 Answers

The implementation of the Tcl language uses libtommath for its bigint library, and it does indeed appear to be suitable for production use. (It's a C library, not C++, but it's certainly suitable.)

like image 71
Donal Fellows Avatar answered Nov 15 '22 16:11

Donal Fellows


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.

like image 21
rubenvb Avatar answered Nov 15 '22 17:11

rubenvb