Search code examples
c#.netmathbigdecimal

How to handle float values that are greater than the maximum value of double


I have values greater than 1.97626258336499E-323

I cant use BigInteger also as it handler only integer values

Any help is appreciated

Here is the code that failed also failed with some solution given by some users:

BigValue / (Math.Pow((1 + ret), j));

WHere BigValue is something like 15000.25

ret is -0.99197104212554987

And j will go to around 500-600.

I am not gettting how to use Rational Class for this too


Solution

  • BigRational from the base class library team from Microsoft. It uses big integers to store it as a fraction, but supports all kinds of operators.

    When it comes to printing it as a decimal, I think you need to write your own implementation for that. I have one written somewhere for this class, but I'd have to find it.