Trait float_cmp::ApproxEq

source ·
pub trait ApproxEq: Sized {
    type Margin: Copy + Default;

    fn approx_eq<M: Into<Self::Margin>>(self, other: Self, margin: M) -> bool;

    fn approx_ne<M: Into<Self::Margin>>(self, other: Self, margin: M) -> bool { ... }
}
Expand description

A trait for approximate equality comparisons.

Required Associated Types§

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§

This method tests that the self and other values are equal within margin of each other.

Provided Methods§

This method tests that the self and other values are not within margin of each other.

Implementations on Foreign Types§

Implementors§