Trait float_cmp::ApproxOrdUlps
[−]
[src]
pub trait ApproxOrdUlps: ApproxEqUlps { fn approx_cmp_ulps(
&self,
other: &Self,
ulps: <Self::Flt as Ulps>::U
) -> Ordering; fn approx_lt_ulps(&self, other: &Self, ulps: <Self::Flt as Ulps>::U) -> bool { ... } fn approx_le_ulps(&self, other: &Self, ulps: <Self::Flt as Ulps>::U) -> bool { ... } fn approx_gt_ulps(&self, other: &Self, ulps: <Self::Flt as Ulps>::U) -> bool { ... } fn approx_ge_ulps(&self, other: &Self, ulps: <Self::Flt as Ulps>::U) -> bool { ... } }
ApproxOrdUlps is for sorting floating point values where approximate equality is considered equal.
Required Methods
fn approx_cmp_ulps(
&self,
other: &Self,
ulps: <Self::Flt as Ulps>::U
) -> Ordering
&self,
other: &Self,
ulps: <Self::Flt as Ulps>::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_ulps(&self, other: &Self, ulps: <Self::Flt as Ulps>::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_ulps(&self, other: &Self, ulps: <Self::Flt as Ulps>::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_ulps(&self, other: &Self, ulps: <Self::Flt as Ulps>::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_ulps(&self, other: &Self, ulps: <Self::Flt as Ulps>::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
.