In. net, the maximum available data type is ulong (unsigned 64-bit ).
In some special cases (such as cryptography), we need to use an extra-long integer larger than 64 bits for complex operations such as addition, subtraction, multiplication, division, and even power.
In this case ,.Net4.0Provides corresponding data typesBiginteger.
For more information, see msdn:
> Biginteger Member
Http://msdn.microsoft.com/zh-cn/library/system.numerics.biginteger_members.aspx
> Biginteger Structure
Http://msdn.microsoft.com/zh-cn/library/system.numerics.biginteger.aspx
> System. numerics namespace
Http://msdn.microsoft.com/zh-cn/library/system.numerics.aspx
However, as mentioned above, this data type can be found in.Net4.0.. Net3.5 does existSystem. numericsThis namespace does not exist in. net3.5. The namespace does not exist in. net2.0.
The following provides the biginteger source code (. CS) built by experts, which can be used in any. Net version to implement the functions described above.
>C # biginteger class(Codeproject)