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