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