Trait sprs_rand::rand_distr::Float[][src]

pub trait Float: Copy + PartialOrd<Self> + Neg<Output = Self> + Add<Self, Output = Self> + Sub<Self, Output = Self> + Mul<Self, Output = Self> + Div<Self, Output = Self> + AddAssign<Self> + SubAssign<Self> + MulAssign<Self> + DivAssign<Self> {
    pub fn pi() -> Self;
pub fn from(x: f64) -> Self;
pub fn to_u64(self) -> Option<u64>;
pub fn abs(self) -> Self;
pub fn floor(self) -> Self;
pub fn exp(self) -> Self;
pub fn ln(self) -> Self;
pub fn sqrt(self) -> Self;
pub fn powf(self, power: Self) -> Self;
pub fn tan(self) -> Self;
pub fn log_gamma(self) -> Self; }

Trait for floating-point scalar types

This allows many distributions to work with f32 or f64 parameters and is potentially extensible. Note however that the Exp1 and StandardNormal distributions are implemented exclusively for f32 and f64.

The bounds and methods are based purely on internal requirements, and will change as needed.

Required methods

pub fn pi() -> Self[src]

The constant π

pub fn from(x: f64) -> Self[src]

Support approximate representation of a f64 value

pub fn to_u64(self) -> Option<u64>[src]

Support converting to an unsigned integer.

pub fn abs(self) -> Self[src]

Take the absolute value of self

pub fn floor(self) -> Self[src]

Take the largest integer less than or equal to self

pub fn exp(self) -> Self[src]

Take the exponential of self

pub fn ln(self) -> Self[src]

Take the natural logarithm of self

pub fn sqrt(self) -> Self[src]

Take square root of self

pub fn powf(self, power: Self) -> Self[src]

Take self to a floating-point power

pub fn tan(self) -> Self[src]

Take the tangent of self

pub fn log_gamma(self) -> Self[src]

Take the logarithm of the gamma function of self

Loading content...

Implementations on Foreign Types

impl Float for f32[src]

impl Float for f64[src]

Loading content...

Implementors

Loading content...