Descrition
Returns a random floating point number between zero (or the defined minimum) and one (or the defined maximum).
Syntax
Number.f = RandomFloat( [Maximum.f [, Minimum.f]] )
Parameters
Maximum | The maximum random number. (optional and by default 1.0 ) |
Minimum | The minimum random number. (optional and by default 0.0 ) |
Return value
A random floating point number.
Snippet
Procedure.f RandomFloat(Maximum.f = 1.0, Minimum.f=0.0)
ProcedureReturn (Maximum-Minimum) * 4.6566128752457969241e-10 * Random(2147483647) + Minimum
EndProcedure
Example
RandomSeed(5)
Debug RandomFloat()
Debug RandomFloat(100.0)
Debug RandomFloat(1, -1)
0.33462896943092
64.48874664306641
-0.20487998425961