Need Arbitrary-Precision-Arithmetic in C#

时光毁灭记忆、已成空白 提交于 2019-12-13 13:41:47

问题


I'm in need of floating point calculations for C# that can correctly store up to maybe 500 digits/decimals. Is there any built-in-type for this, do I have to create it myself, any library available or what is the best way to go?

Thanks


回答1:


MPIR, a fork of the GMP project, has C# bindings. Personally, I've found them easier to deal with when raising problems, to the point that I no longer worry about GMP (primarily due to its tendency to exit violently when running out of memory).

There are others listed here but I have no direct experience with them so can't comment on their usefulness.




回答2:


Another alternative that is more liberally licensed than MPIR is the BigInteger class available in the source code for the Bouncycastle C# library.



来源:https://stackoverflow.com/questions/4116078/need-arbitrary-precision-arithmetic-in-c-sharp

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