rng-pack 0.2.5

Random number generator variety pack
Documentation
1
2
3
4
5
6
7
8
9
/// A trait for 32-bit random number generators.
pub trait Rng32 {
    /// Generates a random `i32` value in the range [min, max].
    fn randi(&mut self, min: i32, max: i32) -> i32;
    /// Generates a random `f32` value in the range [min, max).
    fn randf(&mut self, min: f32, max: f32) -> f32;
    /// Returns a random element from a slice.
    fn choice<'a, T>(&'a mut self, choices: &'a [T]) -> &'a T;
}