Table of Contents

rand

Description

Get a random integer.

Function prototype

int rand <void>

Arguments

None.

Return value

An integer random number, in the range of 0…0x7FFFF.

Example

// write random number to event log 10 times
int i
set i 0
do
  echo <zs:rand>
  incr i
while <zs:islt i 10>

… the output of which is written to the event log by echo as:

41
18467
6334
26500
19169
15724
11478
29358
26962
24464

Comments

None.

See also