pub trait Scalar {
    // Required methods
    fn half(self) -> Self;
    fn ave(self, other: Self) -> Self;
    fn sqr(self) -> Self;
    fn invert(self) -> Self;
    fn bound(self, min: Self, max: Self) -> Self;
    fn is_nearly_equal(self, other: Self) -> bool;
    fn is_nearly_zero(self) -> bool;
    fn is_nearly_zero_within_tolerance(self, tolerance: Self) -> bool;
    fn almost_dequal_ulps(self, other: Self) -> bool;
}
Expand description

Float number extension methods.

Mainly for internal use. Do not rely on it!

Required Methods§

source

fn half(self) -> Self

source

fn ave(self, other: Self) -> Self

source

fn sqr(self) -> Self

source

fn invert(self) -> Self

source

fn bound(self, min: Self, max: Self) -> Self

source

fn is_nearly_equal(self, other: Self) -> bool

source

fn is_nearly_zero(self) -> bool

source

fn is_nearly_zero_within_tolerance(self, tolerance: Self) -> bool

source

fn almost_dequal_ulps(self, other: Self) -> bool

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Scalar for f32

source§

fn bound(self, min: Self, max: Self) -> Self

A non-panicking clamp.

source§

fn half(self) -> f32

source§

fn ave(self, other: Self) -> f32

source§

fn sqr(self) -> f32

source§

fn invert(self) -> f32

source§

fn is_nearly_equal(self, other: Self) -> bool

source§

fn is_nearly_zero(self) -> bool

source§

fn is_nearly_zero_within_tolerance(self, tolerance: Self) -> bool

source§

fn almost_dequal_ulps(self, other: Self) -> bool

Implementors§