Function peroxide::statistics::rand::rand_num

source ·
pub fn rand_num<T>(rng: &mut ThreadRng, start: T, end: T) -> T
Expand description

Simple uniform random number generator with ThreadRng

§Examples

use peroxide::fuga::*;

let mut rng = thread_rng();
println!("{}", rand_num(&mut rng, 1, 7));       // Roll a die
println!("{}", rand_num(&mut rng, 0f64, 1f64)); // Uniform [0,1)