Table of Contents

frand

Description

Get a floating point random number, in the range of -1…1.

Function prototype

float frand <void>

Arguments

None.

Return value

A floating-point random number, in the range of -1…1.

Example

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

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

-0.667531
0.32609
-0.0984222
-0.295755
-0.885922
0.215369
0.566637
0.605213
0.0397656
-0.3961

Comments

None.

See also