pub struct Normal { /* fields omitted */ }
The normal distribution N(mean, std_dev**2)
.
This uses the ZIGNOR variant of the Ziggurat method, see
StandardNormal
for more details.
use rand::distributions::{Normal, IndependentSample};
let normal = Normal::new(2.0, 3.0);
let v = normal.ind_sample(&mut rand::thread_rng());
println!("{} is from a N(2, 9) distribution", v)
Construct a new Normal
distribution with the given mean and
standard deviation.
Panics if std_dev < 0
.
Performs copy-assignment from source
. Read more
Generate a random value of Support
, using rng
as the source of randomness. Read more
Formats the value using the given formatter. Read more