pub const fn exhaustive_natural_range_to_infinity(
a: Natural
) -> ExhaustiveNaturalRangeToInfinity ⓘ
Expand description
Generates all Natural
s greater than or equal to some number $a$, in ascending order.
The output is $(k)_{k=a}^{\infty}$.
The output length is infinite.
§Worst-case complexity per iteration
$T(i) = O(i)$
$M(i) = O(i)$
where $T$ is time, $M$ is additional memory, and $i$ is the iteration number.
Although the time and space complexities are worst-case linear, the worst case is very rare. If
we exclude the cases where the least-significant limb of the previously-generated value is
Limb::MAX
, the worst case space and time complexities are constant.
§Examples
use malachite_base::iterators::prefix_to_string;
use malachite_nz::natural::exhaustive::exhaustive_natural_range_to_infinity;
use malachite_nz::natural::Natural;
assert_eq!(
prefix_to_string(exhaustive_natural_range_to_infinity(Natural::from(5u32)), 10),
"[5, 6, 7, 8, 9, 10, 11, 12, 13, 14, ...]"
)