On Sun, Nov 13, 2016 at 5:32 PM, David Carlisle <[email protected]> wrote: > This document with pdftex > > > \ifx\directlua\undefined\else > \let\pdfrandomseed\randomseed > \let\pdfsetrandomseed\setrandomseed > \let\pdfnormaldeviate\normaldeviate > \let\pdfuniformdeviate\uniformdeviate > \fi > > \pdfsetrandomseed 999 > > \immediate\write20{A: \pdfnormaldeviate} > \immediate\write20{B: \pdfnormaldeviate} > \immediate\write20{C: \pdfuniformdeviate 100} > \immediate\write20{D: \pdfuniformdeviate 100} > > \bye > > produces terminal output of > > A: -65925 > B: 114111 > C: 5 > D: 74 > > > I'd have expected from the luatex manual that luatex would be the same > but it gives > > This is LuaTeX, Version 1.0.1 (TeX Live 2017/dev) > restricted system commands enabled. > (./rnd.tex > ! Missing number, treated as zero. > > > You get the expected output from > > \immediate\write20{A: \pdfnormaldeviate 0} > \immediate\write20{B: \pdfnormaldeviate 0} > > but then of course pdftex gives > > A: -659250 > B: 1141110 > > > It appears that any number will work and \normaldeviate just gobbles a > following <number> without using it. > > Would it be possible to have a pdftex compatible behaviour here, or if > the number is doing something, document in the manual what it does. > > Thanks, > > David
It looks like a bug, probably an oversight because the source code is similar to the uniformdeviate case which is just before and needs to scan an int. I will fix it later this evening or tomorrow in experimental. -- luigi
