samplePair(
random,lowerBound,upperExclusive): readonly [number,number]
Defined in: packages/sampling/src/sample-pair.ts:23
Sample an ascending pair of distinct integers in [lowerBound, upperExclusive).
Runs in O(1) time and auxiliary space and does not mutate its inputs.
Parameters
Section titled “Parameters”random
Section titled “random”lowerBound
Section titled “lowerBound”number
upperExclusive
Section titled “upperExclusive”number
Returns
Section titled “Returns”readonly [number, number]
Throws
Section titled “Throws”With code INVALID_RANGE when the bounds
are not safe integers spanning between 2 and 2^32 values.
Throws
Section titled “Throws”With code INVALID_SOURCE_VALUE when the
random source returns a value outside [0, 1).