Skip to main content

FloatClass

Trait FloatClass 

Source
pub trait FloatClass: Real {
    // Required methods
    fn is_finite(self) -> bool;
    fn is_nan(self) -> bool;
    fn is_infinite(self) -> bool;
    fn is_normal(self) -> bool;
    fn is_subnormal(self) -> bool;
    fn is_sign_negative(self) -> bool;
    fn is_sign_positive(self) -> bool;
}
Expand description

Floating-point classification.

Required Methods§

Source

fn is_finite(self) -> bool

Returns true if self is neither infinite nor NaN.

Source

fn is_nan(self) -> bool

Returns true if self is NaN.

Source

fn is_infinite(self) -> bool

Returns true if self is positive or negative infinity.

Source

fn is_normal(self) -> bool

Returns true if self is neither zero, infinite, subnormal, nor NaN.

Source

fn is_subnormal(self) -> bool

Returns true if self is subnormal (denormal).

Source

fn is_sign_negative(self) -> bool

Returns true if the sign bit is negative.

Source

fn is_sign_positive(self) -> bool

Returns true if the sign bit is positive (or zero).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl FloatClass for f32

Source§

impl FloatClass for f64

Implementors§