aboutsummaryrefslogtreecommitdiff
path: root/manual
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2018-12-11 11:34:47 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2018-12-11 11:34:47 -0200
commit51316f9df7aacb54633a3e9b910a070590ac6259 (patch)
tree954c50a7b11ace095e8a2ca70e31832230e902cb /manual
parent46beca5bed8a7700b18100fe48a78373be5055f9 (diff)
downloadlua-51316f9df7aacb54633a3e9b910a070590ac6259.tar.gz
lua-51316f9df7aacb54633a3e9b910a070590ac6259.tar.bz2
lua-51316f9df7aacb54633a3e9b910a070590ac6259.zip
'math.rand()' uses higher bits to produce float value
The call 'math.rand()' converts the higher bits of the internal unsigned integer random to a float, instead of its lower bits. That ensures that Lua compiled with different float precisions always generates equal (up to the available precision) random numbers when given the same seed.
Diffstat (limited to 'manual')
0 files changed, 0 insertions, 0 deletions