Trait float_cmp::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

Object Safety§

This trait is not object safe.

Implementors§