Skip to main content

random_below

Function random_below 

Source
pub fn random_below(rng: &mut Pcg64Mcg, n: u64) -> u64
Available on crate feature generators only.
Expand description

A uniform integer in [0, n). Panics via debug-assert if n == 0. Uses modulo reduction (deterministic; slight low-bit bias is acceptable — generator conformance is structural, not sequence-exact).