Big Rational.Rationalize Method
Definition
Namespace: Numerics.NET
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.7
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.7
Overload List
Rationalize( | Returns the rational number that exactly equals a floating-point real number. |
Rationalize( | Approximates a real number by a rational number whose numerator and denominator do not exceed the given value. |
Rationalize(Double)
Returns the rational number that exactly equals a floating-point real number.
public static BigRational Rationalize(
double x
)
Parameters
- x Double
- A real number.
Return Value
BigRationalThe rational number that exactly equals x.
Rationalize(Double, BigInteger)
Approximates a real number by a rational number whose
numerator and denominator do not exceed the given value.
public static BigRational Rationalize(
double x,
BigInteger maxValue
)
Parameters
- x Double
- The number to approximate.
- maxValue BigInteger
- The maximum value of the numerator and the denominator of the result.
Return Value
BigRationalThe rational number with numerator and denominator less than maxValue that is closest to x.
Exceptions
Argument | maxValue is less than zero. |
Argument | An approximation that satisfies the condition could not be found. |