decorum::cmp

Trait FloatOrd

Source
pub trait FloatOrd {
    // Required method
    fn float_cmp(&self, other: &Self) -> Ordering;
}
Expand description

Total ordering of primitive floating-point types.

FloatOrd expresses the total ordering:

$$-\infin<\cdots<0<\cdots<\infin<\text{NaN}$$

This trait can be used to compare primitive floating-point types without the need to wrap them within a proxy type. See the module documentation for more about the ordering used by FloatOrd and proxy types.

Required Methods§

Source

fn float_cmp(&self, other: &Self) -> Ordering

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<T> FloatOrd for [T]
where T: Float + Primitive,

Source§

fn float_cmp(&self, other: &Self) -> Ordering

Implementors§

Source§

impl<T> FloatOrd for T
where T: Float + Primitive,