views:

174

answers:

6

Duplicate: Working with incredibly large numbers in .net

Does anyone know of a dot net class that will store LARGE integer values? and by LARGE values, I mean values that exceed the maximum size of the basic data types.

I would hope that there would be a microsoft supplied class, but failing that I would be open to a 3rd party library.

A: 

The Int64 value type represents integers with values ranging from negative 9,223,372,036,854,775,808 through positive 9,223,372,036,854,775,807.

Do you think that's not enough for your basic type.

J.W.
A: 

There is a BigInteger type in the J# libraries. You can use them from C#. It may complicate your deployment tho as you will have to deploy the J# redistributable.

JP Alioto
+2  A: 

this question seems to have been asked before and answered by http://stackoverflow.com/questions/279038/working-with-incredibly-large-numbers-in-net

yamspog
lol @ earning rep for pointing out that your own question is a dupe...
Daniel LeCheminant
A: 

There's the Decimal data type, which offers up to 28 digits of precision. More than that and you will need to find a 3rd party library of some sort.

Summary of built-in types: http://msdn.microsoft.com/en-us/library/47zceaw7(VS.71).aspx

A: 

I must say I was surprised there isn't an equivalent BigInteger type to match the one in Java. They do occasionally have uses, did a bit of research apparently there will be a built in BigInt type in c# 4.0.

PeteT
A: 

There is actually an internal BigInt class in .NET that is used for some cryptography operations

You can use Reflector to take a peek at it, look for System.Security.Cryptography.BigInt.

Colin Cochrane