Trait fastrand_contrib::RngExt
source · pub trait RngExt {
// Required methods
fn f32_range(&mut self, range: impl RangeBounds<f32>) -> f32;
fn f64_range(&mut self, range: impl RangeBounds<f64>) -> f64;
fn f32_normal(&mut self, mu: f32, sigma: f32) -> f32;
fn f64_normal(&mut self, mu: f64, sigma: f64) -> f64;
fn f32_normal_approx(&mut self, mu: f32, sigma: f32) -> f32;
fn f64_normal_approx(&mut self, mu: f64, sigma: f64) -> f64;
}
Expand description
Extra methods for fastrand::Rng
.
Required Methods§
sourcefn f32_range(&mut self, range: impl RangeBounds<f32>) -> f32
fn f32_range(&mut self, range: impl RangeBounds<f32>) -> f32
Generate a 32-bit floating point number in the specified range.
sourcefn f64_range(&mut self, range: impl RangeBounds<f64>) -> f64
fn f64_range(&mut self, range: impl RangeBounds<f64>) -> f64
Generate a 64-bit floating point number in the specified range.
sourcefn f32_normal(&mut self, mu: f32, sigma: f32) -> f32
fn f32_normal(&mut self, mu: f32, sigma: f32) -> f32
Generate a 32-bit floating point number in the normal distribution with mean mu and standard deviation sigma.
sourcefn f64_normal(&mut self, mu: f64, sigma: f64) -> f64
fn f64_normal(&mut self, mu: f64, sigma: f64) -> f64
Generate a 64-bit floating point number in the normal distribution with mean mu and standard deviation sigma.
sourcefn f32_normal_approx(&mut self, mu: f32, sigma: f32) -> f32
fn f32_normal_approx(&mut self, mu: f32, sigma: f32) -> f32
Generate a 32-bit floating point number in the normal distribution with mean mu and standard deviation sigma using an approximation algorithm.
sourcefn f64_normal_approx(&mut self, mu: f64, sigma: f64) -> f64
fn f64_normal_approx(&mut self, mu: f64, sigma: f64) -> f64
Generate a 64-bit floating point number in the normal distribution with mean mu and standard deviation sigma using an approximation algorithm.