range - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

MapleTA[Builtin]

  

range

  

random integers from a range defined with a step size

 

Calling Sequence

Parameters

Description

Examples

Compatibility

Calling Sequence

range(n)

range(m, n)

range(m, n, k)

Parameters

m, n, k

-

integer

Description

• 

The range command returns random integers from a range defined with a step size.

• 

The range(n) command, where n>=1, generates a random integer in the range 1, ..., floor(n) (inclusive).  There are floor(n) numbers in that range. Hence, it is a selection of one number from a choice of floor(n).

• 

With 2 arguments, range(m,n), where n-m>=0, generates a random integer in the range m, m+1,..., m+q (inclusive) where q is the floor of n-m

• 

With 3 arguments, range(m,n,k), where (n-m)/k=0 generates a random integer in the range m, m+k, ..., m+qk (inclusive) where q is the floor of (n-m)/k.  That is, range(n) = range(1,n) = range(1,n,1)

• 

Note: The rint function returns random numbers in the range 0, ..., n-1 (inclusive).

Examples

(1)

(2)

(3)

(4)

(5)

(6)

Compatibility

• 

The MapleTA[Builtin][range] command was introduced in Maple 18.

• 

For more information on Maple 18 changes, see Updates in Maple 18.

See Also

MapleTA

MapleTA,Builtin,rand

MapleTA,Builtin,rint

 


Download Help Document