Trait float_cmp::ApproxEq
[−]
[src]
pub trait ApproxEq: Ulps { fn approx_eq(&self, other: &Self, ulps: Self::U) -> bool; fn approx_ne(&self, other: &Self, ulps: Self::U) -> bool { ... } }
ApproxEq is a trait for approximate equality comparisons, and is defined only for floating point types.
Required Methods
fn approx_eq(&self, other: &Self, ulps: Self::U) -> bool
This method tests for self
and other
values to be approximately equal
within ulps
floating point representations. See module documetation
for an understanding of ulps
.
Provided Methods
fn approx_ne(&self, other: &Self, ulps: Self::U) -> bool
This method tests for self
and other
values to be not approximately
equal, not within ulps
floating point representations. See module
documetation for an understanding of ulps
.