aboutsummaryrefslogtreecommitdiff
path: root/testes
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-03-13 14:47:48 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-03-13 14:47:48 -0300
commit9eca305e75010e30342486a4139846faf1b3eccb (patch)
treedb2df6774e7c4eb63d2310772507c47e32223cdd /testes
parentc5feac2b5edf86aa9bdc4b8acd5380f2fe9e197f (diff)
downloadlua-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.lua2
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)
839end 839end
840 840
841math.randomseed(0, os.time()) 841math.randomseed()
842 842
843do -- test random for floats 843do -- 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