RandomInt
Returns a random integer.
Syntax
-
RandomInt(M)
-
M
is a positive integer
-
-
RandomInt(A, B)
-
A
andB
are integers withA < B
-
Description
-
RandomInt(M)
returns a random integer in[0, M) ∩ ℤ
. -
RandomInt(A, B)
returns a random integer in[A, B) ∩ ℤ
.
Examples
stats ≔ L ↦ '(min(L), mean(L), max(L))
custom function
stats(compute(RandomInt(100), n, 1, 1000000))
0 49.513644 99
stats(compute(RandomInt(100, 200), n, 1, 1000000))
100 149.531866 199
stats(compute(RandomInt(256), n, 1, 1000000))
0 127.435639 255