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?
If you are using the .NET Framework 4.0, you can use BigInteger
. Just add a reference to the System.Numerics
assembly.
There are plenty of other implementations as well if the .NET Framework 4.0 isn't available to you, like this one on CodeProject.
You can use System.Numerics.BigInteger
from .Net 4.0.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With