commit | 51316f9df7aacb54633a3e9b910a070590ac6259 | [log] [tgz] |
---|---|---|
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | Tue Dec 11 11:34:47 2018 -0200 |
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | Tue Dec 11 11:34:47 2018 -0200 |
tree | 954c50a7b11ace095e8a2ca70e31832230e902cb | |
parent | 46beca5bed8a7700b18100fe48a78373be5055f9 [diff] |
'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.