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> {
    fn pi() -> Self;
    fn from(x: f64) -> Self;
    fn to_u64(self) -> Option<u64>;
    fn abs(self) -> Self;
    fn floor(self) -> Self;
    fn exp(self) -> Self;
    fn ln(self) -> Self;
    fn sqrt(self) -> Self;
    fn powf(self, power: Self) -> Self;
    fn tan(self) -> Self;
    fn log_gamma(self) -> Self;
}
Expand description

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

The constant π

Support approximate representation of a f64 value

Support converting to an unsigned integer.

Take the absolute value of self

Take the largest integer less than or equal to self

Take the exponential of self

Take the natural logarithm of self

Take square root of self

Take self to a floating-point power

Take the tangent of self

Take the logarithm of the gamma function of self

Implementations on Foreign Types

Implementors