[[MIRROR from GitHub]] Pure random number generator written in TypeScript

✨ Add `jump` to `congruential32` (#882) master

## Summary This PR adds support for the jump-ahead operation to the congruential32 random number generator, enabling efficient generation of non-overlapping subsequences. ## Key Changes - **Interface Update**: Changed `LinearCongruential32` to implement `JumpableRandomGenerator` instead of `RandomGenerator`, adding the `jump()` method - **Jump Implementation**: Implemented `jump()` method that advances the generator state by 2^16 calls to `next()` (equivalent to 3 * 2^16 LCG steps) - **Jump Constants**: Added precomputed jump constants (`JUMP_MULTIPLIER` and `JUMP_INCREMENT`) based on the LCG jump-ahead algorithm by F. Brown - **Test Coverage**: Added comprehensive tests including: - Verification of correct sequence after jump with seed=42 - Property-based tests for jump ordering independence - Tests ensuring jump modifies generator state - Tests ensuring jump doesn't affect cloned generators ## Implementation Details The jump operation uses the mathematical property that for an LCG `s_{n+1} = (a * s_n + c) mod m`, jumping by k steps yields `s_{n+k} = (A * s_n + C) mod m` where A and C are precomputed constants. The implementation uses `Math.imul()` to handle potential overflow when multiplying the seed by the jump multiplier, ensuring correct 32-bit arithmetic. https://claude.ai/code/session_01Aj7Gx6g986py68THvGWpPK --------- Co-authored-by: Claude <noreply@anthropic.com>


+53 -4
2 changed files