FloatEq

Trait FloatEq 

Source
pub trait FloatEq<Rhs: ?Sized = Self> {
    type Tol: ?Sized + FloatEqUlpsTol;

Show 14 methods // Required methods fn eq_abs(&self, other: &Rhs, tol: &Self::Tol) -> bool; fn eq_rmax(&self, other: &Rhs, tol: &Self::Tol) -> bool; fn eq_rmin(&self, other: &Rhs, tol: &Self::Tol) -> bool; fn eq_r1st(&self, other: &Rhs, tol: &Self::Tol) -> bool; fn eq_r2nd(&self, other: &Rhs, tol: &Self::Tol) -> bool; fn eq_ulps(&self, other: &Rhs, tol: &UlpsTol<Self::Tol>) -> bool; // Provided methods fn ne_abs(&self, other: &Rhs, tol: &Self::Tol) -> bool { ... } fn eq_rel(&self, other: &Rhs, tol: &Self::Tol) -> bool { ... } fn ne_rel(&self, other: &Rhs, tol: &Self::Tol) -> bool { ... } fn ne_rmax(&self, other: &Rhs, tol: &Self::Tol) -> bool { ... } fn ne_rmin(&self, other: &Rhs, tol: &Self::Tol) -> bool { ... } fn ne_r1st(&self, other: &Rhs, tol: &Self::Tol) -> bool { ... } fn ne_r2nd(&self, other: &Rhs, tol: &Self::Tol) -> bool { ... } fn ne_ulps(&self, other: &Rhs, tol: &UlpsTol<Self::Tol>) -> bool { ... }
}
Expand description

Compare IEEE floating point values for equality using per-field tolerances.

This trait is used in the implementation of the float_eq! and assert_float_eq! families of macros.

To implement this trait over a new type, see How to compare custom types.

§Examples

assert!(4.0_f32.eq_abs(&4.000_001_5, &0.000_001_6));
assert!(4.0_f32.ne_abs(&4.000_001_5, &0.000_001_4));

assert!(4.0_f32.eq_rel(&4.000_001_5, &0.000_000_4));
assert!(4.0_f32.ne_rel(&4.000_001_5, &0.000_000_3));

assert!(4.0_f32.eq_ulps(&4.000_001_5, &3));
assert!(4.0_f32.ne_ulps(&4.000_001_5, &2));

Required Associated Types§

Source

type Tol: ?Sized + FloatEqUlpsTol

Type of the maximum allowed difference between two values for them to be considered equal.

Required Methods§

Source

fn eq_abs(&self, other: &Rhs, tol: &Self::Tol) -> bool

Check whether self is equal to other, using an absolute tolerance comparison.

Implementations should be the equivalent of:

// the PartialEq check covers equality of infinities
self == other || (self - other).abs().le(tol)
Source

fn eq_rmax(&self, other: &Rhs, tol: &Self::Tol) -> bool

Check whether self is equal to other, using a relative tolerance comparison, scaled to the granularity of the input with the largest magnitude.

The implementation should be the equivalent of:

// the PartialEq check covers equality of infinities
self == other || {
    let largest = self.abs().max(other.abs());
    let tolerance = largest * tol;
    (self - other).abs() <= tolerance
}
Source

fn eq_rmin(&self, other: &Rhs, tol: &Self::Tol) -> bool

Check whether self is equal to other, using a relative tolerance comparison, scaled to the granularity of the input with the smallest magnitude.

The implementation should be the equivalent of:

// the PartialEq check covers equality of infinities
self == other || {
    let smallest = self.abs().min(other.abs());
    let tolerance = smallest * tol;
    (self - other).abs() <= tolerance
}
Source

fn eq_r1st(&self, other: &Rhs, tol: &Self::Tol) -> bool

Check whether self is equal to other, using a relative tolerance comparison, scaled to the granularity of the first input.

The implementation should be the equivalent of:

// the PartialEq check covers equality of infinities
self == other || {
    let tolerance = self.abs() * tol;
    (self - other).abs() <= tolerance
}
Source

fn eq_r2nd(&self, other: &Rhs, tol: &Self::Tol) -> bool

Check whether self is equal to other, using a relative tolerance comparison, scaled to the granularity of the second input.

The implementation should be the equivalent of:

// the PartialEq check covers equality of infinities
self == other || {
    let tolerance = other.abs() * tol;
    (self - other).abs() <= tolerance
}
Source

fn eq_ulps(&self, other: &Rhs, tol: &UlpsTol<Self::Tol>) -> bool

Check whether self is equal to other, using an ULPs comparison.

The implementation should be the equivalent of:

