alloy::cmp

Trait AlmostEq

source
pub trait AlmostEq<Rhs: ?Sized = Self>: Near<Rhs> {
    // Required method
    fn almost_eq(&self, other: &Rhs) -> bool;
}
Expand description

Trait for comparing objects for near-equality relative to a default tolerance.

This is effectively a short-hand for Near with a default f32 tolerance.

Required Methods§

source

fn almost_eq(&self, other: &Rhs) -> bool

Tests whether self is almost equal to other

§Parameters
  • other - the other value to compare against

Implementations on Foreign Types§

source§

impl AlmostEq for f32

source§

fn almost_eq(&self, other: &Self) -> bool

source§

impl AlmostEq for f64

source§

fn almost_eq(&self, other: &Self) -> bool

source§

impl<T> AlmostEq for [T]
where T: AlmostEq<T>,

source§

fn almost_eq(&self, other: &[T]) -> bool

source§

impl<const N: usize, T> AlmostEq for [T; N]
where T: AlmostEq<T>,

source§

fn almost_eq(&self, other: &[T; N]) -> bool

Implementors§