[latex3-commits] [git/LaTeX3-latex3-latex3] master: Clarify that we have an interface to set/get random seed [ci skip] (3bfea2d)

Bruno Le Floch bruno at le-floch.fr
Sun Apr 29 17:52:40 CEST 2018


Repository : https://github.com/latex3/latex3
On branch  : master
Link       : https://github.com/latex3/latex3/commit/3bfea2da1e66ed1a71076b436bedc2b96499382c

>---------------------------------------------------------------

commit 3bfea2da1e66ed1a71076b436bedc2b96499382c
Author: Bruno Le Floch <bruno at le-floch.fr>
Date:   Sun Apr 29 11:52:40 2018 -0400

    Clarify that we have an interface to set/get random seed [ci skip]


>---------------------------------------------------------------

3bfea2da1e66ed1a71076b436bedc2b96499382c
 l3kernel/l3candidates.dtx |   17 +++++++++++------
 l3kernel/l3fp.dtx         |   20 +++++++-------------
 l3kernel/l3int.dtx        |    2 +-
 3 files changed, 19 insertions(+), 20 deletions(-)

diff --git a/l3kernel/l3candidates.dtx b/l3kernel/l3candidates.dtx
index a6278e1..d42c750 100644
--- a/l3kernel/l3candidates.dtx
+++ b/l3kernel/l3candidates.dtx
@@ -700,13 +700,18 @@
 %   \begin{syntax}
 %     \cs{sys_gset_rand_seed:n} \Arg{intexpr}
 %   \end{syntax}
-%   Globally sets the seed for the engine's pseudo-random number generator
-%   to the \meta{integer expression}.  This random
-%   seed affects all \cs[no-index]{\ldots{}_rand} functions (such as
+%   Globally sets the seed for the engine's pseudo-random number
+%   generator to the \meta{integer expression}.  This random seed
+%   affects all \cs[no-index]{\ldots{}_rand} functions (such as
 %   \cs{int_rand:nn} or \cs{clist_rand_item:n}) as well as other
-%   packages relying on the engine's random number generator.  Currently
-%   only the absolute value of the seed is used.  In engines without
-%   random number support this produces an error.
+%   packages relying on the engine's random number generator.  In
+%   engines without random number support this produces an error.
+%   \begin{texnote}
+%     While a $32$-bit (signed) integer can be given as a seed, only the
+%     absolute value is used and any number beyond $2^{28}$ is divided
+%     by an appropriate power of~$2$.  We recommend using an integer in
+%     $[0,2^{28}-1]$.
+%   \end{texnote}
 % \end{function}
 %
 % \begin{variable}[added = 2017-05-27]{\c_sys_shell_escape_int}
diff --git a/l3kernel/l3fp.dtx b/l3kernel/l3fp.dtx
index 65ff4ce..ac58162 100644
--- a/l3kernel/l3fp.dtx
+++ b/l3kernel/l3fp.dtx
@@ -1259,26 +1259,20 @@
 %   \end{syntax}
 %   Produces a pseudo-random floating-point number (multiple of
 %   $10^{-16}$) between $0$~included and $1$~excluded.  This is not yet
-%   available in \XeTeX{}.
+%   available in \XeTeX{}.  The random seed can be queried using
+%   \cs{sys_rand_seed:} and set using \cs{sys_gset_rand_seed:n}.
 %   \begin{texnote}
 %     This is based on pseudo-random numbers provided by the engine's
-%     primitive \tn{pdfuniformdeviate} in \pdfTeX{} and
-%     \tn{uniformdeviate} in \LuaTeX{}.  The underlying code in
-%     \pdfTeX{} and \LuaTeX{} is based on Metapost, which follows an
-%     additive scheme recommended in Section 3.6 of \enquote{The Art of
-%     Computer Programming, Volume~2}.
+%     primitive \tn{pdfuniformdeviate} in \pdfTeX{}, \pTeX{}, \upTeX{}
+%     and \tn{uniformdeviate} in \LuaTeX{}.  The underlying code is
+%     based on Metapost, which follows an additive scheme recommended in
+%     Section 3.6 of \enquote{The Art of Computer Programming,
+%     Volume~2}.
 %
 %     While we are more careful than \tn{uniformdeviate} to preserve
 %     uniformity of the underlying stream of $28$-bit pseudo-random
 %     integers, these pseudo-random numbers should of course not be
 %     relied upon for serious numerical computations nor cryptography.
-%
-%     The random seed can be queried using \tn{pdfrandomseed} and set
-%     using \tn{pdfsetrandomseed} (in \LuaTeX{} \tn{randomseed} and
-%     \tn{setrandomseed}).  While a $32$-bit (signed) integer can be
-%     given as a seed, only the absolute value is used and any number
-%     beyond $2^{28}$ is divided by an appropriate power of~$2$.  We
-%     recommend using an integer in $[0,2^{28}-1]$.
 %   \end{texnote}
 % \end{function}
 %
diff --git a/l3kernel/l3int.dtx b/l3kernel/l3int.dtx
index 5a5e37f..8cb5fde 100644
--- a/l3kernel/l3int.dtx
+++ b/l3kernel/l3int.dtx
@@ -786,7 +786,7 @@
 %
 % \section{Random integers}
 %
-% \begin{function}[EXP, added = 2016-12-06]{\int_rand:nn}
+% \begin{function}[EXP, added = 2016-12-06, updated = 2018-04-27]{\int_rand:nn}
 %   \begin{syntax}
 %     \cs{int_rand:nn} \Arg{intexpr_1} \Arg{intexpr_2}
 %   \end{syntax}





More information about the latex3-commits mailing list