toMathRandom
toMathRandom(
source): () =>number
Defined in: src/compat.ts:24
A Math.random-compatible function backed by source.
For handing a seeded stream to a library that only takes a
Math.random-shaped function.
Parameters
Section titled “Parameters”source
Section titled “source”Returns
Section titled “Returns”() => number
Example
Section titled “Example”const rand = toMathRandom(new Random(42));rand(); // 0.3964157... reproducible