如何在变量中保留一个大数字? [英] How to hold a big number in variables?
本文介绍了如何在变量中保留一个大数字?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨。
我需要持有并处理大到10 ^ 32的数字。似乎system.int64不足以容纳这样的数字。我可以使用哪种变量或其他解决方案?两种语言的解决方案都很受欢迎,但最好是在VB中,特别是最简单的方法。
Hi.
I need to hold and do processing on numbers as big as 10^32. It seems system.int64 is not wide enough to hold such numbers. What variable or other solution can I use? Solution in both languages is appreciated but better to be in VB, Specially the most simple approach.
推荐答案
使用 BigInteger [ ^ ]
它允许的数字大小仅受你的限制RAM ^^
在.NET 4中引入的
use BigInteger[^]
its allows numbers size only limited by your RAM ^^
introduced in .NET 4
我认为你必须将它存储在Long
$ b $中b
点击此处查看说明
http://msdn.microsoft.com/en-us/library/ae55hdtk.aspx [ ^ ]
I think you must store it in Long
Click here for Explanation
http://msdn.microsoft.com/en-us/library/ae55hdtk.aspx[^]
这篇关于如何在变量中保留一个大数字?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文