RandomGenerator:random

Returns the next uniformly distributed pseudo-random number from the RandomGenerator's sequence.

Generate a pseudo-random floating point number in the range [0,1)

x = RandomGenerator:random()

Arguments

None

Returns

NameTypeDescription
xnumberA pseudo-random number.

Generate a pseudo-random integer in the range [1,high]

x = RandomGenerator:random(high)

Arguments

NameTypeDescription
highnumberThe maximum number to generate.

Returns

NameTypeDescription
xnumberA pseudo-random number.

Generate a pseudo-random integer in the range [low,high]

x = RandomGenerator:random(low, high)

Arguments

NameTypeDescription
lownumberThe minimum number to generate.
highnumberThe maximum number to generate.

Returns

NameTypeDescription
xnumberA pseudo-random number.

See also