FloatLike

Trait FloatLike 

Source
pub trait FloatLike<T>:
    MathOps<T>
    + TrigOps<T>
    + PartialOrd
    + PartialEq {
    // Required methods
    fn zero() -> T;
    fn one() -> T;
    fn pi() -> T;
    fn is_finite(self) -> bool;
    fn is_nan(self) -> bool;
    fn is_infinite(self) -> bool;
}
Expand description

Trait for types that can behave like floating-point numbers

Required Methods§

Source

fn zero() -> T

Zero value

Source

fn one() -> T

One value

Source

fn pi() -> T

Pi constant

Source

fn is_finite(self) -> bool

Check if the value is finite

Source

fn is_nan(self) -> bool

Check if the value is NaN

Source

fn is_infinite(self) -> bool

Check if the value is infinite

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.

Implementors§