Skip to main content

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 = 0.0

Source§

const ONE: f32 = 1.0

Source§

const MIN: f32 = f32::MIN

Source§

const MAX: f32 = f32::MAX

Source§

const NAN: f32 = f32::NAN

Source§

const INFINITY: f32 = f32::INFINITY

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 = 0.0

Source§

const ONE: f64 = 1.0

Source§

const MIN: f64 = f64::MIN

Source§

const MAX: f64 = f64::MAX

Source§

const NAN: f64 = f64::NAN

Source§

const INFINITY: f64 = f64::INFINITY

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§