Module numbers

Source

Functions§

forced_cmp
Comparison between two values with only partial ordering (e.g. floating point numbers) that provides a fake full ordering by falling back to Ordering::Equal if non-comparable. Warning: this may not be what you want, but perhaps panic instead?
max_f64
std::cmp::max doesn’t work on floating point
nandropping_add
An addition that ignores NaN numbers if possible (the result should only be NaN if both arguments are NaN). In other words, NaN is treated the same as 0, as long as at least one argument isn’t NaN. (Warning: this might not be what you want.)
numbers_within
Get a function that reports whether two numbers are within maxdiff of each other (either direction).