decorum

Trait Encoding

Source
pub trait Encoding: Copy {
    const MAX: Self;
    const MIN: Self;
    const MIN_POSITIVE: Self;
    const EPSILON: Self;

    // Required methods
    fn classify(self) -> FpCategory;
    fn is_normal(self) -> bool;
    fn is_sign_positive(self) -> bool;
    fn is_sign_negative(self) -> bool;
    fn integer_decode(self) -> (u64, i16, i8);
}
Expand description

Floating-point encoding.

Provides values and operations that describe the encoding of an IEEE-754 floating-point value. Infinities and NaNs are described by the Infinite and NaN sub-traits.

Required Associated Constants§

Source

const MAX: Self

Source

const MIN: Self

Source

const MIN_POSITIVE: Self

Source

const EPSILON: 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 Encoding for f32

Source§

const MAX: Self = 3.40282347E+38f32

Source§

const MIN: Self = -3.40282347E+38f32

Source§

const MIN_POSITIVE: Self = 1.17549435E-38f32

Source§

const EPSILON: Self = 1.1920929E-7f32

Source§

fn classify(self) -> FpCategory

Source§

fn is_normal(self) -> bool

Source§

fn is_sign_positive(self) -> bool

Source§

fn is_sign_negative(self) -> bool

Source§

fn integer_decode(self) -> (u64, i16, i8)

Source§

impl Encoding for f64

Source§

const MAX: Self = 1.7976931348623157E+308f64

Source§

const MIN: Self = -1.7976931348623157E+308f64

Source§

const MIN_POSITIVE: Self = 2.2250738585072014E-308f64

Source§

const EPSILON: Self = 2.2204460492503131E-16f64

Source§

fn classify(self) -> FpCategory

Source§

fn is_normal(self) -> bool

Source§

fn is_sign_positive(self) -> bool

Source§

fn is_sign_negative(self) -> bool

Source§

fn integer_decode(self) -> (u64, i16, i8)

Implementors§

Source§

impl<T, P> Encoding for ConstrainedFloat<T, P>
where T: Float + Primitive, P: Constraint<T>,

Source§

const MAX: Self = _

Source§

const MIN: Self = _

Source§

const MIN_POSITIVE: Self = _

Source§

const EPSILON: Self = _