Big Rational.Approximate Method
Approximates the rational number by another rational number whose
denominator does not exceed the given value.
Definition
Namespace: Numerics.NET
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.7
C#
The rational number with denominator less than maxDenominator that is closest to this number.
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.7
public BigRational Approximate(
BigInteger maxDenominator
)
Parameters
- maxDenominator BigInteger
- The maximum value of the denominator of the result.
Return Value
BigRationalThe rational number with denominator less than maxDenominator that is closest to this number.
Exceptions
Argument | maxDenominator is less than zero. |
Argument | An approximation that satisfies the condition could not be found. |