klyn.math.Random.randRange
method
public static randRange(min as FLOAT_TYPE, max as FLOAT_TYPE) as FLOAT_TYPE:
Description

Returns a random value in [min, max).

Parameters
ParameterDescription
minLower bound.
maxUpper bound.
Returns

A random value greater than or equal to min and strictly lower than max, or min when both bounds are equal.

Throws
  • ValueException if max is lower than min.
Example
speed = Random.randRange(0.5, 2.0)
assert 0.5 <= speed < 2.0
print(speed)