EpsTolerance

Trait EpsTolerance 

Source
pub trait EpsTolerance<Rhs = Self>
where Rhs: ?Sized,
{ type T: Debug + Copy; const DEFAULT: Self::T; // Provided method fn default_eps(&self, _other: &Rhs) -> Self::T { ... } }
Expand description

A trait specifying the tolerance used for absolute epsilon based comparisons.

This tolerance if for the type implementing this trait comparing to Rhs.

Required Associated Constants§

Source

const DEFAULT: Self::T

The default epsilon tolerance value. Used for default Tolerance.

Required Associated Types§

Source

type T: Debug + Copy

The type of the epsilon tolerance values.

Provided Methods§

Source

fn default_eps(&self, _other: &Rhs) -> Self::T

Returns the default eps tolerance value that is used when comparing self with other.

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 EpsTolerance for f32

Source§

const DEFAULT: f32 = 9.99999997E-7f32

Source§

type T = f32

Source§

impl EpsTolerance for f64

Source§

const DEFAULT: f64 = 9.9999999999999999E-15f64

Source§

type T = f64

Source§

impl EpsTolerance for ()

Source§

const DEFAULT: () = ()

Source§

type T = ()

Implementors§