summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/supp-ran.lua
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/base/supp-ran.lua')
-rw-r--r--Master/texmf-dist/tex/context/base/supp-ran.lua9
1 files changed, 8 insertions, 1 deletions
diff --git a/Master/texmf-dist/tex/context/base/supp-ran.lua b/Master/texmf-dist/tex/context/base/supp-ran.lua
index fe635fc7f9e..accd5c94c15 100644
--- a/Master/texmf-dist/tex/context/base/supp-ran.lua
+++ b/Master/texmf-dist/tex/context/base/supp-ran.lua
@@ -9,18 +9,25 @@ if not modules then modules = { } end modules ['supp-ran'] = {
-- We cannot ask for the current seed, so we need some messy hack
-- here.
+local report_system = logs.reporter("system","randomizer")
+
commands = commands or { }
+local commands = commands
+local math = math
local random, randomseed, round, seed, last = math.random, math.randomseed, math.round, false, 1
local texwrite = tex.write
function math.setrandomseedi(n,comment)
+ if not n then
+--~ n = 0.5 -- hack
+ end
if n <= 1 then
n = n*1073741823 -- maxcount
end
n = round(n)
if false then
- logs.report("system","setting random seed to %s (%s)",n,comment or "normal")
+ report_system("setting seed to %s (%s)",n,comment or "normal")
end
randomseed(n)
last = random(0,1073741823) -- we need an initial value