repl.txt (2578B)
1 2 {{alias}}( [options] ) 3 Returns an iterator for generating pseudorandom numbers drawn from a 4 standard normal distribution using the Improved Ziggurat algorithm. 5 6 If an environment supports Symbol.iterator, the returned iterator is 7 iterable. 8 9 Parameters 10 ---------- 11 options: Object (optional) 12 Options. 13 14 options.prng: Function (optional) 15 Pseudorandom number generator (PRNG) for generating uniformly 16 distributed pseudorandom numbers on the interval `[0,1)`. If provided, 17 the `state` and `seed` options are ignored. In order to seed the 18 returned iterator, one must seed the provided `prng` (assuming the 19 provided `prng` is seedable). 20 21 options.seed: integer|ArrayLikeObject<integer> (optional) 22 Pseudorandom number generator seed. The seed may be either a positive 23 unsigned 32-bit integer or, for arbitrary length seeds, an array-like 24 object containing unsigned 32-bit integers. 25 26 options.state: Uint32Array (optional) 27 Pseudorandom number generator state. If provided, the `seed` option is 28 ignored. 29 30 options.copy: boolean (optional) 31 Boolean indicating whether to copy a provided pseudorandom number 32 generator state. Setting this option to `false` allows sharing state 33 between two or more pseudorandom number generators. Setting this option 34 to `true` ensures that a returned iterator has exclusive control over 35 its internal state. Default: true. 36 37 options.iter: integer (optional) 38 Number of iterations. 39 40 Returns 41 ------- 42 iterator: Object 43 Iterator. 44 45 iterator.next(): Function 46 Returns an iterator protocol-compliant object containing the next 47 iterated value (if one exists) and a boolean flag indicating whether the 48 iterator is finished. 49 50 iterator.return( [value] ): Function 51 Finishes an iterator and returns a provided value. 52 53 iterator.PRNG: Function 54 Underlying pseudorandom number generator. 55 56 iterator.seed: Uint32Array|null 57 Pseudorandom number generator seed. 58 59 iterator.seedLength: integer|null 60 Length of generator seed. 61 62 iterator.state: Uint32Array|null 63 Generator state. 64 65 iterator.stateLength: integer|null 66 Length of generator state. 67 68 iterator.byteLength: integer|null 69 Size (in bytes) of generator state. 70 71 Examples 72 -------- 73 > var it = {{alias}}(); 74 > var r = it.next().value 75 <number> 76 > r = it.next().value 77 <number> 78 79 See Also 80 -------- 81