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