Function malachite_base::num::exhaustive::exhaustive_positive_primitive_ints
source · pub fn exhaustive_positive_primitive_ints<T: PrimitiveInt>() -> PrimitiveIntIncreasingRange<T> ⓘ
Expand description
Generates all positive primitive integers in ascending order.
Let $L=2^W-1$ if T
is unsigned and $L=2^{W-1}-1$ if T
is signed, where $W$ is the width of
the type.
The output is $(k)_{k=1}^{L}$.
The output length is $L$.
§Complexity per iteration
Constant time and additional memory.
§Examples
use malachite_base::iterators::prefix_to_string;
use malachite_base::num::exhaustive::exhaustive_positive_primitive_ints;
assert_eq!(
prefix_to_string(exhaustive_positive_primitive_ints::<u8>(), 10),
"[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ...]"
)