[−][src]Trait rand_distr::Float
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
fn pi() -> Self
The constant π
fn from(x: f64) -> Self
Support approximate representation of a f64 value
fn to_u64(self) -> Option<u64>
Support converting to an unsigned integer.
fn abs(self) -> Self
Take the absolute value of self
fn floor(self) -> Self
Take the largest integer less than or equal to self
fn exp(self) -> Self
Take the exponential of self
fn ln(self) -> Self
Take the natural logarithm of self
fn sqrt(self) -> Self
Take square root of self
fn powf(self, power: Self) -> Self
Take self to a floating-point power
fn tan(self) -> Self
Take the tangent of self
fn log_gamma(self) -> Self
Take the logarithm of the gamma function of self