Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What should I use for a BigInt class in .NET?

Until BCL finally ships System.Numeric.BigInt, what do you guys use for arbitrary precision integers?

like image 690
ripper234 Avatar asked Feb 19 '09 23:02

ripper234


People also ask

Is INT64 same as BigInt?

BigInt is not the same as INT64 no matter how much they look alike. Part of the reason is that SQL will frequently convert Int/BigInt to Numeric as part of the normal processing. So when it goes to OLE or . NET the required conversion is NUMERIC to INT.

What is a BigInt in C#?

The BigInteger type is an immutable type that represents an arbitrarily large integer whose value in theory has no upper or lower bounds. The members of the BigInteger type closely parallel those of other integral types (the Byte, Int16, Int32, Int64, SByte, UInt16, UInt32, and UInt64 types).

Is BigInt same as long?

The equivalent of Java long in the context of MySQL variables is BigInt. In Java, the long datatype takes 8 bytes while BigInt also takes the same number of bytes.

How big is a BigInt?

A big integer is a binary integer with a precision of 63 bits. The range of big integers is -9223372036854775808 to +9223372036854775807.


2 Answers

You could try mine on codeplex: BigInteger

Or here's another: codeproject

like image 170
Scott Avatar answered Oct 13 '22 11:10

Scott


F# has Microsoft.FSharp.Math.BigInt and Microsoft.FSharp.Math.BigNum.

like image 25
Richard Avatar answered Oct 13 '22 11:10

Richard