Skip to content

Glossary: Coding Interviews in Rust

Linear congruential generator

Also written: LCG, Rng, wrapping_mul, wrapping_add

A tiny random-number generator that multiplies its state by a large number and adds another constant each step. It is handy because Rust's standard library has no random numbers, and `wrapping_mul` and `wrapping_add` let the values wrap around instead of panicking.

Where the book teaches it

Related terms

SeedBrute-force checkerPanic