decorum

Trait Nan

Source
pub trait Nan: Encoding {
    const NAN: Self;

    // Required method
    fn is_nan(self) -> bool;
}
Expand description

Floating-point representations that expose NaNs.

Required Associated Constants§

Source

const NAN: Self

A representation of NaN.

For primitive floating-point types, NaN is incomparable. Therefore, prefer the is_nan predicate over direct comparisons with NaN.

Required Methods§

Source

fn is_nan(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 Nan for f32

Source§

const NAN: Self = NaN_f32

Source§

fn is_nan(self) -> bool

Source§

impl Nan for f64

Source§

const NAN: Self = NaN_f64

Source§

fn is_nan(self) -> bool

Implementors§

Source§

impl<T, P> Nan for ConstrainedFloat<T, P>
where T: Float + Primitive, P: Constraint<T> + Member<NanClass>,

Source§

const NAN: Self = _