diff options
author | Karl Berry <karl@freefriends.org> | 2018-05-19 23:28:16 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2018-05-19 23:28:16 +0000 |
commit | 191a9434e66d18ae2ca926de04deeef76a693f17 (patch) | |
tree | 17aa6c5603fcb8f65fab4d8c3cc41c8f3d1fc4b9 /Master/texmf-dist/tex/generic/xint | |
parent | d5975620549112823d69c164a8e1d06cb83398c2 (diff) |
xint (19may18)
git-svn-id: svn://tug.org/texlive/trunk@47772 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/xint')
-rw-r--r-- | Master/texmf-dist/tex/generic/xint/xint.sty | 151 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/xint/xintbinhex.sty | 4 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/xint/xintcfrac.sty | 4 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/xint/xintcore.sty | 8 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/xint/xintexpr.sty | 69 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/xint/xintfrac.sty | 33 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/xint/xintgcd.sty | 4 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/xint/xintkernel.sty | 64 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/xint/xintseries.sty | 4 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/xint/xinttools.sty | 9 |
10 files changed, 315 insertions, 35 deletions
diff --git a/Master/texmf-dist/tex/generic/xint/xint.sty b/Master/texmf-dist/tex/generic/xint/xint.sty index 80548342812..428de889050 100644 --- a/Master/texmf-dist/tex/generic/xint/xint.sty +++ b/Master/texmf-dist/tex/generic/xint/xint.sty @@ -21,7 +21,7 @@ %% same distribution. (The sources need not necessarily be %% in the same archive or directory.) %% --------------------------------------------------------------- -%% The xint bundle 1.3a 2018/03/07 +%% The xint bundle 1.3b 2018/05/18 %% Copyright (C) 2013-2018 by Jean-Francois Burnol %% xint: Expandable operations on big integers %% --------------------------------------------------------------- @@ -70,13 +70,19 @@ \XINTsetupcatcodes% defined in xintkernel.sty (loaded by xintcore.sty) \XINT_providespackage \ProvidesPackage{xint}% - [2018/03/07 1.3a Expandable operations on big integers (JFB)]% + [2018/05/18 1.3b Expandable operations on big integers (JFB)]% \long\def\xint_firstofthree #1#2#3{#1}% \long\def\xint_secondofthree #1#2#3{#2}% \long\def\xint_thirdofthree #1#2#3{#3}% \long\def\xint_firstofthree_thenstop #1#2#3{ #1}% 1.09i \long\def\xint_secondofthree_thenstop #1#2#3{ #2}% \long\def\xint_thirdofthree_thenstop #1#2#3{ #3}% +\ifdefined\xint_texuniformdeviate + \unless\ifdefined\xint_c_nine_x^viii + \csname newcount\endcsname\xint_c_nine_x^viii + \xint_c_nine_x^viii 900000000 + \fi +\fi \def\xintiLen {\romannumeral0\xintilen }% \def\xintilen #1{\def\xintilen ##1% {% @@ -1372,6 +1378,147 @@ \def\xintBool #1{\romannumeral`&&@% \csname if#1\endcsname\expandafter1\else\expandafter0\fi }% \def\xintToggle #1{\romannumeral`&&@\iftoggle{#1}{1}{0}}% +\def\xintRandomDigits{\romannumeral0\xintrandomdigits}% +\def\xintrandomdigits#1% +{% + \csname xint_gob_andstop_\expandafter\XINT_randomdigits\the\numexpr#1\xint: +}% +\def\XINT_randomdigits#1\xint: +{% + \expandafter\XINT_randomdigits_a + \the\numexpr(#1+\xint_c_iii)/\xint_c_viii\xint:#1\xint: +}% +\def\XINT_randomdigits_a#1\xint:#2\xint: +{% + \romannumeral\numexpr\xint_c_viii*#1-#2\csname XINT_% + \romannumeral\XINT_replicate #1\endcsname \csname + XINT_rdg\endcsname +}% +\def\XINT_rdg +{% + \expandafter\XINT_rdg_aux\the\numexpr% + \xint_c_nine_x^viii% + -\xint_texuniformdeviate\xint_c_ii^vii% + -\xint_c_ii^vii*\xint_texuniformdeviate\xint_c_ii^vii% + -\xint_c_ii^xiv*\xint_texuniformdeviate\xint_c_ii^vii% + -\xint_c_ii^xxi*\xint_texuniformdeviate\xint_c_ii^vii% + +\xint_texuniformdeviate\xint_c_x^viii% + \relax% +}% +\def\XINT_rdg_aux#1{XINT_rdg\endcsname}% +\let\XINT_XINT_rdg\endcsname +\def\XINT_eightrandomdigits +{% + \expandafter\xint_gobble_i\the\numexpr% + \xint_c_nine_x^viii% + -\xint_texuniformdeviate\xint_c_ii^vii% + -\xint_c_ii^vii*\xint_texuniformdeviate\xint_c_ii^vii% + -\xint_c_ii^xiv*\xint_texuniformdeviate\xint_c_ii^vii% + -\xint_c_ii^xxi*\xint_texuniformdeviate\xint_c_ii^vii% + +\xint_texuniformdeviate\xint_c_x^viii% + \relax% +}% +\def\xintXRandomDigits#1% +{% + \csname xint_gobble_\expandafter\XINT_xrandomdigits\the\numexpr#1\xint: +}% +\def\XINT_xrandomdigits#1\xint: +{% + \expandafter\XINT_xrandomdigits_a + \the\numexpr(#1+\xint_c_iii)/\xint_c_viii\xint:#1\xint: +}% +\def\XINT_xrandomdigits_a#1\xint:#2\xint: +{% + \romannumeral\numexpr\xint_c_viii*#1-#2\expandafter\endcsname + \romannumeral`&&@\romannumeral + \XINT_replicate #1\endcsname\XINT_eightrandomdigits +}% +\def\xintiiRandRangeAtoB{\romannumeral`&&@\xintiirandrangeAtoB}% +\def\xintiirandrangeAtoB#1% +{% + \expandafter\XINT_randrangeAtoB_a\romannumeral`&&@#1\xint: +}% +\def\XINT_randrangeAtoB_a#1\xint:#2% +{% + \xintiiadd{\expandafter\XINT_randrange + \romannumeral0\xintiisub{#2}{#1}\xint:}% + {#1}% +}% +\def\xintiiRandRange{\romannumeral`&&@\xintiirandrange}% +\def\xintiirandrange#1% +{% + \expandafter\XINT_randrange\romannumeral`&&@#1\xint: +}% +\def\XINT_randrange #1% +{% + \xint_UDzerominusfork + #1-\XINT_randrange_err:empty + 0#1\XINT_randrange_err:empty + 0-\XINT_randrange_a + \krof #1% +}% +\def\XINT_randrange_err:empty#1\xint: +{% + \XINT_expandableerror{Empty range for randrange.} 0% +}% +\def\XINT_randrange_a #1\xint: +{% + \expandafter\XINT_randrange_b\romannumeral0\xintlength{#1}.#1\xint: +}% +\def\XINT_randrange_b #1.% +{% + \ifnum#1<\xint_c_x\xint_dothis{\the\numexpr\XINT_uniformdeviate{}}\fi + \xint_orthat{\XINT_randrange_c #1.}% +}% +\def\XINT_randrange_c #1.#2#3#4#5#6#7#8#9% +{% + \expandafter\XINT_randrange_d + \the\numexpr\expandafter\XINT_uniformdeviate\expandafter + {\expandafter}\the\numexpr\xint_c_i+#2#3#4#5#6#7#8#9\xint:\xint: + #2#3#4#5#6#7#8#9\xint:#1\xint: +}% +\def\XINT_randrange_d #1\xint:#2\xint: +{% + \ifnum#1=\xint_c_\xint_dothis\XINT_randrange_Z\fi + \ifnum#1=#2 \xint_dothis\XINT_randrange_A\fi + \xint_orthat\XINT_randrange_e #1\xint: +}% +\def\XINT_randrange_e #1\xint:#2\xint:#3\xint: +{% + \the\numexpr#1\expandafter\relax + \romannumeral0\xintrandomdigits{#2-\xint_c_viii}% +}% +\def\XINT_randrange_Z 0\xint:#1\xint:#2\xint: +{% + \xintinum{\xintRandomDigits{#1-\xint_c_viii}}% +}% +\def\XINT_randrange_A #1\xint:#2\xint:#3\xint: +{% + \expandafter\XINT_randrange_B + \romannumeral0\xintrandomdigits{#2-\xint_c_viii}\xint: + #3\xint:#2.#1\xint: +}% +\def\XINT_randrange_B #1\xint:#2\xint:#3.#4\xint: +{% + \xintiiifLt{#1}{#2}{\XINT_randrange_E}{\XINT_randrange_again}% + #4#1\xint:#3.#4#2\xint: +}% +\def\XINT_randrange_E #1\xint:#2\xint:{ #1}% +\def\XINT_randrange_again #1\xint:{\XINT_randrange_c}% +\ifdefined\xint_texuniformdeviate +\else + \def\xintrandomdigits#1% + {% + \XINT_expandableerror + {No uniformdeviate at engine level, returning 0.} 0% + }% + \let\xintXRandomDigits\xintRandomDigits + \def\XINT_randrange#1\xint: + {% + \XINT_expandableerror + {No uniformdeviate at engine level, returning 0.} 0% + }% +\fi \XINT_restorecatcodes_endinput% \endinput %% diff --git a/Master/texmf-dist/tex/generic/xint/xintbinhex.sty b/Master/texmf-dist/tex/generic/xint/xintbinhex.sty index 78c9566ce06..c03355c16be 100644 --- a/Master/texmf-dist/tex/generic/xint/xintbinhex.sty +++ b/Master/texmf-dist/tex/generic/xint/xintbinhex.sty @@ -21,7 +21,7 @@ %% same distribution. (The sources need not necessarily be %% in the same archive or directory.) %% --------------------------------------------------------------- -%% The xint bundle 1.3a 2018/03/07 +%% The xint bundle 1.3b 2018/05/18 %% Copyright (C) 2013-2018 by Jean-Francois Burnol %% xintbinhex: Expandable binary and hexadecimal conversions %% --------------------------------------------------------------- @@ -70,7 +70,7 @@ \XINTsetupcatcodes% defined in xintkernel.sty \XINT_providespackage \ProvidesPackage{xintbinhex}% - [2018/03/07 1.3a Expandable binary and hexadecimal conversions (JFB)]% + [2018/05/18 1.3b Expandable binary and hexadecimal conversions (JFB)]% \newcount\xint_c_ii^xv \xint_c_ii^xv 32768 \newcount\xint_c_ii^xvi \xint_c_ii^xvi 65536 \def\XINT_tmpa #1{\ifx\relax#1\else diff --git a/Master/texmf-dist/tex/generic/xint/xintcfrac.sty b/Master/texmf-dist/tex/generic/xint/xintcfrac.sty index e402cc59e6a..881239a5e4f 100644 --- a/Master/texmf-dist/tex/generic/xint/xintcfrac.sty +++ b/Master/texmf-dist/tex/generic/xint/xintcfrac.sty @@ -21,7 +21,7 @@ %% same distribution. (The sources need not necessarily be %% in the same archive or directory.) %% --------------------------------------------------------------- -%% The xint bundle 1.3a 2018/03/07 +%% The xint bundle 1.3b 2018/05/18 %% Copyright (C) 2013-2018 by Jean-Francois Burnol %% xintcfrac: Expandable continued fractions with xint package %% --------------------------------------------------------------- @@ -70,7 +70,7 @@ \XINTsetupcatcodes% defined in xintkernel.sty \XINT_providespackage \ProvidesPackage{xintcfrac}% - [2018/03/07 1.3a Expandable continued fractions with xint package (JFB)]% + [2018/05/18 1.3b Expandable continued fractions with xint package (JFB)]% \def\xintCFrac {\romannumeral0\xintcfrac }% \def\xintcfrac #1% {% diff --git a/Master/texmf-dist/tex/generic/xint/xintcore.sty b/Master/texmf-dist/tex/generic/xint/xintcore.sty index e33963a9c30..ff4fdfed9ef 100644 --- a/Master/texmf-dist/tex/generic/xint/xintcore.sty +++ b/Master/texmf-dist/tex/generic/xint/xintcore.sty @@ -21,7 +21,7 @@ %% same distribution. (The sources need not necessarily be %% in the same archive or directory.) %% --------------------------------------------------------------- -%% The xint bundle 1.3a 2018/03/07 +%% The xint bundle 1.3b 2018/05/18 %% Copyright (C) 2013-2018 by Jean-Francois Burnol %% xintcore: Expandable arithmetic on big integers %% --------------------------------------------------------------- @@ -70,7 +70,7 @@ \XINTsetupcatcodes% defined in xintkernel.sty \XINT_providespackage \ProvidesPackage{xintcore}% - [2018/03/07 1.3a Expandable arithmetic on big integers (JFB)]% + [2018/05/18 1.3b Expandable arithmetic on big integers (JFB)]% \csname XINT_Clamped_istrapped\endcsname \csname XINT_ConversionSyntax_istrapped\endcsname \csname XINT_DivisionByZero_istrapped\endcsname @@ -141,7 +141,9 @@ \catcode`. 12 \ifdefined\m@ne\let\xint_c_mone\m@ne \else\csname newcount\endcsname\xint_c_mone \xint_c_mone -1 \fi -\newcount\xint_c_x^viii \xint_c_x^viii 100000000 +\ifdefined\xint_c_x^viii\else +\csname newcount\endcsname\xint_c_x^viii \xint_c_x^viii 100000000 +\fi \ifdefined\xint_c_x^ix\else \csname newcount\endcsname\xint_c_x^ix \xint_c_x^ix 1000000000 \fi diff --git a/Master/texmf-dist/tex/generic/xint/xintexpr.sty b/Master/texmf-dist/tex/generic/xint/xintexpr.sty index 68fa92e62d3..05a7bad4a86 100644 --- a/Master/texmf-dist/tex/generic/xint/xintexpr.sty +++ b/Master/texmf-dist/tex/generic/xint/xintexpr.sty @@ -21,7 +21,7 @@ %% same distribution. (The sources need not necessarily be %% in the same archive or directory.) %% --------------------------------------------------------------- -%% The xint bundle 1.3a 2018/03/07 +%% The xint bundle 1.3b 2018/05/18 %% Copyright (C) 2013-2018 by Jean-Francois Burnol %% xintexpr: Expandable expression parser %% --------------------------------------------------------------- @@ -81,7 +81,7 @@ \XINTsetupcatcodes% \XINT_providespackage \ProvidesPackage{xintexpr}% - [2018/03/07 1.3a Expandable expression parser (JFB)]% + [2018/05/18 1.3b Expandable expression parser (JFB)]% \catcode`! 11 \let\XINT_Cmp \xintiiCmp \def\xint_gob_til_! #1!{}% ! with catcode 11 @@ -305,12 +305,14 @@ \def\XINT_expr_scan_macropar #1#2{\expandafter\XINT_expr_getop\csname .=#1#2\endcsname }% \catcode96 11 % ` \def\XINT_expr_scan_nbr_or_func #1% this #1 has necessarily here catcode 12 -{% +{%( + \if )#1\xint_dothis \XINT_expr_gotnil \fi \if "#1\xint_dothis \XINT_expr_scanhex_I\fi \if `#1\xint_dothis {\XINT_expr_onliteral_`}\fi \ifnum \xint_c_ix<1#1 \xint_dothis \XINT_expr_startint\fi \xint_orthat \XINT_expr_scanfunc #1% }% +\def\XINT_expr_gotnil{\expandafter\XINT_expr_getop\csname.= \endcsname}% \def\XINT_expr_onliteral_` #1#2#3({\xint_c_xviii `{#2}}% \catcode96 12 % ` \def\XINT_expr_startint #1% @@ -1435,6 +1437,10 @@ {\expandafter\XINT_expr_getop\csname .=\xintRaw{#1}\endcsname }% \def\XINT_expr_onliteral_qfloat #1)% {\expandafter\XINT_expr_getop\csname .=\XINTinFloatdigits{#1}\endcsname }% +\def\XINT_expr_onliteral_random #1)% + {\expandafter\XINT_expr_getop\csname .=\XINTinRandomFloatSdigits\endcsname }% +\def\XINT_expr_onliteral_qrand #1)% + {\expandafter\XINT_expr_getop\csname .=\XINTinRandomFloatSixteen\endcsname }% \def\XINT_expr_op__ #1% op__ with two _'s {% \ifcsname XINT_expr_var_#1\endcsname @@ -2054,13 +2060,13 @@ \expandafter\xint_secondoftwo\fi {#4}{#5[\xintNum{#2}]}{#1}% }% -\def\XINT:expr:one:or:two #1,#2,#3!#4#5% +\def\XINT:expr:tacitzeroifonearg #1,#2,#3!#4#5% {% \if\relax#3\relax\expandafter\xint_firstoftwo\else \expandafter\xint_secondoftwo\fi {#4{0}}{#5{\xintNum{#2}}}{#1}% }% -\def\XINT:iiexpr:one:or:two #1,#2,#3!#4% +\def\XINT:iiexpr:tacitzeroifonearg #1,#2,#3!#4% {% \if\relax#3\relax\expandafter\xint_firstoftwo\else \expandafter\xint_secondoftwo\fi @@ -2257,7 +2263,7 @@ \def\XINT_expr_func_round #1#2#3% {% \expandafter #1\expandafter #2\csname.=% - \expandafter\XINT:expr:one:or:two + \expandafter\XINT:expr:tacitzeroifonearg \romannumeral`&&@\XINT_expr_unlock #3,,!\xintiRound\xintRound \endcsname }% @@ -2265,14 +2271,14 @@ \def\XINT_iiexpr_func_round #1#2#3% {% \expandafter #1\expandafter #2\csname.=% - \expandafter\XINT:iiexpr:one:or:two + \expandafter\XINT:iiexpr:tacitzeroifonearg \romannumeral`&&@\XINT_expr_unlock #3,,!\xintiRound \endcsname }% \def\XINT_expr_func_trunc #1#2#3% {% \expandafter #1\expandafter #2\csname.=% - \expandafter\XINT:expr:one:or:two + \expandafter\XINT:expr:tacitzeroifonearg \romannumeral`&&@\XINT_expr_unlock #3,,!\xintiTrunc\xintTrunc \endcsname }% @@ -2280,7 +2286,7 @@ \def\XINT_iiexpr_func_trunc #1#2#3% {% \expandafter #1\expandafter #2\csname.=% - \expandafter\XINT:iiexpr:one:or:two + \expandafter\XINT:iiexpr:tacitzeroifonearg \romannumeral`&&@\XINT_expr_unlock #3,,!\xintiTrunc \endcsname }% @@ -2376,6 +2382,35 @@ \romannumeral`&&@\XINT_expr_unlock #3,!\xintiiPFactorial \endcsname }% +\def\XINT_expr_func_randrange #1#2#3% +{% + \expandafter #1\expandafter #2\csname.=% + \expandafter\XINT:expr:randrange + \romannumeral`&&@\XINT_expr_unlock #3,,!% + \endcsname +}% +\let\XINT_flexpr_func_randrange\XINT_expr_func_randrange +\def\XINT_iiexpr_func_randrange #1#2#3% +{% + \expandafter #1\expandafter #2\csname.=% + \expandafter\XINT:iiexpr:randrange + \romannumeral`&&@\XINT_expr_unlock #3,,!% + \endcsname +}% +\def\XINT:expr:randrange #1,#2,#3!% +{% + \if\relax#3\relax\expandafter\xint_firstoftwo\else + \expandafter\xint_secondoftwo\fi + {\xintiiRandRange{\XINT:NEhook:one\xintNum{#1}}}% + {\xintiiRandRangeAtoB{\XINT:NEhook:one\xintNum{#1}}% + {\XINT:NEhook:one\xintNum{#2}}}% +}% +\def\XINT:iiexpr:randrange #1,#2,#3!% +{% + \if\relax#3\relax\expandafter\xint_firstoftwo\else + \expandafter\xint_secondoftwo\fi + {\xintiiRandRange{#1}}{\xintiiRandRangeAtoB{#1}{#2}}% +}% \def\XINT_expr_func_quo #1#2#3% {% \expandafter #1\expandafter #2\csname.=% @@ -2859,13 +2894,13 @@ \expandafter\xint_secondoftwo\fi {\XINT:NE:one#4}{\XINT:NE:oneopt#5[\XINT:NE:one\xintNum{#2}]}{#1}% }% -\def\XINT:newexpr:one:or:two #1,#2,#3!#4#5% +\def\XINT:newexpr:tacitzeroifonearg #1,#2,#3!#4#5% {% \if\relax#3\relax\expandafter\xint_firstoftwo\else \expandafter\xint_secondoftwo\fi {\XINT:NE:two#4{0}}{\XINT:NE:two#5{\XINT:NE:one\xintNum{#2}}}{#1}% }% -\def\XINT:newiiexpr:one:or:two #1,#2,#3!#4% +\def\XINT:newiiexpr:tacitzeroifonearg #1,#2,#3!#4% {% \if\relax#3\relax\expandafter\xint_firstoftwo\else \expandafter\xint_secondoftwo\fi @@ -2943,9 +2978,11 @@ \let\XINT:NEhook:one\XINT:NE:one \let\XINT:NEhook:two\XINT:NE:two \let\XINT:NEhook:csv\XINT:NE:csv - \let\XINT:expr:one:and:opt \XINT:newexpr:one:and:opt - \let\XINT:expr:one:or:two \XINT:newexpr:one:or:two - \let\XINT:iiexpr:one:or:two \XINT:newiiexpr:one:or:two + \let\XINT:expr:one:and:opt \XINT:newexpr:one:and:opt + \let\XINT:expr:one:or:two:nums \XINT:newexpr:one:or:two:nums + \let\XINT:iiexpr:one:or:two: \XINT:newiiexpr:one:or:two: + \let\XINT:expr:tacitzeroifonearg \XINT:newexpr:tacitzeroifonearg + \let\XINT:iiexpr:tacitzeroifonearg \XINT:newiiexpr:tacitzeroifonearg \let\XINT:expr:two:to:two \XINT:newexpr:two:to:two \let\XINT:expr:two:to:one \XINT:newexpr:two:to:one \let\XINT:flexpr:two:to:one \XINT:newflexpr:two:to:one @@ -2979,6 +3016,10 @@ \def\xintListSel:x:csv {~xintListSel:f:csv }% \let\XINT:expr:userfunc \XINT:newexpr:userfunc \let\XINT:expr:macrofunc\XINT:newexpr:macrofunc + \def\XINTinRandomFloatSdigits{~XINTinRandomFloatSdigits }% + \def\XINTinRandomFloatSixteen{~XINTinRandomFloatSixteen }% + \def\xintiiRandRange{~xintiiRandRange }% + \def\xintiiRandRangeAtoB{~xintiiRandRangeAtoB }% }% \def\XINT_expr_redefineprints {% diff --git a/Master/texmf-dist/tex/generic/xint/xintfrac.sty b/Master/texmf-dist/tex/generic/xint/xintfrac.sty index 4c727e3f522..3edaf936f19 100644 --- a/Master/texmf-dist/tex/generic/xint/xintfrac.sty +++ b/Master/texmf-dist/tex/generic/xint/xintfrac.sty @@ -21,7 +21,7 @@ %% same distribution. (The sources need not necessarily be %% in the same archive or directory.) %% --------------------------------------------------------------- -%% The xint bundle 1.3a 2018/03/07 +%% The xint bundle 1.3b 2018/05/18 %% Copyright (C) 2013-2018 by Jean-Francois Burnol %% xintfrac: Expandable operations on fractions %% --------------------------------------------------------------- @@ -75,7 +75,7 @@ \XINTsetupcatcodes% defined in xintkernel.sty \XINT_providespackage \ProvidesPackage{xintfrac}% - [2018/03/07 1.3a Expandable operations on fractions (JFB)]% + [2018/05/18 1.3b Expandable operations on fractions (JFB)]% \def\XINT_cntSgnFork #1% {% \ifcase #1\expandafter\xint_secondofthree @@ -3222,6 +3222,35 @@ \ifnum#3<\xint_c_\xint_dothis\xint_secondoftwo_thenstop\fi \xint_orthat\xint_firstoftwo_thenstop }% +\def\XINTinRandomFloatS{\romannumeral0\XINTinrandomfloatS}% +\def\XINTinRandomFloatSdigits{\XINTinRandomFloatS[\XINTdigits]}% +\def\XINTinrandomfloatS[#1]% +{% + \expandafter\XINT_inrandomfloatS\the\numexpr\xint_c_-(#1)\xint: +}% +\def\XINT_inrandomfloatS-#1\xint: +{% + \expandafter\XINT_inrandomfloatS_a + \romannumeral0\xintrandomdigits{#1}[-#1]% +}% +\def\XINT_inrandomfloatS_a#1% +{% + \if#10\xint_dothis{\XINT_inrandomfloatS_b}\fi + \xint_orthat{ #1}% +}%[ +\def\XINT_inrandomfloatS_b#1% +{% + \if#1[\xint_dothis{\XINT_inrandomfloatS_zero}\fi% ] + \if#10\xint_dothis{\XINT_inrandomfloatS_b}\fi + \xint_orthat{ #1}% +}%[ +\def\XINT_inrandomfloatS_zero#1]{ 0[0]}% +\def\XINTinRandomFloatSixteen% +{% + \romannumeral0\expandafter\XINT_inrandomfloatS_a + \romannumeral`&&@\expandafter\XINT_eightrandomdigits + \romannumeral`&&@\XINT_eightrandomdigits[-16]% +}% \XINT_restorecatcodes_endinput% \endinput %% diff --git a/Master/texmf-dist/tex/generic/xint/xintgcd.sty b/Master/texmf-dist/tex/generic/xint/xintgcd.sty index 43a1c1c3ee8..8c524d1e714 100644 --- a/Master/texmf-dist/tex/generic/xint/xintgcd.sty +++ b/Master/texmf-dist/tex/generic/xint/xintgcd.sty @@ -21,7 +21,7 @@ %% same distribution. (The sources need not necessarily be %% in the same archive or directory.) %% --------------------------------------------------------------- -%% The xint bundle 1.3a 2018/03/07 +%% The xint bundle 1.3b 2018/05/18 %% Copyright (C) 2013-2018 by Jean-Francois Burnol %% xintgcd: Euclidean algorithm with xint package %% --------------------------------------------------------------- @@ -70,7 +70,7 @@ \XINTsetupcatcodes% defined in xintkernel.sty \XINT_providespackage \ProvidesPackage{xintgcd}% - [2018/03/07 1.3a Euclide algorithm with xint package (JFB)]% + [2018/05/18 1.3b Euclide algorithm with xint package (JFB)]% \def\xintGCD {\romannumeral0\xintgcd }% \def\xintgcd #1#2{\xintiigcd {\xintNum{#1}}{\xintNum{#2}}}% \def\xintiiGCD {\romannumeral0\xintiigcd }% diff --git a/Master/texmf-dist/tex/generic/xint/xintkernel.sty b/Master/texmf-dist/tex/generic/xint/xintkernel.sty index 56066d5fabe..38850e85ba2 100644 --- a/Master/texmf-dist/tex/generic/xint/xintkernel.sty +++ b/Master/texmf-dist/tex/generic/xint/xintkernel.sty @@ -21,7 +21,7 @@ %% same distribution. (The sources need not necessarily be %% in the same archive or directory.) %% --------------------------------------------------------------- -%% The xint bundle 1.3a 2018/03/07 +%% The xint bundle 1.3b 2018/05/18 %% Copyright (C) 2013-2018 by Jean-Francois Burnol %% xintkernel: Paraphernalia for the xint packages %% --------------------------------------------------------------- @@ -156,7 +156,7 @@ \fi \XINT_providespackage \ProvidesPackage {xintkernel}% - [2018/03/07 1.3a Paraphernalia for the xint packages (JFB)]% + [2018/05/18 1.3b Paraphernalia for the xint packages (JFB)]% \chardef\xint_c_ 0 \chardef\xint_c_i 1 \chardef\xint_c_ii 2 @@ -179,6 +179,15 @@ \mathchardef\xint_c_ii^viii 256 \mathchardef\xint_c_ii^xii 4096 \mathchardef\xint_c_x^iv 10000 +\ifdefined\pdfuniformdeviate \let\xint_texuniformdeviate\pdfuniformdeviate\fi +\ifdefined\uniformdeviate \let\xint_texuniformdeviate\uniformdeviate \fi +\ifx\xint_texuniformdeviate\relax\let\xint_texuniformdeviate\xint_undefined\fi +\ifdefined\xint_texuniformdeviate + \csname newcount\endcsname\xint_c_ii^xiv + \xint_c_ii^xiv 16384 % "4000, 2**14 + \csname newcount\endcsname\xint_c_ii^xxi + \xint_c_ii^xxi 2097152 % "200000, 2**21 +\fi \def\XINT_tmpa { }% \ifx\XINT_tmpa\space\else \immediate\write-1{Package xintkernel Warning: ATTENTION!}% @@ -207,10 +216,19 @@ \long\def\xint_gobble_vi #1#2#3#4#5#6{}% \long\def\xint_gobble_vii #1#2#3#4#5#6#7{}% \long\def\xint_gobble_viii #1#2#3#4#5#6#7#8{}% +\let\xint_gob_andstop_\space +\long\def\xint_gob_andstop_i #1{ }% +\long\def\xint_gob_andstop_ii #1#2{ }% +\long\def\xint_gob_andstop_iii #1#2#3{ }% +\long\def\xint_gob_andstop_iv #1#2#3#4{ }% +\long\def\xint_gob_andstop_v #1#2#3#4#5{ }% +\long\def\xint_gob_andstop_vi #1#2#3#4#5#6{ }% +\long\def\xint_gob_andstop_vii #1#2#3#4#5#6#7{ }% +\long\def\xint_gob_andstop_viii #1#2#3#4#5#6#7#8{ }% \long\def\xint_firstofone #1{#1}% \long\def\xint_firstoftwo #1#2{#1}% \long\def\xint_secondoftwo #1#2{#2}% -\long\def\xint_gobble_thenstop #1{ }% +\let\xint_gobble_thenstop\xint_gob_andstop_i \long\def\xint_firstofone_thenstop #1{ #1}% \long\def\xint_firstoftwo_thenstop #1#2{ #1}% \long\def\xint_secondoftwo_thenstop #1#2{ #2}% @@ -507,6 +525,44 @@ {\noexpand\csname XINT_g66\expandafter\noexpand\csname XINT_g61\endcsname}% \expandafter\edef\csname XINT_g68\endcsname {\noexpand\csname XINT_g67\expandafter\noexpand\csname XINT_g61\endcsname}% +\ifdefined\xint_texuniformdeviate + \expandafter\xint_firstoftwo +\else\expandafter\xint_secondoftwo +\fi +{% + \def\xintUniformDeviate#1% + {\the\numexpr\expandafter\XINT_uniformdeviate_sgnfork\the\numexpr#1\xint:}% + \def\XINT_uniformdeviate_sgnfork#1% + {% + \if-#1\XINT_uniformdeviate_neg\fi \XINT_uniformdeviate{}#1% + }% + \def\XINT_uniformdeviate_neg\fi\XINT_uniformdeviate#1-% + {% + \fi-\numexpr\XINT_uniformdeviate\relax + }% + \def\XINT_uniformdeviate#1#2\xint: + {%( + \expandafter\XINT_uniformdeviate_a\the\numexpr% + -\xint_texuniformdeviate\xint_c_ii^vii% + -\xint_c_ii^vii*\xint_texuniformdeviate\xint_c_ii^vii% + -\xint_c_ii^xiv*\xint_texuniformdeviate\xint_c_ii^vii% + -\xint_c_ii^xxi*\xint_texuniformdeviate\xint_c_ii^vii% + +\xint_texuniformdeviate#2\xint:/#2)*#2\xint:+#2\fi\relax#1% + }% + \def\XINT_uniformdeviate_a #1\xint: + {% + \expandafter\XINT_uniformdeviate_b\the\numexpr#1-(#1% + }% + \def\XINT_uniformdeviate_b#1#2\xint:{#1#2\if-#1}% +}% +{% + \def\xintUniformDeviate#1% + {% + \the\numexpr + \XINT_expandableerror{No uniformdeviate at engine level, returning 0.}% + 0\relax + }% +}% \def\xintMessage #1#2#3{% \immediate\write128{Package #1 #2: (on line \the\inputlineno)}% \immediate\write128{\space\space\space\space#3}% @@ -519,7 +575,7 @@ \def\XINT_expandableerror_continue ##1#1##2#1{##1}% }% \begingroup\lccode`$ 32 \catcode`/ 11 \catcode`! 11 \catcode32 11 % -\lowercase{\endgroup\XINT_expandableerror$\ ! /}% +\lowercase{\endgroup\XINT_expandableerror$\ ! /\let\ ! /\xint_undefined}% \XINT_restorecatcodes_endinput% \endinput %% diff --git a/Master/texmf-dist/tex/generic/xint/xintseries.sty b/Master/texmf-dist/tex/generic/xint/xintseries.sty index df418b8d4ab..3e3ae687d5f 100644 --- a/Master/texmf-dist/tex/generic/xint/xintseries.sty +++ b/Master/texmf-dist/tex/generic/xint/xintseries.sty @@ -21,7 +21,7 @@ %% same distribution. (The sources need not necessarily be %% in the same archive or directory.) %% --------------------------------------------------------------- -%% The xint bundle 1.3a 2018/03/07 +%% The xint bundle 1.3b 2018/05/18 %% Copyright (C) 2013-2018 by Jean-Francois Burnol %% xintseries: Expandable partial sums with xint package %% --------------------------------------------------------------- @@ -70,7 +70,7 @@ \XINTsetupcatcodes% defined in xintkernel.sty \XINT_providespackage \ProvidesPackage{xintseries}% - [2018/03/07 1.3a Expandable partial sums with xint package (JFB)]% + [2018/05/18 1.3b Expandable partial sums with xint package (JFB)]% \def\xintSeries {\romannumeral0\xintseries }% \def\xintseries #1#2% {% diff --git a/Master/texmf-dist/tex/generic/xint/xinttools.sty b/Master/texmf-dist/tex/generic/xint/xinttools.sty index 6143680afb8..ac659b8c749 100644 --- a/Master/texmf-dist/tex/generic/xint/xinttools.sty +++ b/Master/texmf-dist/tex/generic/xint/xinttools.sty @@ -21,7 +21,7 @@ %% same distribution. (The sources need not necessarily be %% in the same archive or directory.) %% --------------------------------------------------------------- -%% The xint bundle 1.3a 2018/03/07 +%% The xint bundle 1.3b 2018/05/18 %% Copyright (C) 2013-2018 by Jean-Francois Burnol %% xinttools: Expandable and non-expandable utilities %% --------------------------------------------------------------- @@ -70,7 +70,7 @@ \XINTsetupcatcodes% defined in xintkernel.sty \XINT_providespackage \ProvidesPackage{xinttools}% - [2018/03/07 1.3a Expandable and non-expandable utilities (JFB)]% + [2018/05/18 1.3b Expandable and non-expandable utilities (JFB)]% \newtoks\XINT_toks \xint_firstofone{\let\XINT_sptoken= } %<- space here! \def\xintgodef {\global\xintodef }% @@ -687,9 +687,14 @@ #1.#2\xintiloop_again\fi\xint_gobble_iii #3#4#5{#1}% \long\def\xintiloopindex #1\xintiloop_again\fi\xint_gobble_iii #2% {#2#1\xintiloop_again\fi\xint_gobble_iii {#2}}% +\long\def\xintbracediloopindex #1\xintiloop_again\fi\xint_gobble_iii #2% + {{#2}#1\xintiloop_again\fi\xint_gobble_iii {#2}}% \long\def\xintouteriloopindex #1\xintiloop_again #2\xintiloop_again\fi\xint_gobble_iii #3% {#3#1\xintiloop_again #2\xintiloop_again\fi\xint_gobble_iii {#3}}% +\long\def\xintbracedouteriloopindex #1\xintiloop_again + #2\xintiloop_again\fi\xint_gobble_iii #3% + {{#3}#1\xintiloop_again #2\xintiloop_again\fi\xint_gobble_iii {#3}}% \long\def\xintiloopskiptonext #1\xintiloop_again\fi\xint_gobble_iii #2#3{% \expandafter\xintiloop_again_b \the\numexpr#2+#3.#3.}% \long\def\xintiloopskipandredo #1\xintiloop_again\fi\xint_gobble_iii #2#3#4{% |