Constructor
new PCG64(seedopt)
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
seed |
number | bigint | Array.<number> | SeedSequence |
<optional> |
Seed or SeedSequence. Random if omitted. |
- Source:
Methods
advance(delta) → {this}
Advances the state by delta steps in O(log delta) (numpy advance).
Parameters:
| Name | Type | Description |
|---|---|---|
delta |
number | bigint |
- Source:
Returns:
- Type
- this
next()
Steps and stores the next 64-bit output in (outHi, outLo). @private
- Source:
nextUint32() → {number}
Unsigned 32-bit output; uses both halves of each 64-bit output (low half first), as numpy.
- Source:
Returns:
- Type
- number
nextUint64() → {bigint}
Next unsigned 64-bit output as a bigint.
- Source:
Returns:
- Type
- bigint
nextUint64Parts() → {Array.<number>}
Next 64-bit output as [hi, lo] unsigned 32-bit numbers (XSL-RR output function).
- Source:
Returns:
- Type
- Array.<number>
random() → {number}
Uniform double in [0, 1) from the top 53 bits of one 64-bit output (numpy random).
- Source:
Returns:
- Type
- number
step()
state = state * multiplier + inc (mod 2^128), with 32-bit limbs. @private
- Source: