Reference · Rules, maps and records
nextRandomfunction
The next number from the random at state, in [0, 1), and the state after it.
Import it
import { nextRandom } from "@johnmorrisdotca/tenka";
Definition
function nextRandom(state: number): { value: number; state: number; }
Parameters
| Name | Type | Description |
|---|---|---|
state | number | The seeded random generator state before the draw. |
Returns
{ value: number; state: number; }
The next number from the random at state, in [0, 1), and the state after it.
Examples
import { nextRandom } from "@johnmorrisdotca/tenka";
console.log(nextRandom(42));{ value: 0.6011037519201636, state: 1831565855 }What it prints (run when this page was built)