Files
rose-ash/plans
giles 8ca3ef342d
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 48s
ocaml: phase 6 Random module (deterministic LCG) (+4 tests, 549 total)
Linear-congruential PRNG with mutable seed (_state ref). API:

  init s        seed the PRNG
  self_init ()  default seed (1)
  int bound     0 <= n < bound
  bool ()       fair coin
  float bound   uniform in [0, bound)
  bits ()       30 bits

Stepping rule:
  state := (state * 1103515245 + 12345) mod 2147483647
  result := |state| mod bound

Same seed reproduces the same sequence. Real OCaml's Random uses
Lagged Fibonacci; ours is simpler but adequate for shuffles and
Monte Carlo demos in baseline programs.

  Random.init 42; Random.int 100  = 48
  Random.init 1;  Random.int 10   = 0
2026-05-09 04:12:16 +00:00
..