Trait approx::RelativeEq [−][src]
pub trait RelativeEq: AbsDiffEq { fn default_max_relative() -> Self::Epsilon; fn relative_eq(
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool; fn relative_ne(
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool { ... } }
Equality comparisons between two numbers using both the absolute difference and relative based comparisons.
Required Methods
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 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.
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
.
Implementations on Foreign Types
impl RelativeEq for f32
[src]
impl RelativeEq for f32
fn default_max_relative() -> f32
[src]
fn default_max_relative() -> f32
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 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
impl RelativeEq for f64
[src]
impl RelativeEq for f64
fn default_max_relative() -> f64
[src]
fn default_max_relative() -> f64
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 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
impl<'a, T: RelativeEq + ?Sized> RelativeEq for &'a T
[src]
impl<'a, T: RelativeEq + ?Sized> RelativeEq for &'a T
fn default_max_relative() -> T::Epsilon
[src]
fn default_max_relative() -> T::Epsilon
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 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
impl<'a, T: RelativeEq + ?Sized> RelativeEq for &'a mut T
[src]
impl<'a, T: RelativeEq + ?Sized> RelativeEq for &'a mut T
fn default_max_relative() -> T::Epsilon
[src]
fn default_max_relative() -> T::Epsilon
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 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
impl<T: RelativeEq + Copy> RelativeEq for Cell<T>
[src]
impl<T: RelativeEq + Copy> RelativeEq for Cell<T>
fn default_max_relative() -> T::Epsilon
[src]
fn default_max_relative() -> T::Epsilon
fn relative_eq(
&self,
other: &Cell<T>,
epsilon: T::Epsilon,
max_relative: T::Epsilon
) -> bool
[src]
fn relative_eq(
&self,
other: &Cell<T>,
epsilon: T::Epsilon,
max_relative: T::Epsilon
) -> 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
impl<T: RelativeEq + ?Sized> RelativeEq for RefCell<T>
[src]
impl<T: RelativeEq + ?Sized> RelativeEq for RefCell<T>
fn default_max_relative() -> T::Epsilon
[src]
fn default_max_relative() -> T::Epsilon
fn relative_eq(
&self,
other: &RefCell<T>,
epsilon: T::Epsilon,
max_relative: T::Epsilon
) -> bool
[src]
fn relative_eq(
&self,
other: &RefCell<T>,
epsilon: T::Epsilon,
max_relative: T::Epsilon
) -> 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
impl<T: RelativeEq> RelativeEq for [T] where
T::Epsilon: Clone,
[src]
impl<T: RelativeEq> RelativeEq for [T] where
T::Epsilon: Clone,
fn default_max_relative() -> T::Epsilon
[src]
fn default_max_relative() -> T::Epsilon
fn relative_eq(
&self,
other: &[T],
epsilon: T::Epsilon,
max_relative: T::Epsilon
) -> bool
[src]
fn relative_eq(
&self,
other: &[T],
epsilon: T::Epsilon,
max_relative: T::Epsilon
) -> 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
impl<T: RelativeEq> RelativeEq for Complex<T> where
T::Epsilon: Clone,
[src]
impl<T: RelativeEq> RelativeEq for Complex<T> where
T::Epsilon: Clone,
fn default_max_relative() -> T::Epsilon
[src]
fn default_max_relative() -> T::Epsilon
fn relative_eq(
&self,
other: &Complex<T>,
epsilon: T::Epsilon,
max_relative: T::Epsilon
) -> bool
[src]
fn relative_eq(
&self,
other: &Complex<T>,
epsilon: T::Epsilon,
max_relative: T::Epsilon
) -> 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