Function onejoker::utils::oj_rand_range

source ยท
pub fn oj_rand_range(limit: usize) -> usize
Expand description

wiki | Random integer within range Return a random integer uniformly distributed in range [0, limit) with no division, using rejection sampling. The mask m is created to minimize rejections, which will be at worst 50%.