if self.is_nan() || other.is_nan() {
    false // NaNs are never equal
}
else if self.is_sign_positive() != other.is_sign_positive() {
    self == other // account for zero == negative zero
} else {
    let a = self.to_bits();
    let b = other.to_bits();
    let max = a.max(b);
    let min = a.min(b);
    (max - min).le(tol)
}

Provided Methods§

Source

fn ne_abs(&self, other: &Rhs, tol: &Self::Tol) -> bool

Check whether self is not equal to other, using an absolute tolerance comparison.

Equal to !self.eq_abs(other, tol), there is no need to reimplement this for your own types.

Source

fn eq_rel(&self, other: &Rhs, tol: &Self::Tol) -> bool

Check whether self is equal to other, using a relative tolerance comparison.

Equal to self.eq_rmax(other, tol), there is no need to reimplement this for your own types.

Source

fn ne_rel(&self, other: &Rhs, tol: &Self::Tol) -> bool

Check whether self is not equal to other, using a relative tolerance comparison.

Equal to !self.eq_rel(other, tol), there is no need to reimplement this for your own types.

Source

fn ne_rmax(&self, other: &Rhs, tol: &Self::Tol) -> bool

Check whether self is not equal to other, using a relative tolerance comparison.

Equal to !self.eq_rmax(other, tol), there is no need to reimplement this for your own types.

Source

fn ne_rmin(&self, other: &Rhs, tol: &Self::Tol) -> bool

Check whether self is not equal to other, using a relative tolerance comparison.

Equal to !self.eq_rmin(other, tol), there is no need to reimplement this for your own types.

Source

fn ne_r1st(&self, other: &Rhs, tol: &Self::Tol) -> bool

Check whether self is not equal to other, using a relative tolerance comparison.

Equal to !self.eq_r1st(other, tol), there is no need to reimplement this for your own types.

Source

fn ne_r2nd(&self, other: &Rhs, tol: &Self::Tol) -> bool

Check whether self is not equal to other, using a relative tolerance comparison.

Equal to !self.eq_r2nd(other, tol), there is no need to reimplement this for your own types.

Source

fn ne_ulps(&self, other: &Rhs, tol: &UlpsTol<Self::Tol>) -> bool

Check whether self is not equal to other, using an ULPs comparison.

Equal to !self.eq_ulps(other, tol), there is no need to reimplement this for your own types.

Implementations on Foreign Types§

Source§

impl FloatEq for f32

Source§

type Tol = f32

Source§

