Trait FloatMargin

Source
pub trait FloatMargin: Copy + Default {
    type F;
    type I;

    // Required methods
    fn zero() -> Self;
    fn epsilon(self, epsilon: Self::F) -> Self;
    fn ulps(self, ulps: Self::I) -> Self;
}
Expand description

A margin specifying a maximum distance two floating point values can be while still being considered equal enough.

Required Associated Types§

Source

type F

A floating-point type used for epsilon values

Source

type I

An integer type used for ulps values

Required Methods§

Source

fn zero() -> Self

Zero margin

Source

fn epsilon(self, epsilon: Self::F) -> Self

Set the epsilon value for this margin

Source

fn ulps(self, ulps: Self::I) -> Self

Set the ulps value for this margin

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.

Implementors§