rand()

Read(254) Label: random number,

Description:

Get a random number.

Syntax:

rand(n)

Note:

  The function returns a random integer between 0 and 1.

Parameters:

n

An integer. Without it the function returns a random float number between 0 and 1.0

Options:

@s

Set the seed value for generating a random number.

Return value:

Numeric type

Example:

rand()

Get a random number in the range of [0, 1.0]

rand()*100

Get a random float number in the range of [0, 100]

rand(100)

Get a random integer in the range of [0, 100]

Ø  The seed value for generating a random number.

 

A

 

1

=rand@s(5)

 

2

=10.(rand())

 

3

= rand@s(5)

 

4

=10.(rand())

The 10 random numbers generated in A4 and A2 are identical