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.
The TotalF32/TotalF64 wrappers are available by default. Enable
float_nightly_experimental on nightly to add 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
- 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§
- tf16
float_nightly_experimental - Construct a
TotalF16from anf16. Shorthand forTotalF16::new - tf32
- Construct a
TotalF32from anf32. Shorthand forTotalF32::new - tf64
- Construct a
TotalF64from anf64. Shorthand forTotalF64::new - tf128
float_nightly_experimental - Construct a
TotalF128from anf128. Shorthand forTotalF128::new
Type Aliases§
- Total
F16 float_nightly_experimental - Total ordered f16, all values valid, including NaN, -0.0, +0.0, and infinities.
- Total
F32 - Total ordered f32, all values valid, including NaN, -0.0, +0.0, and infinities.
- Total
F64 - Total ordered f64, all values valid, including NaN, -0.0, +0.0, and infinities.
- Total
F128 float_nightly_experimental - Total ordered f128, all values valid, including NaN, -0.0, +0.0, and infinities.