io.random()
is identical to Math.random()
when called without options but ensures your random numbers are not regenerated on resume or retry. It will return a pseudo-random floating-point number between optional min
(default: 0, inclusive) and max
(default: 1, exclusive). Can optionally round
to the nearest integer.
run()
. See
resumability for more information.max
.min
.max
integer will become inclusive when enabled. Rounding with floating-point bounds may cause unexpected skew and boundary inclusivity.Promise
that resolves with a pseudo-random number. Always resolves to an integer when rounding is enabled.