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§

source

fn f32_range(&mut self, range: impl RangeBounds<f32>) -> f32

Generate a 32-bit floating point number in the specified range.

source

fn f64_range(&mut self, range: impl RangeBounds<f64>) -> f64

Generate a 64-bit floating point number in the specified range.

source

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.

source

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.

source

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.

source

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.

Implementors§