Function peroxide::statistics::rand::rand_num
source · pub fn rand_num<T>(rng: &mut ThreadRng, start: T, end: T) -> Twhere
T: PartialOrd + SampleUniform + Copy,
Expand description
Simple uniform random number generator with ThreadRng
Examples
extern crate peroxide;
use peroxide::fuga::*;
let mut rng = thread_rng();
println!("{}", rand_num(&mut rng, 1, 7)); // Roll a dice
println!("{}", rand_num(&mut rng, 0f64, 1f64)); // Uniform [0,1)