[−][src]Trait decorum::cmp::FloatEq
Equivalence relation for floating-point primitives.
FloatEq
agrees with the total ordering provided by FloatOrd
. See the
module documentation for more. Importantly, given the set of NaN
representations $N$, FloatEq
expresses:
$$ \begin{aligned} a=b&\mid a\in{N},~b\in{N}\cr[1em] n>x&\mid n\in{N},~x\notin{N} \end{aligned} $$
Examples
Comparing NaN
s using primitive floating-point types:
use decorum::cmp::FloatEq; use decorum::Infinite; let x = 0.0f64 / 0.0; // `NaN`. let y = f64::INFINITY - f64::INFINITY; // `NaN`. assert!(FloatEq::eq(&x, &y));
Required methods
Loading content...Implementations on Foreign Types
impl<T> FloatEq for [T] where
T: Encoding + Nan + Primitive,
[src]
Loading content...
T: Encoding + Nan + Primitive,