BigRational.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#
public BigRational Approximate(
	BigInteger maxDenominator
)

Parameters

maxDenominator  BigInteger
The maximum value of the denominator of the result.

Return Value

BigRational
The rational number with denominator less than maxDenominator that is closest to this number.

Exceptions

ArgumentOutOfRangeException

maxDenominator is less than zero.

ArgumentException

An approximation that satisfies the condition could not be found.

See Also