Does C# support arbitrary precision arithmetic (I think this is also called bignums)?
If it doesn't, which libraries do support it?
There is a BigInteger
structure that supports arbitrary-size integers.
http://msdn.microsoft.com/en-us/library/system.numerics.biginteger.aspx
Nothing for floating-point though.
You've already found the big integer; if you need big rational numbers (that is, fractions where the numerator and denominator are big integers) you can use the Rational class from the Solver library:
http://msdn.microsoft.com/en-us/library/microsoft.solverfoundation.common.rational(v=vs.93).aspx
F# has a BigNum type at Microsoft.FSharp.Math.BigNum
, you should be able to use it from C# as well.
This type exists in the F# Powerpack . Download it and reference the appropriate DLL (I suppose it's FSharp.Powerpack.Dll, but you'll need a little trial and error).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With