Trait Scalar

Source
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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so 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§