Trait float_cmp::ApproxOrdUlps
[−]
[src]
pub trait ApproxOrdUlps: ApproxEqUlps { fn approx_cmp(&self, other: &Self, ulps: Self::U) -> Ordering; fn approx_lt(&self, other: &Self, ulps: Self::U) -> bool { ... } fn approx_le(&self, other: &Self, ulps: Self::U) -> bool { ... } fn approx_gt(&self, other: &Self, ulps: Self::U) -> bool { ... } fn approx_ge(&self, other: &Self, ulps: Self::U) -> bool { ... } }
ApproxOrdUlps is for sorting floating point values where approximate equality is considered equal.
Required Methods
fn approx_cmp(&self, other: &Self, ulps: Self::U) -> Ordering
This method returns an ordering between self
and other
values
if one exists, where Equal is returned if they are approximately
equal within ulps
floating point representations. See module
documentation for an understanding of ulps
Provided Methods
fn approx_lt(&self, other: &Self, ulps: Self::U) -> bool
This method tests less than (for self
< other
), where values
within ulps
of each other are not less than. See module
documentation for an understanding of ulps
.
fn approx_le(&self, other: &Self, ulps: Self::U) -> bool
This method tests less than or equal to (for self
<= other
)
where values within ulps
are equal. See module documentation
for an understanding of ulps
.
fn approx_gt(&self, other: &Self, ulps: Self::U) -> bool
This method tests greater than (for self
> other
)
where values within ulps
are not greater than. See module
documentation for an understanding of ulps
fn approx_ge(&self, other: &Self, ulps: Self::U) -> bool
This method tests greater than or equal to (for self
> other
)
where values within ulps
are equal. See module documentation
for an understanding of ulps
.