WoW:API random: Difference between revisions

m
m (Robot: converting/fixing HTML)
Line 52: Line 52:


The other ranges of the functions are inclusive, and will always return integers.
The other ranges of the functions are inclusive, and will always return integers.
It should be noted that the reason math.random does not allow 1.0 to be returned has to do with code they implemented to avoid issues on SunOS systems. However, they "correct" this issue by using modulus division. This has a side-effect for all non-SunOS systems making 0.0 twice as likely to occur than any other randomly generated number. In other words, when it would normally roll a 1.0, Lua changes that to 0.0 - so both 0.0 and 1.0 return as 0.0.


{{LUA}}
{{LUA}}
Anonymous user