[Dev-luatex] randomseed under various platforms

Paweł Jackowski P.Jackowski at gust.org.pl
Sat Jan 30 09:10:29 CET 2010


Folks,

there is a weird thing in windows version of luatex (details here:
http://tracker.luatex.org/view.php?id=323), not observed in normal lua
binary. The following program gives always the same sequence of random
numbers, no matter what seed is used. Not observed on linux. Could
one check how it behaves on mac or bsd?


local rand = math.random
local seed = math.randomseed

--seed(1)
--seed(14)
--seed(1414)
--seed(141421)
seed(314159)

co = coroutine.wrap(function()
     -- If you call seed here, everything is fine
     -- If you run this loop with no coroutine, everything is fine
     for i=1, 10 do print(rand()) end
end)
co()


Thanks, Paweł
-- 
Pawe/l Jackowski
P.Jackowski at gust.org.pl



More information about the dev-luatex mailing list