开发者

Very, very large numbers in vb.net

How is it possible to deal with incredibly long (large) numbers in vb.net?

I am working on Problem 25 in Project Euler, and my program cannot handle these computations.

Is there a data type that c开发者_Python百科an handle thousands of digits?


System.Numerics.BigInteger in .NET 4.0.


The point of the challenge is to make you write the code to handle big numbers. Using a library definitely isn't the point. You know how to solve it with a (large) piece of paper and a pencil, right?

Note how a large number you write on paper can also be a List(Of Digit). All you gotta do is figure out how to add them. And declare victory when the Count property turns into 1000.


One solution is to use the BigInteger function from the Microsoft Visual J# library(when your Framework version is < 4). Just add a reference to vjslib in your project.

Or use String, but that could be slow.

Frome here: Large Number Calculations

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