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

坚强是说给别人听的谎言 提交于 2020-01-03 09:10:08

问题


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.


回答1:


Well, as a large project like GCC uses this for it's 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.




回答2:


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.)



来源:https://stackoverflow.com/questions/6307458/is-there-a-generally-accepted-alternative-to-gmp-for-arbitrary-precision

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!