summaryrefslogtreecommitdiff
path: root/tex/context/base/supp-ran.lua
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2011-02-08 12:00:13 +0200
committerMarius <mariausol@gmail.com>2011-02-08 12:00:13 +0200
commit9c6992a3436a0db6a01790b29d7c0c3c65460f94 (patch)
treec384372b23cfb6a5379641b4857bae07057bb3be /tex/context/base/supp-ran.lua
parent801c806a2489c5c96578fe95945bef589329c4e0 (diff)
downloadcontext-9c6992a3436a0db6a01790b29d7c0c3c65460f94.tar.gz
beta 2011.02.08 10:06
Diffstat (limited to 'tex/context/base/supp-ran.lua')
-rw-r--r--tex/context/base/supp-ran.lua7
1 files changed, 5 insertions, 2 deletions
diff --git a/tex/context/base/supp-ran.lua b/tex/context/base/supp-ran.lua
index 5263208eb..0be9f66fd 100644
--- a/tex/context/base/supp-ran.lua
+++ b/tex/context/base/supp-ran.lua
@@ -9,7 +9,7 @@ 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.new("system")
+local report_system = logs.new("system","randomizer")
commands = commands or { }
local commands = commands
@@ -19,12 +19,15 @@ local random, randomseed, round, seed, last = math.random, math.randomseed, math
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
- 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