# [−][src]Trait approx::UlpsEq

    pub trait UlpsEq<Rhs = Self>: AbsDiffEq<Rhs> where
        Rhs: ?Sized, {
        fn default_max_ulps() -> u32;
        fn ulps_eq(
            &self,
            other: &Rhs,
            epsilon: Self::Epsilon,
            max_ulps: u32
        ) -> bool;

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

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

## Required methods

### `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.

### `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.

Loading content...

## Provided methods

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

The inverse of `ApproxEq::ulps_eq`.

Loading content...

## Implementations on Foreign Types

### `impl UlpsEq<f32> for f32`[src]

#### `fn default_max_ulps() -> u32`[src]

#### `fn ulps_eq(&self, other: &f32, epsilon: f32, max_ulps: u32) -> bool`[src]

### `impl UlpsEq<f64> for f64`[src]

#### `fn default_max_ulps() -> u32`[src]

#### `fn ulps_eq(&self, other: &f64, epsilon: f64, max_ulps: u32) -> bool`[src]

### `impl<'a, T: UlpsEq + ?Sized> UlpsEq<&'a T> for &'a T`[src]

#### `fn default_max_ulps() -> u32`[src]

#### `fn ulps_eq(&self, other: &&'a T, epsilon: T::Epsilon, max_ulps: u32) -> bool`[src]

### `impl<'a, T: UlpsEq + ?Sized> UlpsEq<&'a mut T> for &'a mut T`[src]

#### `fn default_max_ulps() -> u32`[src]

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

### `impl<T: UlpsEq + Copy> UlpsEq<Cell<T>> for Cell<T>`[src]

#### `fn default_max_ulps() -> u32`[src]

#### `fn ulps_eq(&self, other: &Cell<T>, epsilon: T::Epsilon, max_ulps: u32) -> bool`[src]

### `impl<T: UlpsEq + ?Sized> UlpsEq<RefCell<T>> for RefCell<T>`[src]

#### `fn default_max_ulps() -> u32`[src]

#### `fn ulps_eq(
&self,
other: &RefCell<T>,
epsilon: T::Epsilon,
max_ulps: u32
) -> bool`[src]

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

#### `fn default_max_ulps() -> u32`[src]

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

Loading content...

## Implementors

Loading content...

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g., `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g., `vec -> usize` or `* -> vec`)

Search multiple things at once by splitting your query with comma (e.g., `str,u8` or `String,struct:Vec,test`)