Desyncs! The random number generator is a global, shared resource. Do not change its state in local blocks asynchronously.
Undefined behavior when lowBound > highBound. Test code:
-- Set seed to zero and then generate and print a random real
function testRReal(low, high) SetRandomSeed(0); return string.format("%.16f", GetRandomReal(low,high)) end
testRReal(-42, 42) == "-4.0800933837890625"
testRReal(42, -42) == "79.9199066162109375"
See: GetRandomInt
, SetRandomSeed
.
Generated using TypeDoc
Returns a real in range [lowBound, highBound) that is: inclusive, exclusive. Bounds may be negative, but must be lowBound <= highBound. When lowBound==highBound, always returns that number.
Example (Lua):