FuzzyEq

Trait FuzzyEq 

Source
pub trait FuzzyEq<Rhs: ?Sized = Self> {
    // Required method
    fn fuzzy_eq(&self, other: &Rhs) -> bool;

    // Provided method
    fn fuzzy_ne(&self, other: &Rhs) -> bool { ... }
}
Expand description

A trait for fuzzy/approximate equality comparisons of float numbers.

Required Methods§

Source

fn fuzzy_eq(&self, other: &Rhs) -> bool

Returns true if values are approximately equal.

Provided Methods§

Source

fn fuzzy_ne(&self, other: &Rhs) -> bool

Returns true if values are not approximately equal.

Implementations on Foreign Types§

Source§

impl FuzzyEq for f32

Source§

fn fuzzy_eq(&self, other: &f32) -> bool

Source§

impl FuzzyEq for f64

Source§

fn fuzzy_eq(&self, other: &f64) -> bool

Source§

impl<T: FuzzyEq> FuzzyEq for Vec<T>

Source§

fn fuzzy_eq(&self, other: &Self) -> bool

Implementors§