Trait approx::RelativeEq
source · 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 { ... }
}
Expand description
Equality comparisons between two numbers using both the absolute difference and relative based comparisons.
Required Methods
sourcefn 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.