使用任意数字

use*_*163 1 c# math integer

我想编写一个类,可以使用简单的命令来处理任意长度的数字,如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

我该怎么办?

Tim*_*ter 6

您可以使用 System.Numerics.BigInteger

表示任意大的有符号整数.