Constants

rand constant

Returns a random number in the range 0 to 1.

Syntax

rand

Description

rand is used as a constant but returns a new pseudo-random number each time it is evaluated. The value is a real number in the range [0;1].

Remarks

Because rand returns a new value each time it is evaluated, a graph using rand will not look the same each time it is drawn. A graph using rand will also change when the program is forced to redraw, e.g. because the coordinate system is moved, resized or zoomed.

Implementation

rand uses a multiplicative congruential random number generator with period 2 to the 32nd power to return successive pseudo-random numbers in the range from 0 to 1.