Trait NanEncoding

Source
pub trait NanEncoding: Copy {
    type Nan;

    const NAN: Self::Nan;

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

A type with an IEEE 754 floating-point representation that supports NaNs.

NanEncoding types have NaN inhabitants.

Required Associated Constants§

Source

const NAN: Self::Nan

An arbitrary representation of NaN.

Required Associated Types§

Source

type Nan

The type of the arbitrary Nan representation NAN.

This may be an intermediate type other than Self. In particular, primitive IEEE 754 floating-point types represent NaN with the Nan type, which is incomparable and must first be converted into its primitive types.

For proxy types, which are totally ordered, this type satisfies the bound Eq + Ord.

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 NanEncoding for f32

Source§

const NAN: Self::Nan = {transmute(0x7fc00000): <f32 as NanEncoding>::Nan}

Source§

type Nan = Nan<f32>

Source§

fn is_nan(self) -> bool

Source§

impl NanEncoding for f64

Source§

const NAN: Self::Nan = {transmute(0x7ff8000000000000): <f64 as NanEncoding>::Nan}

Source§

type Nan = Nan<f64>

Source§

fn is_nan(self) -> bool

Implementors§

Source§

impl<T, C> NanEncoding for Constrained<T, C>

Source§

const NAN: Self::Nan

Source§

type Nan = Constrained<T, C>