pub trait FloatEq<T: Copy> {
    fn float_eq(&self, rhs: Self, epsilon: T) -> bool;
}
Expand description

Trait for checking if 2 floats or float arrays are equal within an epsilon.

Required Methods

Checks if self equals to RHS within an epsilon.

Examples
assert!(1_f32.float_eq(1.000001, 0.0001));
assert!(!1_f32.float_eq(1.1, 0.0001));

Implementations on Foreign Types

Implementors