C#内存类型比ULONG大 [英] C# memory type bigger than ulong
问题描述
我需要做的巨大的功率计算(考虑2 ^ 1,000,000)在C#中,并且ULONG是远不足够的。有可能不是还有更大的.NET实现的,但有一些第三方的东西,甚至是什么我可以做,将工作?
I need to do huge power calculations (think 2 ^ 1,000,000) in C#, and a ulong is nowhere near sufficient. There's probably not anything bigger implemented in the .NET, but is there some 3rd party thing, or even something I can make that will work?
推荐答案
如果您正在使用.NET Framework 4.0,可以使用 的BigInteger
。只需添加到 System.Numerics
集的引用。
If you are using the .NET Framework 4.0, you can use BigInteger
. Just add a reference to the System.Numerics
assembly.
有很多其他的实现,以及如果的。 NET Framework 4.0中不提供给你,就像在CodeProject这一个。
There are plenty of other implementations as well if the .NET Framework 4.0 isn't available to you, like this one on CodeProject.
这篇关于C#内存类型比ULONG大的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!