std.rand [core] std.rand.Rng pub struct Rng { state: wrapping[u64], inc: wrapping[u64], } — A seeded PCG32 generator. std.rand.new pub fn new(seed: int) -> Rng — A generator seeded with seed. std.rand.next_int pub fn next_int(mut r: Rng) -> int — The next 32 bits of the stream, as an int in [0, 4294967296). std.rand.below pub fn below(mut r: Rng, n: int) -> int — A uniform draw from [0, n), without modulo bias — the high draws that would skew the residue are rejected and redrawn, so the number of draws is data-dependent but the distribution is exact. std.rand.next_float pub fn next_float(mut r: Rng) -> f64 — A uniform draw from [0.0, 1.0) with 52 bits of resolution: the draw fills a mantissa, so every representable multiple of 2^-52 in the interval is equally likely and 1.0 is never returned. std.rand.next_bool pub fn next_bool(mut r: Rng) -> bool — A fair coin, taken from the output word's top bit (the LCG's best bit after the output permutation). std.rand.shuffle pub fn shuffle(mut r: Rng, mut xs: List[int]) — Shuffles xs into a uniformly random permutation (Fisher–Yates, drawing from the front). std.rand.choose pub fn choose(mut r: Rng, xs: List[int]) -> int ! {none} — A uniformly chosen element of xs, or none when xs is empty.