12 lines
283 B
Text
12 lines
283 B
Text
|
|
extern crate rand;
|
||
|
|
use rand::distributions::{Normal, IndependentSample};
|
||
|
|
|
||
|
|
fn main() {
|
||
|
|
let mut rands = [0.0; 1000];
|
||
|
|
let normal = Normal::new(1.0, 0.5);
|
||
|
|
let mut rng = rand::thread_rng();
|
||
|
|
for num in rands.iter_mut() {
|
||
|
|
*num = normal.ind_sample(&mut rng);
|
||
|
|
}
|
||
|
|
}
|