Trait cavalier_contours::core::traits::FuzzyOrd
source · 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§
fn fuzzy_gt_eps(&self, other: Self, fuzzy_epsilon: Self) -> bool
fn fuzzy_lt_eps(&self, other: Self, fuzzy_epsilon: Self) -> bool
Provided Methods§
sourcefn fuzzy_in_range_eps(&self, min: Self, max: Self, fuzzy_epsilon: Self) -> bool
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));
sourcefn fuzzy_in_range(&self, min: Self, max: Self) -> bool
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.