Function malachite_nz::integer::exhaustive::exhaustive_positive_integers
source · pub const fn exhaustive_positive_integers() -> IntegerIncreasingRangeToInfinity ⓘ
Expand description
Generates all positive Integer
s in ascending order.
The output length is infinite.
§Worst-case complexity per iteration
$T(i) = O(i)$
$M(i) = O(1)$, amortized.
where $T$ is time, $M$ is additional memory, and $i$ is the iteration number.
§Examples
use malachite_base::iterators::prefix_to_string;
use malachite_nz::integer::exhaustive::exhaustive_positive_integers;
assert_eq!(
prefix_to_string(exhaustive_positive_integers(), 10),
"[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ...]"
)