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?
Share
If you are using the .NET Framework 4.0, you can use
BigInteger. Just add a reference to theSystem.Numericsassembly.There are plenty of other implementations as well if the .NET Framework 4.0 isn’t available to you, like this one on CodeProject.