approx

Trait UlpsEq

Source
pub trait UlpsEq<Rhs = Self>: AbsDiffEq<Rhs>
where Rhs: ?Sized,
{ // Required methods fn default_max_ulps() -> u32; fn ulps_eq( &self, other: &Rhs, epsilon: Self::Epsilon, max_ulps: u32, ) -> bool; // Provided method fn ulps_ne( &self, other: &Rhs, epsilon: Self::Epsilon, max_ulps: u32, ) -> bool { ... } }
Expand description

Equality comparisons between two numbers using both the absolute difference and ULPs (Units in Last Place) based comparisons.

Required Methods§

Source

fn default_max_ulps() -> u32

The default ULPs to tolerate when testing values that are far-apart.

This is used when no max_ulps value is supplied to the [ulps_eq] macro.

Source

fn ulps_eq(&self, other: &Rhs, epsilon: Self::Epsilon, max_ulps: u32) -> bool

A test for equality that uses units in the last place (ULP) if the values are far apart.

Provided Methods§

Source

fn ulps_ne(&self, other: &Rhs, epsilon: Self::Epsilon, max_ulps: u32) -> bool

The inverse of UlpsEq::ulps_eq.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl UlpsEq for f32

Source§

fn default_max_ulps() -> u32

Source§

fn ulps_eq(&self, other: &f32, epsilon: f32, max_ulps: u32) -> bool

Source§

impl UlpsEq for f64

Source§

fn default_max_ulps() -> u32

Source§

fn ulps_eq(&self, other: &f64, epsilon: f64, max_ulps: u32) -> bool

Source§

impl<'a, T: UlpsEq + ?Sized> UlpsEq for &'a T

Source§

fn default_max_ulps() -> u32

Source§

fn ulps_eq(&self, other: &&'a T, epsilon: T::Epsilon, max_ulps: u32) -> bool

Source§

impl<'a, T: UlpsEq + ?Sized> UlpsEq for &'a mut T

Source§

fn default_max_ulps() -> u32

Source§

fn ulps_eq(&self, other: &&'a mut T, epsilon: T::Epsilon, max_ulps: u32) -> bool

Source§

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

Source§

fn default_max_ulps() -> u32

Source§

fn ulps_eq(&self, other: &[B], epsilon: A::Epsilon, max_ulps: u32) -> bool

Source§

impl<T: UlpsEq + Copy> UlpsEq for Cell<T>

Source§

fn default_max_ulps() -> u32

Source§

fn ulps_eq(&self, other: &Cell<T>, epsilon: T::Epsilon, max_ulps: u32) -> bool

Source§

impl<T: UlpsEq + ?Sized> UlpsEq for RefCell<T>

Source§

fn default_max_ulps() -> u32

Source§

fn ulps_eq( &self, other: &RefCell<T>, epsilon: T::Epsilon, max_ulps: u32, ) -> bool

Implementors§

impl<C, T> UlpsEq for PreAlpha<C>
where C: UlpsEq<Epsilon = T::Epsilon> + Premultiply<Scalar = T>, T: UlpsEq, T::Epsilon: Clone,

impl<C, T> UlpsEq for Alpha<C, T>
where C: UlpsEq<Epsilon = T::Epsilon>, T: UlpsEq, T::Epsilon: Clone,

impl<S, T> UlpsEq for Luma<S, T>
where T: UlpsEq,

impl<S, T> UlpsEq for Rgb<S, T>
where T: UlpsEq, T::Epsilon: Clone,

impl<S, T> UlpsEq for Hsl<S, T>
where T: UlpsEq, T::Epsilon: Clone, RgbHue<T>: UlpsEq + AbsDiffEq<Epsilon = T::Epsilon>,

impl<S, T> UlpsEq for Hsv<S, T>
where T: UlpsEq, T::Epsilon: Clone, RgbHue<T>: UlpsEq + AbsDiffEq<Epsilon = T::Epsilon>,

impl<S, T> UlpsEq for Hwb<S, T>
where T: UlpsEq, T::Epsilon: Clone, RgbHue<T>: UlpsEq + AbsDiffEq<Epsilon = T::Epsilon>,

impl<T> UlpsEq for Cam16<T>
where T: UlpsEq, T::Epsilon: Clone, Cam16Hue<T>: UlpsEq + AbsDiffEq<Epsilon = T::Epsilon>,

impl<T> UlpsEq for Cam16Jch<T>
where T: UlpsEq, T::Epsilon: Clone, Cam16Hue<T>: UlpsEq + AbsDiffEq<Epsilon = T::Epsilon>,

impl<T> UlpsEq for Cam16Jmh<T>
where T: UlpsEq, T::Epsilon: Clone, Cam16Hue<T>: UlpsEq + AbsDiffEq<Epsilon = T::Epsilon>,

impl<T> UlpsEq for Cam16Jsh<T>
where T: UlpsEq, T::Epsilon: Clone, Cam16Hue<T>: UlpsEq + AbsDiffEq<Epsilon = T::Epsilon>,

impl<T> UlpsEq for Cam16Qch<T>
where T: UlpsEq, T::Epsilon: Clone, Cam16Hue<T>: UlpsEq + AbsDiffEq<Epsilon = T::Epsilon>,

impl<T> UlpsEq for Cam16Qmh<T>
where T: UlpsEq, T::Epsilon: Clone, Cam16Hue<T>: UlpsEq + AbsDiffEq<Epsilon = T::Epsilon>,

impl<T> UlpsEq for Cam16Qsh<T>
where T: UlpsEq, T::Epsilon: Clone, Cam16Hue<T>: UlpsEq + AbsDiffEq<Epsilon = T::Epsilon>,

impl<T> UlpsEq for Cam16UcsJab<T>
where T: UlpsEq, T::Epsilon: Clone,

impl<T> UlpsEq for Cam16UcsJmh<T>
where T: UlpsEq, T::Epsilon: Clone, Cam16Hue<T>: UlpsEq + AbsDiffEq<Epsilon = T::Epsilon>,

impl<T> UlpsEq for Cam16Hue<T>
where T: RealAngle + SignedAngle + Zero + AngleEq<Mask = bool> + Sub<Output = T> + Clone + UlpsEq, T::Epsilon: HalfRotation + Mul<Output = T::Epsilon>,

impl<T> UlpsEq for LabHue<T>
where T: RealAngle + SignedAngle + Zero + AngleEq<Mask = bool> + Sub<Output = T> + Clone + UlpsEq, T::Epsilon: HalfRotation + Mul<Output = T::Epsilon>,

impl<T> UlpsEq for LuvHue<T>
where T: RealAngle + SignedAngle + Zero + AngleEq<Mask = bool> + Sub<Output = T> + Clone + UlpsEq, T::Epsilon: HalfRotation + Mul<Output = T::Epsilon>,

impl<T> UlpsEq for Okhsl<T>
where T: UlpsEq, T::Epsilon: Clone, OklabHue<T>: UlpsEq + AbsDiffEq<Epsilon = T::Epsilon>,

impl<T> UlpsEq for Okhsv<T>
where T: UlpsEq, T::Epsilon: Clone, OklabHue<T>: UlpsEq + AbsDiffEq<Epsilon = T::Epsilon>,

impl<T> UlpsEq for Okhwb<T>
where T: UlpsEq, T::Epsilon: Clone, OklabHue<T>: UlpsEq + AbsDiffEq<Epsilon = T::Epsilon>,

impl<T> UlpsEq for Oklab<T>
where T: UlpsEq, T::Epsilon: Clone,

impl<T> UlpsEq for OklabHue<T>
where T: RealAngle + SignedAngle + Zero + AngleEq<Mask = bool> + Sub<Output = T> + Clone + UlpsEq, T::Epsilon: HalfRotation + Mul<Output = T::Epsilon>,

impl<T> UlpsEq for Oklch<T>
where T: UlpsEq, T::Epsilon: Clone, OklabHue<T>: UlpsEq + AbsDiffEq<Epsilon = T::Epsilon>,

impl<T> UlpsEq for RgbHue<T>
where T: RealAngle + SignedAngle + Zero + AngleEq<Mask = bool> + Sub<Output = T> + Clone + UlpsEq, T::Epsilon: HalfRotation + Mul<Output = T::Epsilon>,

impl<Wp, T> UlpsEq for Hsluv<Wp, T>
where T: UlpsEq, T::Epsilon: Clone, LuvHue<T>: UlpsEq + AbsDiffEq<Epsilon = T::Epsilon>,

impl<Wp, T> UlpsEq for Lab<Wp, T>
where T: UlpsEq, T::Epsilon: Clone,

impl<Wp, T> UlpsEq for Lch<Wp, T>
where T: UlpsEq, T::Epsilon: Clone, LabHue<T>: UlpsEq + AbsDiffEq<Epsilon = T::Epsilon>,

impl<Wp, T> UlpsEq for Lchuv<Wp, T>
where T: UlpsEq, T::Epsilon: Clone, LuvHue<T>: UlpsEq + AbsDiffEq<Epsilon = T::Epsilon>,

impl<Wp, T> UlpsEq for Luv<Wp, T>
where T: UlpsEq, T::Epsilon: Clone,

impl<Wp, T> UlpsEq for Xyz<Wp, T>
where T: UlpsEq, T::Epsilon: Clone,

impl<Wp, T> UlpsEq for Yxy<Wp, T>
where T: UlpsEq, T::Epsilon: Clone,