Expand description
Total is a floating point type, suitable for use in ranges. All values are valid.
Ordering and other semantics are as per total_cmp.
Every distinct bit pattern is a separate valid value, even though quite a few of them are NaN.
For example, in a TotalF32 all 16 million different NaN values are distinct from each other.
Enable with float_experimental (stable, TotalF32/TotalF64) and
float_nightly_experimental (nightly, adds TotalF16/TotalF128).
use range_set_blaze::{RangeSetBlaze, TotalF64, TotalF32};
let set = RangeSetBlaze::from_iter([TotalF64::new(3.0)..=TotalF64::new(5.0)]);
assert!(set.contains(TotalF64::new(3.1)));
assert!(!set.contains(TotalF64::new(2.9)));
let set = RangeSetBlaze::from(TotalF64::from_primitive_range(3.0..=5.0));
assert!(set.contains(TotalF64::new(4.9)));
assert!(!set.contains(TotalF64::new(5.1)));
let set = RangeSetBlaze::from_iter(TotalF32::from_primitive_ranges([3.0..=5.0, 7.0..=9.0]));
assert!(set.contains(TotalF32::new(4.0)));
assert!(!set.contains(TotalF32::new(6.0)));Structs§
- Total
- Experimental: A transparent wrapper around floating point values with total ordering.
Traits§
- Total
Range Ext - Extension trait for converting an inclusive
Totalrange into an inclusive primitive range (or a(start, end)primitive tuple). - Total
Slice Ext - Extension trait for viewing a slice of
Totalvalues as primitive values.
Functions§
- tf32
- Construct a
TotalF32from anf32. Shorthand forTotalF32::new - tf64
- Construct a
TotalF64from anf64. Shorthand forTotalF64::new