Browse docsmath.random
On this page
API method

math.random

Returns a uniformly distributed real number between the two bounds after ordering them from low to high.

Syntax

Atlas Script
math.random(min, max)

Parameters

min
Lower bound for the calculation or generated value.
max
Upper bound for the calculation or generated value.

Return value

Returns a uniformly distributed real number between the two bounds after ordering them from low to high.

Remarks

Returns a uniformly distributed real number between the two bounds after ordering them from low to high. Do not rely on the upper endpoint being included.

Examples

Usage pattern
// Replace min, max with values described above.
math.random(min, max);
Reference details are generated from the Atlas Script schema in this documentation source snapshot. Confirm release-specific behavior in the Atlas for Windows build you use.