pub trait ApproxEq: Sized {
type Margin: FloatMargin;
// Required method
fn approx_eq<M: Into<Self::Margin>>(self, other: Self, margin: M) -> bool;
// Provided method
fn approx_ne<M: Into<Self::Margin>>(self, other: Self, margin: M) -> bool { ... }
}
Expand description
A trait for approximate equality comparisons.
Required Associated Types§
sourcetype Margin: FloatMargin
type Margin: FloatMargin
This type type defines a margin within which two values are to be
considered approximately equal. It must implement Default
so that
approx_eq()
can be called on unknown types.
Required Methods§
Provided Methods§
Object Safety§
This trait is not object safe.