IMath.RandBetween

Syntax

RandBetween(Bottom: Double; Top: Double): Double;

Parameters

Bottom. Bottom border of the range.

Top. Top border of the range.

Description

The RandBetween method returns a random number within the range between two set values.

Comments

Values of input parameters cannot be empty.

To get evenly distributed random real number in the range [0; 1), use the IMath.Rand method.

Example

To execute the example, add a link to the MathFin system assembly.

Sub UserProc;
Var
    r: Double;
Begin
    r := Math.RandBetween(0,100);
    Debug.WriteLine(r);
End Sub UserProc;

After executing the example the console window displays a random number.

See also:

IMath