Trait approx::RelativeEq
source · [−]pub trait RelativeEq<Rhs = Self>: AbsDiffEq<Rhs> where
Rhs: ?Sized, {
fn default_max_relative() -> Self::Epsilon;
fn relative_eq(
&self,
other: &Rhs,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool;
fn relative_ne(
&self,
other: &Rhs,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool { ... }
}
Expand description
Equality comparisons between two numbers using both the absolute difference and relative based comparisons.
Required methods
fn default_max_relative() -> Self::Epsilon
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.
Provided methods
The inverse of RelativeEq::relative_eq
.