Rnd Function

Rnd function generates random integer numbers


Function

The function Rnd returns a random integer number or a list of random integer numbers


Syntax

Rnd (Max)

Rnd (Len, Max)

Rnd (Len, Min, Max)

Rnd ( [Max, Max, Max, Max] )

Example

Rnd (Max)

Returns a integer number greater than or equal to zero and less than max

Rnd (12) = 8

Rnd (Len, Max)

Returns a list of the specified length Len, with random integer numbers in the Range greater than or equal to zero and less max.

Rnd (8, 12) = 5 10 8 4 6 9 0

Rnd (Len, Min, Max)

Returns a list of the specified length Len, with random integer numbers greater or equal to Min and less Max.

Rnd (8, 10, 25) = 19 17 21 14 18 16 11 17

Rnd ( [Max, Max, Max, Max] )

Returns a list in the length of the argument, with random integer numbers in the range greater than or equal to zero and less than max of the corresponding element

Rnd ([5, 5, 5, 22, 22, 22]) = 3 4 1 18 3 13

Additional Information

  • URnd for lists with unique random numbers
  • Rndf for floating-point random numbers