pub trait FuzzyOrd: FuzzyEq {
    // Required methods
    fn fuzzy_gt_eps(&self, other: Self, fuzzy_epsilon: Self) -> bool;
    fn fuzzy_lt_eps(&self, other: Self, fuzzy_epsilon: Self) -> bool;

    // Provided methods
    fn fuzzy_gt(&self, other: Self) -> bool { ... }
    fn fuzzy_lt(&self, other: Self) -> bool { ... }
    fn fuzzy_in_range_eps(
        &self,
        min: Self,
        max: Self,
        fuzzy_epsilon: Self
    ) -> bool { ... }
    fn fuzzy_in_range(&self, min: Self, max: Self) -> bool { ... }
}

Required Methods§

source

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

source

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

Provided Methods§

source

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

Fuzzy greater than.

source

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

Fuzzy less than.

source

fn fuzzy_in_range_eps(&self, min: Self, max: Self, fuzzy_epsilon: Self) -> bool

Test if self is in range between min and max with some epsilon for fuzzy comparing.

See FuzzyOrd::fuzzy_in_range function to use default fuzzy epsilon.

§Examples
assert!(0.99f64.fuzzy_in_range_eps(1.0, 2.0, 0.05));
assert!(1.5f64.fuzzy_in_range_eps(1.0, 2.0, 1e-5));
assert!(2.0f64.fuzzy_in_range_eps(1.0, 2.0, 1e-5));
source

fn fuzzy_in_range(&self, min: Self, max: Self) -> bool

Same as FuzzyOrd::fuzzy_in_range_eps using a default epsilon.

Default epsilon is fuzzy_epsilon from FuzzyEq trait.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl FuzzyOrd for f32

source§

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

source§

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

source§

impl FuzzyOrd for f64

source§

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

source§

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

Implementors§