[][src]Trait float_cmp::ApproxEq

pub trait ApproxEq: Sized {
    type Margin: Copy;
    fn approx_eq<M: Into<Self::Margin>>(self, other: Self, margin: M) -> bool;

    fn approx_ne<M: Into<Self::Margin>>(self, other: Self, margin: M) -> bool { ... }
}

ApproxEq is a trait for approximate equality comparisons. The associated type defines a margin within which two values are to be considered approximately equal.

Associated Types

type Margin: Copy

Loading content...

Required methods

fn approx_eq<M: Into<Self::Margin>>(self, other: Self, margin: M) -> bool

This method tests for self and other values to be approximately equal within margin.

Loading content...

Provided methods

fn approx_ne<M: Into<Self::Margin>>(self, other: Self, margin: M) -> bool

This method tests for self and other values to be not approximately equal within margin.

Loading content...

Implementations on Foreign Types

impl ApproxEq for f32[src]

type Margin = F32Margin

fn approx_ne<M: Into<Self::Margin>>(self, other: Self, margin: M) -> bool[src]

impl ApproxEq for f64[src]

type Margin = F64Margin

fn approx_ne<M: Into<Self::Margin>>(self, other: Self, margin: M) -> bool[src]

Loading content...

Implementors

Loading content...