Expand description
num-order implements numerically consistent [Eq][std::cmp::Eq], [Ord][std::cmp::Ord] and
[Hash][std::hash::Hash] for various num types
Example:
use std::cmp::Ordering;
use num_order::NumOrd;
assert!(NumOrd::num_eq(&3u64, &3.0f32));
assert!(NumOrd::num_lt(&-4.7f64, &-4i8));
assert!(!NumOrd::num_ge(&-3i8, &1u16));
// 40_000_000 can be exactly represented in f32, 40_000_001 cannot
// 40_000_001 becames 40_000_000.0 in f32
assert_eq!(NumOrd::num_cmp(&40_000_000f32, &40_000_000u32), Ordering::Equal);
assert_ne!(NumOrd::num_cmp(&40_000_001f32, &40_000_001u32), Ordering::Equal);
assert_eq!(NumOrd::num_partial_cmp(&f32::NAN, &40_000_002u32), None);This crate serves applications where float-ord, num-cmp, numcmp can be used, but supports more numeric types and hashing.