pub trait SimplestRationalInInterval {
    // Required methods
    fn simplest_rational_in_open_interval(x: &Self, y: &Self) -> Rational;
    fn simplest_rational_in_closed_interval(x: &Self, y: &Self) -> Rational;
}
Expand description

Finds the simplest Rational contained in an interval.

Required Methods§

source

fn simplest_rational_in_open_interval(x: &Self, y: &Self) -> Rational

Finds the simplest Rational contained in an open interval.

Simplicity is defined as follows: If two Rationals have different denominators, then the one with the smaller denominator is simpler. If they have the same denominator, then the one whose numerator is closer to zero is simpler. Finally, if $q > 0$, then $q$ is simpler than $-q$.

source

fn simplest_rational_in_closed_interval(x: &Self, y: &Self) -> Rational

Finds the simplest Rational contained in a closed interval.

Simplicity is defined as follows: If two Rationals have different denominators, then the one with the smaller denominator is simpler. If they have the same denominator, then the one whose numerator is closer to zero is simpler. Finally, if $q > 0$, then $q$ is simpler than $-q$.

Object Safety§

This trait is not object safe.

Implementors§