Rand()

Type: REGULAR FUNCTION

Purpose: Calculate a random number from 0 to RAND_MAX (32767).

Several options can occur, however. If no number is passed, a random number from 0 to RAND_MAX is returned. If a negative number is passed, RAND_MAX is returned. If a positive number is passed, the random number generator is re-seeded.

Usage: Result = Rand(Number)

 

Number

INDEX

NIL

NEGATIVE

POSITIVE

Base value. If X < 0, –X is used.

  Result INDEX

Random number if Number is NIL

RAND_MAX if Number is negative

NIL if Number is positive

Related Topics IconRelated Topics