[][src]Trait cgmath::RelativeEq

pub trait RelativeEq: AbsDiffEq {
    fn default_max_relative() -> Self::Epsilon;
fn relative_eq(
        &self,
        other: &Self,
        epsilon: Self::Epsilon,
        max_relative: Self::Epsilon
    ) -> bool; fn relative_ne(
        &self,
        other: &Self,
        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: &Self,
    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: &Self,
    epsilon: Self::Epsilon,
    max_relative: Self::Epsilon
) -> bool

The inverse of ApproxEq::relative_eq.

Loading content...

Implementations on Foreign Types

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

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

impl<T> RelativeEq for [T] where
    T: RelativeEq,
    <T as AbsDiffEq>::Epsilon: Clone
[src]

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

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

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

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

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

impl RelativeEq for f64
[src]

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

impl RelativeEq for f32
[src]

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

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

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

Loading content...

Implementors

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Loading content...