Finds the closest Rational
to this Rational
whose denominator is no
larger than limit
.
Finds the closest Rational
to this Rational
whose denominator is no
larger than limit
.
See http://en.wikipedia.org/wiki/Stern%E2%80%93Brocot_tree#Mediants_and_binary_search
Returns a Rational
whose denominator and numerator are no larger than
max
and whose value is close to the original.
Returns a Rational
whose denominator and numerator are no larger than
max
and whose value is close to the original. This applies, even if, for
example, this Rational
is greater than max
. In that case,
Rational(max, 1)
is returned.
A positive integer.
Returns a Rational
whose numerator and denominator both fit in an Int
.
Returns a Rational
whose numerator and denominator both fit in an Int
.
Returns a Rational
whose numerator and denominator both fit in a Long
.
Returns a Rational
whose numerator and denominator both fit in a Long
.
Find the n-th root of this Rational
.
Find the n-th root of this Rational
. This requires an (implicit)
ApproximationContext
to bound the allowable absolute error of the answer.
Returns this Rational
to the exponent exp
.
Returns this Rational
to the exponent exp
. Both the numerator and
denominator of exp
must be valid integers. Anything larger will cause
pow
to throw an ArithmeticException
.