You can use the BigInteger type that was introduced in .NET 4.
Represents an arbitrarily large signed integer.
You can use an instance of BigInteger , as you would use any other type of integral. BigInteger overloads standard numeric operators so you can perform basic mathematical operations such as addition, subtraction, division, multiplication, subtraction, negation, and unary negation.
source share