Trait FloatEquals

Source
pub trait FloatEquals {
    // Required method
    fn float_equals(&self, other: &Self) -> bool;
}
Expand description

Helper trait for tests for float comparisons

This trait differs in float’s default PartialEq implementation by considering all NaN values to be equal.

Required Methods§

Source

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

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.

Implementations on Foreign Types§

Source§

impl FloatEquals for f32

Source§

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

Source§

impl FloatEquals for f64

Source§

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

Source§

impl<T> FloatEquals for Option<T>
where T: FloatEquals,

Source§

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

Implementors§