Constructors
constructor
- new Random(sourceRng: RandomGenerator): Random
Parameters
- sourceRng: RandomGenerator
Methods
getState
- getState(): undefined | readonly number[]
Returns undefined | readonly number[]
next
- next(bits: number): number
Returns number
nextArrayInt
- nextArrayInt(
min: { data: number[]; sign: -1 | 1 },
max: { data: number[]; sign: -1 | 1 },
): { data: number[]; sign: -1 | 1 } Parameters
- min: { data: number[]; sign: -1 | 1 }
- max: { data: number[]; sign: -1 | 1 }
Returns { data: number[]; sign: -1 | 1 }
nextBigInt
- nextBigInt(min: bigint, max: bigint): bigint
Returns bigint
nextBoolean
- nextBoolean(): boolean
Returns boolean
nextDouble
- nextDouble(): number
Returns number
nextInt
- nextInt(): number
Returns number
- nextInt(min: number, max: number): number
Returns number
Wrapper around an instance of a
pure-rand
's random number generator offering a simpler interface to deal with random with impure patterns