RND (Random Number)

The RND function is used to generate a random number.

Syntax

variable = RND

Remarks

The RND function returns a single value less than 1 but greater than or equal to 0.

Unlike other CRBasic dataloggers, with the CR300 the RND function does not have to be initialized with Randomize to create a random sequence of numbers.

To produce random integers in a given range, use this formula:

INT( ( upperbound - lowerbound + 1 ) * RND + lowerbound )

Here, upperbound is the highest number in the range, and lowerbound is the lowest number in the range.