[][src]Trait cgmath::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<A, B> RelativeEq<[B]> for [A] where
    A: RelativeEq<B>,
    <A as AbsDiffEq<B>>::Epsilon: Clone
[src]

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

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

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

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

impl RelativeEq<f64> for f64[src]

impl RelativeEq<f32> for f32[src]

Loading content...

Implementors

impl<A: Angle> RelativeEq<Euler<A>> for Euler<A>[src]

impl<S: VectorSpace, R, E: BaseFloat> RelativeEq<Decomposed<S, R>> for Decomposed<S, R> where
    S: RelativeEq<Epsilon = E>,
    S::Scalar: RelativeEq<Epsilon = E>,
    R: RelativeEq<Epsilon = E>, 
[src]

impl<S: BaseFloat> RelativeEq<Basis2<S>> for Basis2<S>[src]

impl<S: BaseFloat> RelativeEq<Basis3<S>> for Basis3<S>[src]

impl<S: BaseFloat> RelativeEq<Deg<S>> for Deg<S>[src]

impl<S: BaseFloat> RelativeEq<Matrix2<S>> for Matrix2<S>[src]

impl<S: BaseFloat> RelativeEq<Matrix3<S>> for Matrix3<S>[src]

impl<S: BaseFloat> RelativeEq<Matrix4<S>> for Matrix4<S>[src]

impl<S: BaseFloat> RelativeEq<Point1<S>> for Point1<S>[src]

impl<S: BaseFloat> RelativeEq<Point2<S>> for Point2<S>[src]

impl<S: BaseFloat> RelativeEq<Point3<S>> for Point3<S>[src]

impl<S: BaseFloat> RelativeEq<Quaternion<S>> for Quaternion<S>[src]

impl<S: BaseFloat> RelativeEq<Rad<S>> for Rad<S>[src]

impl<S: BaseFloat> RelativeEq<Vector1<S>> for Vector1<S>[src]

impl<S: BaseFloat> RelativeEq<Vector2<S>> for Vector2<S>[src]

impl<S: BaseFloat> RelativeEq<Vector3<S>> for Vector3<S>[src]

impl<S: BaseFloat> RelativeEq<Vector4<S>> for Vector4<S>[src]

Loading content...