Search code examples
c#javabigdecimalequivalent

What is the equivalent of the Java BigDecimal class in C#?


BigDecimal is a class in the java.math package that has a lot of benefits for handling big numbers of a certain scale. Is there an equivalent class or data type in c# with this feature.


Solution

  • C# only has BigInteger built it (in .NET framework 4).

    Is decimal enough precision for your task? It's a 128-bit number that can hold values in the range ±1.0 × 10−28 to ±7.9 × 1028.