InfinityEncoding

Trait InfinityEncoding 

Source
pub trait InfinityEncoding: Copy {
    const INFINITY: Self;
    const NEG_INFINITY: Self;

    // Required methods
    fn is_infinite(self) -> bool;
    fn is_finite(self) -> bool;
}
Expand description

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

InfinityEncoding types have -INF and +INF inhabitants.

Required Associated Constants§

Source

const INFINITY: Self

Source

const NEG_INFINITY: Self

Required Methods§

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

Source§

const INFINITY: Self = +Inf_f32

Source§

const NEG_INFINITY: Self = -Inf_f32

Source§

fn is_infinite(self) -> bool

Source§

fn is_finite(self) -> bool

Source§

impl InfinityEncoding for f64

Source§

const INFINITY: Self = +Inf_f64

Source§

const NEG_INFINITY: Self = -Inf_f64

Source§

fn is_infinite(self) -> bool

Source§

fn is_finite(self) -> bool

Implementors§