@@ -351,14 +351,16 @@ pub fn (mut rng PRNG) bernoulli(p f64) !bool {
351
351
return rng.f64 () < = p
352
352
}
353
353
354
- // normal returns a normally distributed pseudorandom f64 in range `[0, 1)`.
354
+ // normal returns a normally distributed pseudorandom f64 with mean `mu` and standard
355
+ // deviation `sigma`. By default, `mu` is 0.0 and `sigma` is 1.0.
355
356
// NOTE: Use normal_pair() instead if you're generating a lot of normal variates.
356
357
pub fn (mut rng PRNG) normal (conf config.NormalConfigStruct) ! f64 {
357
358
x , _ := rng.normal_pair (conf)!
358
359
return x
359
360
}
360
361
361
- // normal_pair returns a pair of normally distributed pseudorandom f64 in range `[0, 1)`.
362
+ // normal_pair returns a pair of normally distributed pseudorandom f64 with mean `mu` and standard
363
+ // deviation `sigma`. By default, `mu` is 0.0 and `sigma` is 1.0.
362
364
pub fn (mut rng PRNG) normal_pair (conf config.NormalConfigStruct) ! (f64 , f64 ) {
363
365
if conf.sigma < = 0 {
364
366
return error ('Standard deviation must be positive' )
@@ -714,13 +716,15 @@ pub fn bernoulli(p f64) !bool {
714
716
return default_rng.bernoulli (p)
715
717
}
716
718
717
- // normal returns a normally distributed pseudorandom f64 in range `[0, 1)`.
719
+ // normal returns a normally distributed pseudorandom f64 with mean `mu` and standard
720
+ // deviation `sigma`. By default, `mu` is 0.0 and `sigma` is 1.0.
718
721
// NOTE: Use normal_pair() instead if you're generating a lot of normal variates.
719
722
pub fn normal (config_ config.NormalConfigStruct) ! f64 {
720
723
return default_rng.normal (config_)
721
724
}
722
725
723
- // normal_pair returns a pair of normally distributed pseudorandom f64 in range `[0, 1)`.
726
+ // normal_pair returns a pair of normally distributed pseudorandom f64 with mean `mu` and standard
727
+ // deviation `sigma`. By default, `mu` is 0.0 and `sigma` is 1.0.
724
728
pub fn normal_pair (config_ config.NormalConfigStruct) ! (f64 , f64 ) {
725
729
return default_rng.normal_pair (config_)
726
730
}
0 commit comments