IMath.Rand

Fore Syntax

Rand: Double;

Fore.NET Syntax

Rand(): double;

Description

The Rand method returns a random uniformly distributed real number within the range [0; 1).

Comments

To get the random number within the range between two set values, use the IMath.RandBetween method.

Fore Example

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

Sub UserProc;
Var
    r: Double;
Begin
    r := Math.Rand;
    Debug.WriteLine(r);
End Sub UserProc;

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

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example.

Imports Prognoz.Platform.Interop.MathFin;

Public Shared Sub Main(Params: StartParams);
Var
    r: Double;
    Math: MathClass = New MathClass();
Begin
    r := Math.Rand();
    System.Diagnostics.Debug.WriteLine(r);
End Sub;

See also:

IMath