pub fn exhaustive_rational_range_to_negative_infinity(
    a: Rational
) -> ExhaustiveRationalRangeToNegativeInfinity 
Expand description

Generates all Rationals less than or equal to some Rational $a$.

The output length is infinite.

§Worst-case complexity per iteration

$T(i) = O(\log i (\log \log i)^2 \log\log\log i)$

$M(i) = O(\log i \log \log i)$

where $T$ is time, $M$ is additional memory, and $i$ is the iteration number.

§Examples

use malachite_base::iterators::prefix_to_string;
use malachite_base::num::conversion::traits::ExactFrom;
use malachite_q::exhaustive::exhaustive_rational_range_to_negative_infinity;
use malachite_q::Rational;

assert_eq!(
    prefix_to_string(
        exhaustive_rational_range_to_negative_infinity(Rational::exact_from(
            std::f64::consts::PI
        )),
        20
    ),
    "[0, 1/2, 1, 1/3, -1, -1/2, 2, 1/4, -2, 3/2, 3, -1/3, -3, -3/2, -4, 1/5, -5, 5/2, -6, \
    2/3, ...]"
)