random

Type

Math Function

Purpose

The random function returns a random decimal value between 0 and 1 (inclusive). No value is required in the function's argument.

Syntax

random( )

Returns

A number between 0 and 1 (inclusive).

The result of the random function is really a pseudo-random number calculated by a formula, not a true random number.

Usage

The following steps are used to generate a random integer using the random function:

 ( random( ) * RANGE) + STARTING VALUE

 

Examples

floor( random( ) * 9)

Returns: A random integer between 0 and 9.

 

floor( random( ) * 90) + 10) )

Returns: A random integer between 10 and 100.

 

In these examples, floor rounds down the result to the nearest integer.