How can I represent a very large integer in .NET?

后端 未结 5 2032
庸人自扰
庸人自扰 2020-12-01 13:48

Does .NET come with a class capable of representing extremely large integers, such as 100 factorial? If not, what are some good third party libraries to accomplish this?

5条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-01 14:46

    .NET has a BigInteger class, but it is internal, unfortunately. However, several places have their own. You can grab an implementation from IronPython, or the one from CodeProject, or from Visual J#. I have to say, I've not tried these myself, so I don't know which one is the best.

    http://www.codeplex.com/IronPython http://www.codeproject.com/KB/cs/biginteger.aspx http://msdn.microsoft.com/en-us/magazine/cc163696.aspx

提交回复
热议问题