替代 BigInteger.ModPow();在 C# 中 [英] Alternative to BigInteger.ModPow(); in C#

查看:32
本文介绍了替代 BigInteger.ModPow();在 C# 中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找 NET 4.x 中引入的 C# BigInteger 包的替代方案.

i'm looking for an alternative to the BigInteger package of C# which has been introduced with NET 4.x.

这个对象的数学运算非常慢,我猜这是因为算术是在比原始类型更高的级别上完成的 - 或者优化得不好,无论如何.

The mathematical operations with this object are terribly slow, I guess this is caused by the fact that the arithmetics are done on a higher level than the primitive types - or badly optimized, whatever.

Int64/long/ulong 或其他 64 位数字太小,无法正确计算 - 我说的是 64 位整数的 64 位整数幂.

Int64/long/ulong or other 64bit-numbers are way to small and won't calculate correctly - I'm talking about 64bit-integer to the power of 64-bit integers.

希望有人可以推荐我的东西.提前致谢.

Hopefully someone can suggest my something. Thanks in advance.

推荐答案

老实说,如果您有非常大的数字并且需要对它们进行大量计算,而 BigInteger 库仍然没有解决它对您来说,为什么不使用您所知道的最好的语言或工具包将其卸载到外部进程中呢?您是否真的必须完全用 C# 编写您想要完成的任何内容?

Honestly, if you have extremely large numbers and need to do heavy computations with them and the BigInteger library still isn't cutting it for you, why not offload it onto an external process using whatever language or toolkit you know of that does it best? Are you truly constrained to write whatever it is you're trying to accomplish entirely in C#?

例如,您可以卸载到 C# 中的 MATLAB.

For example, you can offload to MATLAB in C#.

这篇关于替代 BigInteger.ModPow();在 C# 中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