Numerically consistent Eq
, Ord
and Hash
implementations for various num
types (u32
, f64
, num_bigint::BigInt
, etc.).
Example
use Ordering;
use Hasher;
use DefaultHasher;
use ;
assert!;
assert!;
assert!;
// 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!;
assert_ne!;
assert_eq!;
// same hash values are guaranteed for equal numbers
let mut hasher1 = new;
3u64.num_hash;
let mut hasher2 = new;
3.0f32.num_hash;
assert_eq!