[go: up one dir, main page]

Trait usvg::strict_num::Ulps

pub trait Ulps {
    type U: Copy;

    // Required methods
    fn ulps(&self, other: &Self) -> Self::U;
    fn next(&self) -> Self;
    fn prev(&self) -> Self;
}

Required Associated Types§

type U: Copy

Required Methods§

fn ulps(&self, other: &Self) -> Self::U

The number of representable values or ULPs (Units of Least Precision) that separate self and other. The result U is an integral value, and will be zero if self and other are exactly equal.

fn next(&self) -> Self

The next representable number above this one

fn prev(&self) -> Self

The previous representable number below this one

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

§

impl Ulps for f32

§

type U = i32

§

fn ulps(&self, other: &f32) -> i32

§

fn next(&self) -> f32

§

fn prev(&self) -> f32

§

impl Ulps for f64

§

type U = i64

§

fn ulps(&self, other: &f64) -> i64

§

fn next(&self) -> f64

§

fn prev(&self) -> f64

Implementors§