pub trait ApproxEq<Eps> {
// Required methods
fn approx_epsilon() -> Eps;
fn approx_eq_eps(&self, other: &Self, approx_epsilon: &Eps) -> bool;
// Provided method
fn approx_eq(&self, other: &Self) -> bool { ... }
}
Expand description
Trait for testing approximate equality
Required Methods§
Sourcefn approx_epsilon() -> Eps
fn approx_epsilon() -> Eps
Default epsilon value
Sourcefn approx_eq_eps(&self, other: &Self, approx_epsilon: &Eps) -> bool
fn approx_eq_eps(&self, other: &Self, approx_epsilon: &Eps) -> bool
Returns true
is this object is approximately equal to the other one, using
a provided epsilon value.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.