Click here to Skip to main content
15,889,034 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hallo. Is there any bigdecimal class in C sharp like java? I need bigdecimal class for C sharp.
Posted

I haven't seen any, but there are a few options for BigIntegers, which you could fairly easily use to make a BigFraction type with an overloaded ToString decimal representation:

1) BigInt[^], I wrote this one and it has a solid .NET interface, allows truly arbitrary size BigIntegers, and is reasonably fast.

2) C# BigInteger Class[^], this implementation is very fast but has a fixed sized which consequently can lead to wasted memory and memory overflow exceptions depending on what you are doing. Also, the interface isn't quite unified with other .NET numeric types.

3) BigInteger Library[^], this ones new and takes a similar approach to (2)

4) J# BigInteger[^], Microsoft's own implementation for J#. Drawbacks: it's a reference type, camel-case, no operator overloading, have to distribute J# runtime.

5) GNU MP Bignum.NET Wrapper[^], a wrapper around the GNU MP Bignum Library. Drawback: uses unsafe code.
 
Share this answer
 
v2
The .NET framework 4 has the BigInteger Structure [^].
 
Share this answer
 
There is Double[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900