pub fn nonzero_finite_primitive_floats_increasing<T: PrimitiveFloat>(
) -> NonzeroValues<PrimitiveFloatIncreasingRange<T>>Notable traits for NonzeroValues<I>impl<I: Iterator> Iterator for NonzeroValues<I> where
    I::Item: PartialEq<I::Item> + Zero
type Item = I::Item;
Expand description

Generates all finite nonzero primitive floats, in ascending order.

Positive and negative zero are both excluded.

-MAX_FINITE is generated first and MAX_FINITE is generated last. The returned iterator is double-ended, so it may be reversed.

Let $\varphi$ be to_ordered_representation:

The output is $$ (\varphi^{-1}(k))_ {k=1}^{2^M(2^E-1)-1} ⧺ (\varphi^{-1}(k))_ {k=2^M(2^E-1)+2}^{2^{M+1}(2^E-1)} $$.

The output length is $2^{M+1}(2^E-1)-2$.

  • For f32, this is $2^{32}-2^{24}-2$, or 4278190078.
  • For f64, this is $2^{64}-2^{53}-2$, or 18437736874454810622.

Complexity per iteration

Constant time and additional memory.

Examples

use malachite_base::iterators::prefix_to_string;
use malachite_base::num::exhaustive::nonzero_finite_primitive_floats_increasing;
use malachite_base::num::float::NiceFloat;

assert_eq!(
    prefix_to_string(nonzero_finite_primitive_floats_increasing::<f32>().map(NiceFloat), 20),
    "[-3.4028235e38, -3.4028233e38, -3.402823e38, -3.4028229e38, -3.4028227e38, \
    -3.4028225e38, -3.4028222e38, -3.402822e38, -3.4028218e38, -3.4028216e38, -3.4028214e38, \
    -3.4028212e38, -3.402821e38, -3.4028208e38, -3.4028206e38, -3.4028204e38, -3.4028202e38, \
    -3.40282e38, -3.4028198e38, -3.4028196e38, ...]"
);
assert_eq!(
    prefix_to_string(
        nonzero_finite_primitive_floats_increasing::<f32>().rev().map(NiceFloat),
        20
    ),
    "[3.4028235e38, 3.4028233e38, 3.402823e38, 3.4028229e38, 3.4028227e38, 3.4028225e38, \
    3.4028222e38, 3.402822e38, 3.4028218e38, 3.4028216e38, 3.4028214e38, 3.4028212e38, \
    3.402821e38, 3.4028208e38, 3.4028206e38, 3.4028204e38, 3.4028202e38, 3.40282e38, \
    3.4028198e38, 3.4028196e38, ...]"
);