FloatData

Trait FloatData 

Source
pub trait FloatData<T>:
    Mul<Output = T>
    + Display
    + Add<Output = T>
    + Div<Output = T>
    + Neg<Output = T>
    + Copy
    + Debug
    + PartialEq
    + PartialOrd
    + AddAssign
    + Sub<Output = T>
    + SubAssign
    + Sum
    + Send
    + Sync {
    const ZERO: T;
    const ONE: T;
    const MIN: T;
    const MAX: T;
    const NAN: T;
    const INFINITY: T;

    // Required methods
    fn from_usize(v: usize) -> T;
    fn from_u16(v: u16) -> T;
    fn is_nan(self) -> bool;
    fn ln(self) -> T;
    fn exp(self) -> T;
}
Expand description

Data trait used throughout the package to control for floating point numbers.

Required Associated Constants§

Source

const ZERO: T

Source

const ONE: T

Source

const MIN: T

Source

const MAX: T

Source

const NAN: T

Source

const INFINITY: T

Required Methods§

Source

fn from_usize(v: usize) -> T

Source

fn from_u16(v: u16) -> T

Source

fn is_nan(self) -> bool

Source

fn ln(self) -> T

Source

fn exp(self) -> T

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

Source§

const ZERO: f32 = 0f32

Source§

const ONE: f32 = 1f32

Source§

const MIN: f32 = -3.40282347E+38f32

Source§

const MAX: f32 = 3.40282347E+38f32

Source§

const NAN: f32 = NaN_f32

Source§

const INFINITY: f32 = +Inf_f32

Source§

fn from_usize(v: usize) -> f32

Source§

fn from_u16(v: u16) -> f32

Source§

fn is_nan(self) -> bool

Source§

fn ln(self) -> f32

Source§

fn exp(self) -> f32

Source§

impl FloatData<f64> for f64

Source§

const ZERO: f64 = 0f64

Source§

const ONE: f64 = 1f64

Source§

const MIN: f64 = -1.7976931348623157E+308f64

Source§

const MAX: f64 = 1.7976931348623157E+308f64

Source§

const NAN: f64 = NaN_f64

Source§

const INFINITY: f64 = +Inf_f64

Source§

fn from_usize(v: usize) -> f64

Source§

fn from_u16(v: u16) -> f64

Source§

fn is_nan(self) -> bool

Source§

fn ln(self) -> f64

Source§

fn exp(self) -> f64

Implementors§