pub const fn integer_increasing_range_to_infinity(
a: Integer,
) -> IntegerIncreasingRangeToInfinity ⓘ
Expand description
Generates all Integer
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 the previously-generated value is positive and its
least-significant limb is Limb::MAX
, the worst case space and time complexities are constant.
§Examples
use malachite_base::iterators::prefix_to_string;
use malachite_nz::integer::exhaustive::integer_increasing_range_to_infinity;
use malachite_nz::integer::Integer;
assert_eq!(
prefix_to_string(integer_increasing_range_to_infinity(Integer::from(-4)), 10),
"[-4, -3, -2, -1, 0, 1, 2, 3, 4, 5, ...]"
)