UNPKG

1.17 kBTypeScriptView Raw
1/**
2 * This is a variant of xoroshiro128plus - the fastest full-period generator passing BigCrush without systematic failures.
3 *
4 * This implementation follows the idea of the original xoroshiro128plus implementation,
5 * but is optimized for the JavaScript runtime. I.e.
6 * * The operations are performed on 32bit integers (the original implementation works with 64bit values).
7 * * The initial 128bit state is computed based on a 32bit seed and Xorshift32.
8 * * This implementation returns two 32bit values based on the 64bit value that is computed by xoroshiro128plus.
9 * Caution: The last addition step works slightly different than in the original implementation - the add carry of the
10 * first 32bit addition is not carried over to the last 32bit.
11 *
12 * [Reference implementation](http://vigna.di.unimi.it/xorshift/xoroshiro128plus.c)
13 */
14export class Xoroshiro128plus {
15 /**
16 * @param {number} seed Unsigned 32 bit number
17 */
18 constructor(seed: number);
19 seed: number;
20 state: Uint32Array;
21 _fresh: boolean;
22 /**
23 * @return {number} Float/Double in [0,1)
24 */
25 next(): number;
26}
27//# sourceMappingURL=Xoroshiro128plus.d.ts.map
\No newline at end of file