MathLib.random function

MathLib.random returns a pseudorandom value between 0.0 and 1.0, inclusive. The repeated invocation of the function gives an approximately uniform distribution of numbers in that range.

Package

eglx.lang

Syntax
static function random() returns (float);
Example use

After the following code runs, the value of result is a floating point number:

result Float = MathLib.random();
Comments

In the case of Java™, EGL uses methods in the Java StrictMath class that are equivalent to the EGL functions. This usage ensures that the runtime behavior is the same for every Java Virtual Machine.

Compatibility

Table 1. Compatibility
Target Issue
Java No issues.
JavaScript No issues.