[−][src]Trait approx::ApproxEq
Equality comparisons based on floating point tolerances.
Associated Types
type Epsilon
Used for specifying relative comparisons.
Required Methods
fn default_epsilon() -> Self::Epsilon
The default tolerance to use when testing values that are close together.
This is used when no epsilon
value is supplied to the relative_eq
or ulps_eq
macros.
fn default_max_relative() -> Self::Epsilon
The default relative tolerance for testing values that are far-apart.
This is used when no max_relative
value is supplied to the relative_eq
macro.
fn default_max_ulps() -> u32
The default ULPs to tolerate when testing values that are far-apart.
This is used when no max_relative
value is supplied to the relative_eq
macro.
fn relative_eq(
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
A test for equality that uses a relative comparison if the values are far apart.
fn ulps_eq(&self, other: &Self, epsilon: Self::Epsilon, max_ulps: u32) -> bool
A test for equality that uses units in the last place (ULP) if the values are far apart.
Provided Methods
fn relative_ne(
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
The inverse of ApproxEq::relative_eq
.
fn ulps_ne(&self, other: &Self, epsilon: Self::Epsilon, max_ulps: u32) -> bool
The inverse of ApproxEq::ulps_eq
.
Implementations on Foreign Types
impl ApproxEq for f32
[src]
impl ApproxEq for f32
type Epsilon = f32
fn default_epsilon() -> f32
[src]
fn default_epsilon() -> f32
fn default_max_relative() -> f32
[src]
fn default_max_relative() -> f32
fn default_max_ulps() -> u32
[src]
fn default_max_ulps() -> u32
fn relative_eq(&self, other: &f32, epsilon: f32, max_relative: f32) -> bool
[src]
fn relative_eq(&self, other: &f32, epsilon: f32, max_relative: f32) -> bool
fn ulps_eq(&self, other: &f32, epsilon: f32, max_ulps: u32) -> bool
[src]
fn ulps_eq(&self, other: &f32, epsilon: f32, max_ulps: u32) -> bool
fn relative_ne(
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
[src]
fn relative_ne(
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
fn ulps_ne(&self, other: &Self, epsilon: Self::Epsilon, max_ulps: u32) -> bool
[src]
fn ulps_ne(&self, other: &Self, epsilon: Self::Epsilon, max_ulps: u32) -> bool
impl ApproxEq for f64
[src]
impl ApproxEq for f64
type Epsilon = f64
fn default_epsilon() -> f64
[src]
fn default_epsilon() -> f64
fn default_max_relative() -> f64
[src]
fn default_max_relative() -> f64
fn default_max_ulps() -> u32
[src]
fn default_max_ulps() -> u32
fn relative_eq(&self, other: &f64, epsilon: f64, max_relative: f64) -> bool
[src]
fn relative_eq(&self, other: &f64, epsilon: f64, max_relative: f64) -> bool
fn ulps_eq(&self, other: &f64, epsilon: f64, max_ulps: u32) -> bool
[src]
fn ulps_eq(&self, other: &f64, epsilon: f64, max_ulps: u32) -> bool
fn relative_ne(
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
[src]
fn relative_ne(
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
fn ulps_ne(&self, other: &Self, epsilon: Self::Epsilon, max_ulps: u32) -> bool
[src]
fn ulps_ne(&self, other: &Self, epsilon: Self::Epsilon, max_ulps: u32) -> bool
impl<'a, T: ApproxEq> ApproxEq for &'a T
[src]
impl<'a, T: ApproxEq> ApproxEq for &'a T
type Epsilon = T::Epsilon
fn default_epsilon() -> Self::Epsilon
[src]
fn default_epsilon() -> Self::Epsilon
fn default_max_relative() -> Self::Epsilon
[src]
fn default_max_relative() -> Self::Epsilon
fn default_max_ulps() -> u32
[src]
fn default_max_ulps() -> u32
fn relative_eq(
&self,
other: &&'a T,
epsilon: T::Epsilon,
max_relative: T::Epsilon
) -> bool
[src]
fn relative_eq(
&self,
other: &&'a T,
epsilon: T::Epsilon,
max_relative: T::Epsilon
) -> bool
fn ulps_eq(&self, other: &&'a T, epsilon: T::Epsilon, max_ulps: u32) -> bool
[src]
fn ulps_eq(&self, other: &&'a T, epsilon: T::Epsilon, max_ulps: u32) -> bool
fn relative_ne(
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
[src]
fn relative_ne(
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
fn ulps_ne(&self, other: &Self, epsilon: Self::Epsilon, max_ulps: u32) -> bool
[src]
fn ulps_ne(&self, other: &Self, epsilon: Self::Epsilon, max_ulps: u32) -> bool
impl<'a, T: ApproxEq> ApproxEq for &'a mut T
[src]
impl<'a, T: ApproxEq> ApproxEq for &'a mut T
type Epsilon = T::Epsilon
fn default_epsilon() -> Self::Epsilon
[src]
fn default_epsilon() -> Self::Epsilon
fn default_max_relative() -> Self::Epsilon
[src]
fn default_max_relative() -> Self::Epsilon
fn default_max_ulps() -> u32
[src]
fn default_max_ulps() -> u32
fn relative_eq(
&self,
other: &&'a mut T,
epsilon: T::Epsilon,
max_relative: T::Epsilon
) -> bool
[src]
fn relative_eq(
&self,
other: &&'a mut T,
epsilon: T::Epsilon,
max_relative: T::Epsilon
) -> bool
fn ulps_eq(&self, other: &&'a mut T, epsilon: T::Epsilon, max_ulps: u32) -> bool
[src]
fn ulps_eq(&self, other: &&'a mut T, epsilon: T::Epsilon, max_ulps: u32) -> bool
fn relative_ne(
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
[src]
fn relative_ne(
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
fn ulps_ne(&self, other: &Self, epsilon: Self::Epsilon, max_ulps: u32) -> bool
[src]
fn ulps_ne(&self, other: &Self, epsilon: Self::Epsilon, max_ulps: u32) -> bool