diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2018-12-11 11:34:47 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2018-12-11 11:34:47 -0200 |
commit | 51316f9df7aacb54633a3e9b910a070590ac6259 (patch) | |
tree | 954c50a7b11ace095e8a2ca70e31832230e902cb /lapi.h | |
parent | 46beca5bed8a7700b18100fe48a78373be5055f9 (diff) | |
download | lua-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 'lapi.h')
0 files changed, 0 insertions, 0 deletions