[][src]Trait approx::RelativeEq

pub trait RelativeEq<Rhs = Self>: AbsDiffEq<Rhs> where
    Rhs: ?Sized
{ fn default_max_relative() -> Self::Epsilon;
fn relative_eq(
        &self,
        other: &Rhs,
        epsilon: Self::Epsilon,
        max_relative: Self::Epsilon
    ) -> bool; fn relative_ne(
        &self,
        other: &Rhs,
        epsilon: Self::Epsilon,
        max_relative: Self::Epsilon
    ) -> bool { ... } }

Equality comparisons between two numbers using both the absolute difference and relative based comparisons.

Required methods

fn default_max_relative() -> Self::Epsilon

The default relative tolerance for testing values that are far-apart.

This is used when no max_relative value is supplied to the relative_eq macro.

fn relative_eq(
    &self,
    other: &Rhs,
    epsilon: Self::Epsilon,
    max_relative: Self::Epsilon
) -> bool

A test for equality that uses a relative comparison if the values are far apart.

Loading content...

Provided methods

fn relative_ne(
    &self,
    other: &Rhs,
    epsilon: Self::Epsilon,
    max_relative: Self::Epsilon
) -> bool

The inverse of ApproxEq::relative_eq.

Loading content...

Implementations on Foreign Types

impl RelativeEq<f32> for f32[src]

impl RelativeEq<f64> for f64[src]

impl<'a, T: RelativeEq + ?Sized> RelativeEq<&'a T> for &'a T[src]

impl<'a, T: RelativeEq + ?Sized> RelativeEq<&'a mut T> for &'a mut T[src]

impl<T: RelativeEq + Copy> RelativeEq<Cell<T>> for Cell<T>[src]

impl<T: RelativeEq + ?Sized> RelativeEq<RefCell<T>> for RefCell<T>[src]

impl<A, B> RelativeEq<[B]> for [A] where
    A: RelativeEq<B>,
    A::Epsilon: Clone
[src]

Loading content...

Implementors

Loading content...