You can use BigInteger in .Net 4.0
The BigInteger type is an immutable type, which is an arbitrarily large integer whose value in theory does not have an upper or lower bound. Members of the BigInteger type are closely related to the types of other integral types (bytes, Int16, Int32, Int64, SByte, UInt16, UInt32, and UInt64). This type is different from the other type integral in the .NET Framework, which have the range indicated by their MinValue and MaxValue Properties.
If you donβt have the luxury of switching to .Net 4. then you can use an open source project to help you name IntX .
IntX is a library of arbitrary integers written in pure C # 2.0 with a quick implementation of O (N * log N) - multiplication / division algorithms. It provides all basic arithmetic operations on integers, comparison, bitwise offset, etc. It also allows you to analyze numbers in different databases and convert them to a string, also in any database. The advantage of this library is fast multiplication, division and basic / basic conversion algorithms. All fast versions of the algorithms are based on the fast multiplication of large integers using Fast Hartley Transform, which works for O (N * log N * log log N) instead of the classic O (N ^ 2).
Ehsan source share