RANDINT

Purpose:

Generates a uniformly distributed random array of integers.

Syntax:

RANDINT(numrows, numcols, rangelow, rangehigh)

numrows

-

An integer. The number of output rows.

numcols

-

Optional. An integer, the number of output columns. Defaults to numrows.

rangelow

-

Optional. An integer, the low end of the range. Defaults to 1.

rangehigh

-

Optional. An integer, the high end of the range. Defaults to 100.

Returns:

A scalar, series or array.

 

RANDINT with no input arguments returns a scalar.

Example:

randint(20, 5)

 

Generates a 20 row by 5 column array of uniformly distributed random integers with values between 1 and 100.

Example:

randint(20)

 

Generates a 20 x 20 random integer array with values between 1 and 100.

Example:

randint(20, 20, -100, 100)

 

Generates a 20 x 20 random integer array with values between -100 and 100.

Example:

randint

 

Returns a single random integer between 1 and 100.

Example:

castint(randint(1, 1, 1000, 10000))

 

Returns a single random integer between 1000 and 10000.

Remarks:

RANDINT uses GRANDINT to generate the random values. The SEEDRAND function determines the initial seed of the random number generator.

 

See RAND to generate an array of uniformly distributed random reals.

See Also:

GNORMAL

GRANDINT

GRANDOM

RAND

RANDN

SEEDRAND