Expand description
Utility functions for RNG operations
Functionsยง
- choose
- Choose a random element from a slice
- fill_
bytes - Fill a byte buffer with random data
- gen_f32
- Generate a random f32 in [0.0, 1.0)
- gen_f64
- Generate a random f64 in [0.0, 1.0)
- gen_
range - Generate a random value in the given range [low, high) - fallback without distributions
- gen_
range_ f32 - Generate a random f32 value in the given range [low, high) - fallback without distributions
- gen_
range_ f64 - Generate a random f64 value in the given range [low, high) - fallback without distributions
- gen_
range_ u32 - Generate a random u32 value in the given range [low, high) - fallback without distributions
- gen_
range_ u64 - Generate a random u64 value in the given range [low, high) - fallback without distributions
- sample
- Sample n elements from a slice (without replacement)
- shuffle
- Shuffle a slice in place using Fisher-Yates algorithm
- weighted_
choose - Weighted random selection