UlpsTolerance

Trait UlpsTolerance 

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

A trait specifying the tolerance used for ulps based comparisons.

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

Required Associated Constants§

Source

const DEFAULT: Self::T

The default ulps tolerance value. Used for default Tolerance.

Required Associated Types§

Source

type T: Debug + Copy

The type of the ulps tolerance values.

Provided Methods§

Source

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

Returns the default ulps 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 UlpsTolerance for f32

Source§

const DEFAULT: i32 = 4i32

Source§

type T = i32

Source§

impl UlpsTolerance for f64

Source§

const DEFAULT: i64 = 4i64

Source§

type T = i64

Source§

impl UlpsTolerance for ()

Source§

const DEFAULT: () = ()

Source§

type T = ()

Implementors§