I am making a scientific calculator in C# Winform application. In that I am using double to store the answers retrieved from the calculation of function e^x. But datatype double is having some limit if it exceeds then it show the overflow related error. So can you tell me what is the largest data type to store numbers in C#.
Example: 100!
double is the largest floating point precision data type in C#. You have BigInteger, but not a BigFloat or BigDouble.
There is however in the Base Class Library on CodePlex an implementation of BigRational, which are in fact two BigIntegers:
From there website:
BigRational builds on the BigInteger introduced in .NET Framework 4 to create an arbitrary-precision rational number type. A rational number is a ratio between two integers, and in this implementation BigIntegers are used for the numerator and denominator.
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