fn eq_abs(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_rmax(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_rmin(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_r1st(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_r2nd(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_ulps(&self, other: &Self, tol: &UlpsTol<Self::Tol>) -> bool

Source§

impl FloatEq for f64

Source§

type Tol = f64

Source§

fn eq_abs(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_rmax(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_rmin(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_r1st(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_r2nd(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_ulps(&self, other: &Self, tol: &UlpsTol<Self::Tol>) -> bool

Source§

impl FloatEq for ()

Source§

type Tol = ()

Source§

fn eq_abs(&self, _other: &(), _tol: &Self::Tol) -> bool

Source§

fn eq_rmax(&self, _other: &(), _tol: &Self::Tol) -> bool

Source§

fn eq_rmin(&self, _other: &(), _tol: &Self::Tol) -> bool

Source§

fn eq_r1st(&self, _other: &(), _tol: &Self::Tol) -> bool

Source§

fn eq_r2nd(&self, _other: &(), _tol: &Self::Tol) -> bool

Source§

fn eq_ulps(&self, _other: &(), _tol: &UlpsTol<Self::Tol>) -> bool

Source§

impl<A> FloatEq for (A,)
where A: ?Sized + FloatEq, A::Tol: Sized, UlpsTol<A::Tol>: Sized,

Source§

type Tol = (<A as FloatEq>::Tol,)

Source§

fn eq_abs(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_rmax(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_rmin(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_r1st(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_r2nd(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_ulps(&self, other: &Self, tol: &UlpsTol<Self::Tol>) -> bool

Source§

impl<A, B> FloatEq<[B]> for [A]
where A: FloatEq<B>, A::Tol: Sized, UlpsTol<A::Tol>: Sized,

Source§

type Tol = [<A as FloatEq<B>>::Tol]

Source§

fn eq_abs(&self, other: &[B], tol: &Self::Tol) -> bool

Source§

fn eq_rmax(&self, other: &[B], tol: &Self::Tol) -> bool

Source§

fn eq_rmin(&self, other: &[B], tol: &Self::Tol) -> bool

Source§

fn eq_r1st(&self, other: &[B], tol: &Self::Tol) -> bool

Source§

fn eq_r2nd(&self, other: &[B], tol: &Self::Tol) -> bool

Source§

fn eq_ulps(&self, other: &[B], tol: &UlpsTol<Self::Tol>) -> bool

Source§

impl<A, B> FloatEq<LinkedList<B>> for LinkedList<A>
where A: FloatEq<B>, A::Tol: Sized, UlpsTol<A::Tol>: Sized,

Source§

type Tol = LinkedList<<A as FloatEq<B>>::Tol>

Source§

fn eq_abs(&self, other: &LinkedList<B>, tol: &Self::Tol) -> bool

Source§

fn eq_rmax(&self, other: &LinkedList<B>, tol: &Self::Tol) -> bool

Source§

fn eq_rmin(&self, other: &LinkedList<B>, tol: &Self::Tol) -> bool

Source§

fn eq_r1st(&self, other: &LinkedList<B>, tol: &Self::Tol) -> bool

Source§

fn eq_r2nd(&self, other: &LinkedList<B>, tol: &Self::Tol) -> bool

Source§

fn eq_ulps(&self, other: &LinkedList<B>, tol: &UlpsTol<Self::Tol>) -> bool

Source§

impl<A, B> FloatEq<VecDeque<B>> for VecDeque<A>
where A: FloatEq<B>, A::Tol: Sized, UlpsTol<A::Tol>: Sized,

Source§

type Tol = VecDeque<<A as FloatEq<B>>::Tol>

Source§

fn eq_abs(&self, other: &VecDeque<B>, tol: &Self::Tol) -> bool

Source§

fn eq_rmax(&self, other: &VecDeque<B>, tol: &Self::Tol) -> bool

Source§

fn eq_rmin(&self, other: &VecDeque<B>, tol: &Self::Tol) -> bool

Source§

fn eq_r1st(&self, other: &VecDeque<B>, tol: &Self::Tol) -> bool

Source§

fn eq_r2nd(&self, other: &VecDeque<B>, tol: &Self::Tol) -> bool

Source§

fn eq_ulps(&self, other: &VecDeque<B>, tol: &UlpsTol<Self::Tol>) -> bool

Source§

impl<A, B> FloatEq<Vec<B>> for Vec<A>
where A: FloatEq<B>, A::Tol: Sized, UlpsTol<A::Tol>: Sized,

Source§

type Tol = Vec<<A as FloatEq<B>>::Tol>

Source§

fn eq_abs(&self, other: &Vec<B>, tol: &Self::Tol) -> bool

Source§

fn eq_rmax(&self, other: &Vec<B>, tol: &Self::Tol) -> bool

Source§

fn eq_rmin(&self, other: &Vec<B>, tol: &Self::Tol) -> bool

Source§

fn eq_r1st(&self, other: &Vec<B>, tol: &Self::Tol) -> bool

Source§

fn eq_r2nd(&self, other: &Vec<B>, tol: &Self::Tol) -> bool

Source§

fn eq_ulps(&self, other: &Vec<B>, tol: &UlpsTol<Self::Tol>) -> bool

Source§

impl<A, B> FloatEq<Cell<B>> for Cell<A>
where A: FloatEq<B> + Copy, B: Copy,

Source§

type Tol = <A as FloatEq<B>>::Tol

Source§

fn eq_abs(&self, other: &Cell<B>, tol: &Self::Tol) -> bool

Source§

fn eq_rmax(&self, other: &Cell<B>, tol: &Self::Tol) -> bool

Source§

fn eq_rmin(&self, other: &Cell<B>, tol: &Self::Tol) -> bool

Source§

fn eq_r1st(&self, other: &Cell<B>, tol: &Self::Tol) -> bool

Source§

fn eq_r2nd(&self, other: &Cell<B>, tol: &Self::Tol) -> bool

Source§

fn eq_ulps(&self, other: &Cell<B>, tol: &UlpsTol<Self::Tol>) -> bool

Source§

impl<A, B, const N: usize> FloatEq<[B; N]> for [A; N]
where A: FloatEq<B>, A::Tol: Sized, UlpsTol<A::Tol>: Sized,

Source§

type Tol = [<A as FloatEq<B>>::Tol; N]

Source§

fn eq_abs(&self, other: &[B; N], tol: &Self::Tol) -> bool

Source§

fn eq_rmax(&self, other: &[B; N], tol: &Self::Tol) -> bool

Source§

fn eq_rmin(&self, other: &[B; N], tol: &Self::Tol) -> bool

Source§

fn eq_r1st(&self, other: &[B; N], tol: &Self::Tol) -> bool

Source§

fn eq_r2nd(&self, other: &[B; N], tol: &Self::Tol) -> bool

Source§

fn eq_ulps(&self, other: &[B; N], tol: &UlpsTol<Self::Tol>) -> bool

Source§

impl<A, B: ?Sized> FloatEq<&B> for &A
where A: FloatEq<B> + ?Sized,

Source§

type Tol = <A as FloatEq<B>>::Tol

Source§

fn eq_abs(&self, other: &&B, tol: &Self::Tol) -> bool

Source§

fn eq_rmax(&self, other: &&B, tol: &Self::Tol) -> bool

Source§

fn eq_rmin(&self, other: &&B, tol: &Self::Tol) -> bool

Source§

fn eq_r1st(&self, other: &&B, tol: &Self::Tol) -> bool

Source§

fn eq_r2nd(&self, other: &&B, tol: &Self::Tol) -> bool

Source§

fn eq_ulps(&self, other: &&B, tol: &UlpsTol<Self::Tol>) -> bool

Source§

impl<A, B: ?Sized> FloatEq<&B> for &mut A
where A: FloatEq<B> + ?Sized,

Source§

type Tol = <A as FloatEq<B>>::Tol

Source§

fn eq_abs(&self, other: &&B, tol: &Self::Tol) -> bool

Source§

fn eq_rmax(&self, other: &&B, tol: &Self::Tol) -> bool

Source§

fn eq_rmin(&self, other: &&B, tol: &Self::Tol) -> bool

Source§

fn eq_r1st(&self, other: &&B, tol: &Self::Tol) -> bool

Source§

fn eq_r2nd(&self, other: &&B, tol: &Self::Tol) -> bool

Source§

fn eq_ulps(&self, other: &&B, tol: &UlpsTol<Self::Tol>) -> bool

Source§

impl<A, B: ?Sized> FloatEq<&mut B> for &A
where A: FloatEq<B> + ?Sized,

Source§

type Tol = <A as FloatEq<B>>::Tol

Source§

fn eq_abs(&self, other: &&mut B, tol: &Self::Tol) -> bool

Source§

fn eq_rmax(&self, other: &&mut B, tol: &Self::Tol) -> bool

Source§

fn eq_rmin(&self, other: &&mut B, tol: &Self::Tol) -> bool

Source§

fn eq_r1st(&self, other: &&mut B, tol: &Self::Tol) -> bool

Source§

fn eq_r2nd(&self, other: &&mut B, tol: &Self::Tol) -> bool

Source§

fn eq_ulps(&self, other: &&mut B, tol: &UlpsTol<Self::Tol>) -> bool

Source§

impl<A, B: ?Sized> FloatEq<&mut B> for &mut A
where A: FloatEq<B> + ?Sized,

Source§

type Tol = <A as FloatEq<B>>::Tol

Source§

fn eq_abs(&self, other: &&mut B, tol: &Self::Tol) -> bool

Source§

fn eq_rmax(&self, other: &&mut B, tol: &Self::Tol) -> bool

Source§

fn eq_rmin(&self, other: &&mut B, tol: &Self::Tol) -> bool

Source§

fn eq_r1st(&self, other: &&mut B, tol: &Self::Tol) -> bool

Source§

fn eq_r2nd(&self, other: &&mut B, tol: &Self::Tol) -> bool

Source§

fn eq_ulps(&self, other: &&mut B, tol: &UlpsTol<Self::Tol>) -> bool

Source§

impl<A, B: ?Sized> FloatEq<Box<B>> for Box<A>
where A: FloatEq<B> + ?Sized,

Source§

type Tol = <A as FloatEq<B>>::Tol

Source§

fn eq_abs(&self, other: &Box<B>, tol: &Self::Tol) -> bool

Source§

fn eq_rmax(&self, other: &Box<B>, tol: &Self::Tol) -> bool

Source§

fn eq_rmin(&self, other: &Box<B>, tol: &Self::Tol) -> bool

Source§

fn eq_r1st(&self, other: &Box<B>, tol: &Self::Tol) -> bool

Source§

fn eq_r2nd(&self, other: &Box<B>, tol: &Self::Tol) -> bool

Source§

fn eq_ulps(&self, other: &Box<B>, tol: &UlpsTol<Self::Tol>) -> bool

Source§

impl<A, B: ?Sized> FloatEq<Rc<B>> for Rc<A>
where A: FloatEq<B> + ?Sized,

Source§

type Tol = <A as FloatEq<B>>::Tol

Source§

fn eq_abs(&self, other: &Rc<B>, tol: &Self::Tol) -> bool

Source§

fn eq_rmax(&self, other: &Rc<B>, tol: &Self::Tol) -> bool

Source§

fn eq_rmin(&self, other: &Rc<B>, tol: &Self::Tol) -> bool

Source§

fn eq_r1st(&self, other: &Rc<B>, tol: &Self::Tol) -> bool

Source§

fn eq_r2nd(&self, other: &Rc<B>, tol: &Self::Tol) -> bool

Source§

fn eq_ulps(&self, other: &Rc<B>, tol: &UlpsTol<Self::Tol>) -> bool

Source§

impl<A, B: ?Sized> FloatEq<Arc<B>> for Arc<A>
where A: FloatEq<B> + ?Sized,

Source§

type Tol = <A as FloatEq<B>>::Tol

Source§

fn eq_abs(&self, other: &Arc<B>, tol: &Self::Tol) -> bool

Source§

fn eq_rmax(&self, other: &Arc<B>, tol: &Self::Tol) -> bool

Source§

fn eq_rmin(&self, other: &Arc<B>, tol: &Self::Tol) -> bool

Source§

fn eq_r1st(&self, other: &Arc<B>, tol: &Self::Tol) -> bool

Source§

fn eq_r2nd(&self, other: &Arc<B>, tol: &Self::Tol) -> bool

Source§

fn eq_ulps(&self, other: &Arc<B>, tol: &UlpsTol<Self::Tol>) -> bool

Source§

impl<A, B: ?Sized> FloatEq<RefCell<B>> for RefCell<A>
where A: FloatEq<B> + ?Sized,

Source§

type Tol = <A as FloatEq<B>>::Tol

Source§

fn eq_abs(&self, other: &RefCell<B>, tol: &Self::Tol) -> bool

Source§

fn eq_rmax(&self, other: &RefCell<B>, tol: &Self::Tol) -> bool

Source§

fn eq_rmin(&self, other: &RefCell<B>, tol: &Self::Tol) -> bool

Source§

fn eq_r1st(&self, other: &RefCell<B>, tol: &Self::Tol) -> bool

Source§

fn eq_r2nd(&self, other: &RefCell<B>, tol: &Self::Tol) -> bool

Source§

fn eq_ulps(&self, other: &RefCell<B>, tol: &UlpsTol<Self::Tol>) -> bool

Source§

impl<A: FloatEq, B> FloatEq for (A, B)
where B: ?Sized + FloatEq, A::Tol: Sized, B::Tol: Sized, UlpsTol<A::Tol>: Sized, UlpsTol<B::Tol>: Sized,

Source§

type Tol = (<A as FloatEq>::Tol, <B as FloatEq>::Tol)

Source§

fn eq_abs(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_rmax(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_rmin(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_r1st(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_r2nd(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_ulps(&self, other: &Self, tol: &UlpsTol<Self::Tol>) -> bool

Source§

impl<A: FloatEq, B: FloatEq, C> FloatEq for (A, B, C)
where C: ?Sized + FloatEq, A::Tol: Sized, B::Tol: Sized, C::Tol: Sized, UlpsTol<A::Tol>: Sized, UlpsTol<B::Tol>: Sized, UlpsTol<C::Tol>: Sized,

Source§

type Tol = (<A as FloatEq>::Tol, <B as FloatEq>::Tol, <C as FloatEq>::Tol)

Source§

fn eq_abs(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_rmax(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_rmin(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_r1st(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_r2nd(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_ulps(&self, other: &Self, tol: &UlpsTol<Self::Tol>) -> bool

Source§

impl<A: FloatEq, B: FloatEq, C: FloatEq, D> FloatEq for (A, B, C, D)
where D: ?Sized + FloatEq, A::Tol: Sized, B::Tol: Sized, C::Tol: Sized, D::Tol: Sized, UlpsTol<A::Tol>: Sized, UlpsTol<B::Tol>: Sized, UlpsTol<C::Tol>: Sized, UlpsTol<D::Tol>: Sized,

Source§

type Tol = (<A as FloatEq>::Tol, <B as FloatEq>::Tol, <C as FloatEq>::Tol, <D as FloatEq>::Tol)

Source§

fn eq_abs(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_rmax(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_rmin(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_r1st(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_r2nd(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_ulps(&self, other: &Self, tol: &UlpsTol<Self::Tol>) -> bool

Source§

impl<A: FloatEq, B: FloatEq, C: FloatEq, D: FloatEq, E> FloatEq for (A, B, C, D, E)
where E: ?Sized + FloatEq, A::Tol: Sized, B::Tol: Sized, C::Tol: Sized, D::Tol: Sized, E::Tol: Sized, UlpsTol<A::Tol>: Sized, UlpsTol<B::Tol>: Sized, UlpsTol<C::Tol>: Sized, UlpsTol<D::Tol>: Sized, UlpsTol<E::Tol>: Sized,

Source§

type Tol = (<A as FloatEq>::Tol, <B as FloatEq>::Tol, <C as FloatEq>::Tol, <D as FloatEq>::Tol, <E as FloatEq>::Tol)

Source§

fn eq_abs(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_rmax(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_rmin(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_r1st(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_r2nd(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_ulps(&self, other: &Self, tol: &UlpsTol<Self::Tol>) -> bool

Source§

impl<A: FloatEq, B: FloatEq, C: FloatEq, D: FloatEq, E: FloatEq, F> FloatEq for (A, B, C, D, E, F)
where F: ?Sized + FloatEq, A::Tol: Sized, B::Tol: Sized, C::Tol: Sized, D::Tol: Sized, E::Tol: Sized, F::Tol: Sized, UlpsTol<A::Tol>: Sized, UlpsTol<B::Tol>: Sized, UlpsTol<C::Tol>: Sized, UlpsTol<D::Tol>: Sized, UlpsTol<E::Tol>: Sized, UlpsTol<F::Tol>: Sized,

Source§

type Tol = (<A as FloatEq>::Tol, <B as FloatEq>::Tol, <C as FloatEq>::Tol, <D as FloatEq>::Tol, <E as FloatEq>::Tol, <F as FloatEq>::Tol)

Source§

fn eq_abs(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_rmax(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_rmin(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_r1st(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_r2nd(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_ulps(&self, other: &Self, tol: &UlpsTol<Self::Tol>) -> bool

Source§

impl<A: FloatEq, B: FloatEq, C: FloatEq, D: FloatEq, E: FloatEq, F: FloatEq, G> FloatEq for (A, B, C, D, E, F, G)
where G: ?Sized + FloatEq, A::Tol: Sized, B::Tol: Sized, C::Tol: Sized, D::Tol: Sized, E::Tol: Sized, F::Tol: Sized, G::Tol: Sized, UlpsTol<A::Tol>: Sized, UlpsTol<B::Tol>: Sized, UlpsTol<C::Tol>: Sized, UlpsTol<D::Tol>: Sized, UlpsTol<E::Tol>: Sized, UlpsTol<F::Tol>: Sized, UlpsTol<G::Tol>: Sized,

Source§

type Tol = (<A as FloatEq>::Tol, <B as FloatEq>::Tol, <C as FloatEq>::Tol, <D as FloatEq>::Tol, <E as FloatEq>::Tol, <F as FloatEq>::Tol, <G as FloatEq>::Tol)

Source§

fn eq_abs(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_rmax(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_rmin(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_r1st(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_r2nd(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_ulps(&self, other: &Self, tol: &UlpsTol<Self::Tol>) -> bool

Source§

impl<A: FloatEq, B: FloatEq, C: FloatEq, D: FloatEq, E: FloatEq, F: FloatEq, G: FloatEq, H> FloatEq for (A, B, C, D, E, F, G, H)
where H: ?Sized + FloatEq, A::Tol: Sized, B::Tol: Sized, C::Tol: Sized, D::Tol: Sized, E::Tol: Sized, F::Tol: Sized, G::Tol: Sized, H::Tol: Sized, UlpsTol<A::Tol>: Sized, UlpsTol<B::Tol>: Sized, UlpsTol<C::Tol>: Sized, UlpsTol<D::Tol>: Sized, UlpsTol<E::Tol>: Sized, UlpsTol<F::Tol>: Sized, UlpsTol<G::Tol>: Sized, UlpsTol<H::Tol>: Sized,

Source§

type Tol = (<A as FloatEq>::Tol, <B as FloatEq>::Tol, <C as FloatEq>::Tol, <D as FloatEq>::Tol, <E as FloatEq>::Tol, <F as FloatEq>::Tol, <G as FloatEq>::Tol, <H as FloatEq>::Tol)

Source§

fn eq_abs(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_rmax(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_rmin(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_r1st(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_r2nd(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_ulps(&self, other: &Self, tol: &UlpsTol<Self::Tol>) -> bool

Source§

impl<A: FloatEq, B: FloatEq, C: FloatEq, D: FloatEq, E: FloatEq, F: FloatEq, G: FloatEq, H: FloatEq, I> FloatEq for (A, B, C, D, E, F, G, H, I)
where I: ?Sized + FloatEq, A::Tol: Sized, B::Tol: Sized, C::Tol: Sized, D::Tol: Sized, E::Tol: Sized, F::Tol: Sized, G::Tol: Sized, H::Tol: Sized, I::Tol: Sized, UlpsTol<A::Tol>: Sized, UlpsTol<B::Tol>: Sized, UlpsTol<C::Tol>: Sized, UlpsTol<D::Tol>: Sized, UlpsTol<E::Tol>: Sized, UlpsTol<F::Tol>: Sized, UlpsTol<G::Tol>: Sized, UlpsTol<H::Tol>: Sized, UlpsTol<I::Tol>: Sized,

Source§

type Tol = (<A as FloatEq>::Tol, <B as FloatEq>::Tol, <C as FloatEq>::Tol, <D as FloatEq>::Tol, <E as FloatEq>::Tol, <F as FloatEq>::Tol, <G as FloatEq>::Tol, <H as FloatEq>::Tol, <I as FloatEq>::Tol)

Source§

fn eq_abs(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_rmax(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_rmin(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_r1st(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_r2nd(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_ulps(&self, other: &Self, tol: &UlpsTol<Self::Tol>) -> bool

Source§

impl<A: FloatEq, B: FloatEq, C: FloatEq, D: FloatEq, E: FloatEq, F: FloatEq, G: FloatEq, H: FloatEq, I: FloatEq, J> FloatEq for (A, B, C, D, E, F, G, H, I, J)
where J: ?Sized + FloatEq, A::Tol: Sized, B::Tol: Sized, C::Tol: Sized, D::Tol: Sized, E::Tol: Sized, F::Tol: Sized, G::Tol: Sized, H::Tol: Sized, I::Tol: Sized, J::Tol: Sized, UlpsTol<A::Tol>: Sized, UlpsTol<B::Tol>: Sized, UlpsTol<C::Tol>: Sized, UlpsTol<D::Tol>: Sized, UlpsTol<E::Tol>: Sized, UlpsTol<F::Tol>: Sized, UlpsTol<G::Tol>: Sized, UlpsTol<H::Tol>: Sized, UlpsTol<I::Tol>: Sized, UlpsTol<J::Tol>: Sized,

Source§

type Tol = (<A as FloatEq>::Tol, <B as FloatEq>::Tol, <C as FloatEq>::Tol, <D as FloatEq>::Tol, <E as FloatEq>::Tol, <F as FloatEq>::Tol, <G as FloatEq>::Tol, <H as FloatEq>::Tol, <I as FloatEq>::Tol, <J as FloatEq>::Tol)

Source§

fn eq_abs(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_rmax(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_rmin(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_r1st(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_r2nd(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_ulps(&self, other: &Self, tol: &UlpsTol<Self::Tol>) -> bool

Source§

impl<A: FloatEq, B: FloatEq, C: FloatEq, D: FloatEq, E: FloatEq, F: FloatEq, G: FloatEq, H: FloatEq, I: FloatEq, J: FloatEq, K> FloatEq for (A, B, C, D, E, F, G, H, I, J, K)
where K: ?Sized + FloatEq, A::Tol: Sized, B::Tol: Sized, C::Tol: Sized, D::Tol: Sized, E::Tol: Sized, F::Tol: Sized, G::Tol: Sized, H::Tol: Sized, I::Tol: Sized, J::Tol: Sized, K::Tol: Sized, UlpsTol<A::Tol>: Sized, UlpsTol<B::Tol>: Sized, UlpsTol<C::Tol>: Sized, UlpsTol<D::Tol>: Sized, UlpsTol<E::Tol>: Sized, UlpsTol<F::Tol>: Sized, UlpsTol<G::Tol>: Sized, UlpsTol<H::Tol>: Sized, UlpsTol<I::Tol>: Sized, UlpsTol<J::Tol>: Sized, UlpsTol<K::Tol>: Sized,

Source§

type Tol = (<A as FloatEq>::Tol, <B as FloatEq>::Tol, <C as FloatEq>::Tol, <D as FloatEq>::Tol, <E as FloatEq>::Tol, <F as FloatEq>::Tol, <G as FloatEq>::Tol, <H as FloatEq>::Tol, <I as FloatEq>::Tol, <J as FloatEq>::Tol, <K as FloatEq>::Tol)

Source§

fn eq_abs(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_rmax(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_rmin(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_r1st(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_r2nd(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_ulps(&self, other: &Self, tol: &UlpsTol<Self::Tol>) -> bool

Source§

impl<A: FloatEq, B: FloatEq, C: FloatEq, D: FloatEq, E: FloatEq, F: FloatEq, G: FloatEq, H: FloatEq, I: FloatEq, J: FloatEq, K: FloatEq, L> FloatEq for (A, B, C, D, E, F, G, H, I, J, K, L)
where L: ?Sized + FloatEq, A::Tol: Sized, B::Tol: Sized, C::Tol: Sized, D::Tol: Sized, E::Tol: Sized, F::Tol: Sized, G::Tol: Sized, H::Tol: Sized, I::Tol: Sized, J::Tol: Sized, K::Tol: Sized, L::Tol: Sized, UlpsTol<A::Tol>: Sized, UlpsTol<B::Tol>: Sized, UlpsTol<C::Tol>: Sized, UlpsTol<D::Tol>: Sized, UlpsTol<E::Tol>: Sized, UlpsTol<F::Tol>: Sized, UlpsTol<G::Tol>: Sized, UlpsTol<H::Tol>: Sized, UlpsTol<I::Tol>: Sized, UlpsTol<J::Tol>: Sized, UlpsTol<K::Tol>: Sized, UlpsTol<L::Tol>: Sized,

Source§

type Tol = (<A as FloatEq>::Tol, <B as FloatEq>::Tol, <C as FloatEq>::Tol, <D as FloatEq>::Tol, <E as FloatEq>::Tol, <F as FloatEq>::Tol, <G as FloatEq>::Tol, <H as FloatEq>::Tol, <I as FloatEq>::Tol, <J as FloatEq>::Tol, <K as FloatEq>::Tol, <L as FloatEq>::Tol)

Source§

fn eq_abs(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_rmax(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_rmin(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_r1st(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_r2nd(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_ulps(&self, other: &Self, tol: &UlpsTol<Self::Tol>) -> bool

Source§

impl<K, VA, VB> FloatEq<BTreeMap<K, VB>> for BTreeMap<K, VA>
where K: Eq + Ord, VA: FloatEq<VB>, VA::Tol: Sized, UlpsTol<VA::Tol>: Sized,

Source§

type Tol = BTreeMap<K, <VA as FloatEq<VB>>::Tol>

Source§

fn eq_abs(&self, other: &BTreeMap<K, VB>, tol: &Self::Tol) -> bool

Source§

fn eq_rmax(&self, other: &BTreeMap<K, VB>, tol: &Self::Tol) -> bool

Source§

fn eq_rmin(&self, other: &BTreeMap<K, VB>, tol: &Self::Tol) -> bool

Source§

fn eq_r1st(&self, other: &BTreeMap<K, VB>, tol: &Self::Tol) -> bool

Source§

fn eq_r2nd(&self, other: &BTreeMap<K, VB>, tol: &Self::Tol) -> bool

Source§

fn eq_ulps(&self, other: &BTreeMap<K, VB>, tol: &UlpsTol<Self::Tol>) -> bool

Source§

impl<K, VA, VB, S> FloatEq<HashMap<K, VB, S>> for HashMap<K, VA, S>
where K: Eq + Hash, S: BuildHasher, VA: FloatEq<VB>, VA::Tol: Sized, UlpsTol<VA::Tol>: Sized,

Source§

type Tol = HashMap<K, <VA as FloatEq<VB>>::Tol, S>

Source§

fn eq_abs(&self, other: &HashMap<K, VB, S>, tol: &Self::Tol) -> bool

Source§

fn eq_rmax(&self, other: &HashMap<K, VB, S>, tol: &Self::Tol) -> bool

Source§

fn eq_rmin(&self, other: &HashMap<K, VB, S>, tol: &Self::Tol) -> bool

Source§

fn eq_r1st(&self, other: &HashMap<K, VB, S>, tol: &Self::Tol) -> bool

Source§

fn eq_r2nd(&self, other: &HashMap<K, VB, S>, tol: &Self::Tol) -> bool

Source§

fn eq_ulps(&self, other: &HashMap<K, VB, S>, tol: &UlpsTol<Self::Tol>) -> bool

Source§

impl<T: FloatEq> FloatEq for Option<T>
where T::Tol: Sized, UlpsTol<T::Tol>: Sized,

Source§

type Tol = Option<<T as FloatEq>::Tol>

Source§

fn eq_abs(&self, other: &Option<T>, tol: &Self::Tol) -> bool

Source§

fn eq_rmax(&self, other: &Option<T>, tol: &Self::Tol) -> bool

Source§

fn eq_rmin(&self, other: &Option<T>, tol: &Self::Tol) -> bool

Source§

fn eq_r1st(&self, other: &Option<T>, tol: &Self::Tol) -> bool

Source§

fn eq_r2nd(&self, other: &Option<T>, tol: &Self::Tol) -> bool

Source§

fn eq_ulps(&self, other: &Option<T>, tol: &UlpsTol<Self::Tol>) -> bool

Source§

impl<T: FloatEq> FloatEq for Complex<T>
where T::Tol: Sized, UlpsTol<T::Tol>: Sized,

Source§

type Tol = Complex<<T as FloatEq>::Tol>

Source§

fn eq_abs(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_rmax(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_rmin(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_r1st(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_r2nd(&self, other: &Self, tol: &Self::Tol) -> bool

Source§

fn eq_ulps(&self, other: &Self, tol: &UlpsTol<Self::Tol>) -> bool

Implementors§