Skip to main content

FloatSemantics

Trait FloatSemantics 

Source
pub trait FloatSemantics: Copy {
    // Required methods
    fn needs_normalization(self) -> bool;
    fn normalize(self) -> Self;
    fn compare(self, other: Self) -> Ordering;
}
Expand description

The floating point types the functions in this module are defined for: f16, f32 and f64.

Required Methods§

Source

fn needs_normalization(self) -> bool

Whether normalize_float would change this value. This is a cheap check that lets callers skip rewriting data which is already normalized.

Source

fn normalize(self) -> Self

Source

fn compare(self, other: Self) -> Ordering

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl FloatSemantics for f16

Source§

fn needs_normalization(self) -> bool

Source§

fn normalize(self) -> Self

Source§

fn compare(self, other: Self) -> Ordering

Source§

impl FloatSemantics for f32

Source§

fn needs_normalization(self) -> bool

Source§

fn normalize(self) -> Self

Source§

fn compare(self, other: Self) -> Ordering

Source§

impl FloatSemantics for f64

Source§

fn needs_normalization(self) -> bool

Source§

fn normalize(self) -> Self

Source§

fn compare(self, other: Self) -> Ordering

Implementors§