Menu

#469 [random] can be seeded with 0

TeX Live 2019
closed-fixed
None
5
2019-01-22
2017-09-11
No

By default, \pgfmath@rnd@z is seeded with the product of \time and \year. In environments where for reasons of reproducible builds, \time is set to 0, this results in the LCG being very not random.
(This also happens every midnight naturally!)

Proposed fix: detect if the seed is zero, and set it to some other value then.

Example:

\documentclass{minimal}
\usepackage{tikz}
\begin{document}
\foreach \x in {1,...,100}{
\pgfmathparse{int(rand * 11)}
\pgfmathresult, }
\end{document}

faketime 00:00 pdflatex foo
-> foo.pdf contains a lot of -11

Discussion

  • Henri Menke

    Henri Menke - 2019-01-22
    • assigned_to: Henri Menke
    • Group: v1.0 (example) --> TeX Live 2019
     
  • Henri Menke

    Henri Menke - 2019-01-22
    • status: open --> closed-fixed
     
MongoDB Logo MongoDB