我想编写一个类,可以使用简单的命令来处理任意长度的数字,如DD(10000000000,10000000000)show20000000000
我在C#中找到了数据类型的限制列表:
Data type Maximum positive value
Int32 2,147,483,647
UInt32 4,294,967,295
Int64 9,223,372,036,854,775,808
UInt64 18,446,744,073,709,551,615
Run Code Online (Sandbox Code Playgroud)
但是,如果我的号码是,那该怎么办? 20,000,000,000,000,000,000,000,000
我该怎么办?
你可以使用System.Numerics.BigInteger:
http://msdn.microsoft.com/en-us/library/system.numerics.biginteger(v=vs.110).aspx