diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-03-13 14:47:48 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-03-13 14:47:48 -0300 |
commit | 9eca305e75010e30342486a4139846faf1b3eccb (patch) | |
tree | db2df6774e7c4eb63d2310772507c47e32223cdd /testes | |
parent | c5feac2b5edf86aa9bdc4b8acd5380f2fe9e197f (diff) | |
download | lua-9eca305e75010e30342486a4139846faf1b3eccb.tar.gz lua-9eca305e75010e30342486a4139846faf1b3eccb.tar.bz2 lua-9eca305e75010e30342486a4139846faf1b3eccb.zip |
'math.randomseed()' sets a somewhat random seed
When called with no arguments, 'math.randomseed' uses time and ASLR
to generate a somewhat random seed. the initial seed when Lua starts
is generated this way.
Diffstat (limited to 'testes')
-rw-r--r-- | testes/math.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/testes/math.lua b/testes/math.lua index dc5b84f6..b010ff6c 100644 --- a/testes/math.lua +++ b/testes/math.lua | |||
@@ -838,7 +838,7 @@ do | |||
838 | assert(rand * 2^floatbits == res) | 838 | assert(rand * 2^floatbits == res) |
839 | end | 839 | end |
840 | 840 | ||
841 | math.randomseed(0, os.time()) | 841 | math.randomseed() |
842 | 842 | ||
843 | do -- test random for floats | 843 | do -- test random for floats |
844 | local randbits = math.min(floatbits, 64) -- at most 64 random bits | 844 | local randbits = math.min(floatbits, 64) -- at most 64 random bits |