MapleTA[Builtin]
rint
return random integers
Calling Sequence
Parameters
Description
Examples
Compatibility
rint(n)
rint(m, n)
rint(m, n, k)
m, n, k
-
integer
The rint(n) function generates a random integer in the range 0, ..., n-1 (inclusive). There are n numbers in that range. Hence, it is a selection of one number from a choice of n.
The rint(m,n) function generates a random integer in the range m, ..., n-1 (inclusive).
The rint(m,n,k) function generates a random integer in the range m, m+k, ..., m+qk (inclusive) where q is the largest integer such that m+qk<=n-k. That is, rint(n) = rint(0,n) = rint(0,n,1)
MapleTA:-Builtin:-rint⁡3
0
seq⁡MapleTA:-Builtin:-rint⁡3,i=1..100
0,1,2
MapleTA:-Builtin:-rint⁡1,3
1
seq⁡MapleTA:-Builtin:-rint⁡1,3,i=1..100
1,2
MapleTA:-Builtin:-rint⁡0,7,3
3
seq⁡MapleTA:-Builtin:-rint⁡0,7,3,i=1..100
0,3
seq⁡MapleTA:-Builtin:-rint⁡0,8,3,i=1..100
seq⁡MapleTA:-Builtin:-rint⁡0,9,3,i=1..100
0,3,6
seq⁡MapleTA:-Builtin:-rint⁡1,10,3,i=1..100
1,4,7
The MapleTA[Builtin][rint] command was introduced in Maple 18.
For more information on Maple 18 changes, see Updates in Maple 18.
See Also
MapleTA
Download Help Document