diff options
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/generic/xint/xint.sty | 5 | ||||
-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 | 83 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/xint/xintexpr.sty | 199 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/xint/xintfrac.sty | 151 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/xint/xintgcd.sty | 165 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/xint/xintkernel.sty | 4 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/xint/xintseries.sty | 4 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/xint/xinttools.sty | 60 |
10 files changed, 449 insertions, 230 deletions
diff --git a/Master/texmf-dist/tex/generic/xint/xint.sty b/Master/texmf-dist/tex/generic/xint/xint.sty index 3cbe8373d14..de5c8e1ce98 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.2o 2017/08/29 +%% The xint bundle 1.2p 2017/12/05 %% Copyright (C) 2013-2017 by Jean-Francois Burnol %% xint: Expandable operations on big integers %% --------------------------------------------------------------- @@ -70,7 +70,7 @@ \XINTsetupcatcodes% defined in xintkernel.sty (loaded by xintcore.sty) \XINT_providespackage \ProvidesPackage{xint}% - [2017/08/29 1.2o Expandable operations on big integers (JFB)]% + [2017/12/05 1.2p 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}% @@ -129,7 +129,6 @@ {\expandafter#1\xint_gob_til_Z ##1}% }\XINT_revdigits_end{ }% \let\xintRev\xintReverseDigits -%%÷ Used in \xintMod \def\xintiiE {\romannumeral0\xintiie }% \def\xintiie #1#2% {\expandafter\XINT_iie_fork\the\numexpr #2\expandafter.\romannumeral`&&@#1;}% diff --git a/Master/texmf-dist/tex/generic/xint/xintbinhex.sty b/Master/texmf-dist/tex/generic/xint/xintbinhex.sty index 4888a8124cb..f2343f01e49 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.2o 2017/08/29 +%% The xint bundle 1.2p 2017/12/05 %% Copyright (C) 2013-2017 by Jean-Francois Burnol %% xintbinhex: Expandable binary and hexadecimal conversions %% --------------------------------------------------------------- @@ -70,7 +70,7 @@ \XINTsetupcatcodes% defined in xintkernel.sty \XINT_providespackage \ProvidesPackage{xintbinhex}% - [2017/08/29 1.2o Expandable binary and hexadecimal conversions (JFB)]% + [2017/12/05 1.2p 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 fb5a8744899..5253733a832 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.2o 2017/08/29 +%% The xint bundle 1.2p 2017/12/05 %% Copyright (C) 2013-2017 by Jean-Francois Burnol %% xintcfrac: Expandable continued fractions with xint package %% --------------------------------------------------------------- @@ -70,7 +70,7 @@ \XINTsetupcatcodes% defined in xintkernel.sty \XINT_providespackage \ProvidesPackage{xintcfrac}% - [2017/08/29 1.2o Expandable continued fractions with xint package (JFB)]% + [2017/12/05 1.2p 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 b1f73e6a6c6..953355c6684 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.2o 2017/08/29 +%% The xint bundle 1.2p 2017/12/05 %% Copyright (C) 2013-2017 by Jean-Francois Burnol %% xintcore: Expandable arithmetic on big integers %% --------------------------------------------------------------- @@ -70,7 +70,7 @@ \XINTsetupcatcodes% defined in xintkernel.sty \XINT_providespackage \ProvidesPackage{xintcore}% - [2017/08/29 1.2o Expandable arithmetic on big integers (JFB)]% + [2017/12/05 1.2p Expandable arithmetic on big integers (JFB)]% \csname XINT_Clamped_istrapped\endcsname \csname XINT_ConversionSyntax_istrapped\endcsname \csname XINT_DivisionByZero_istrapped\endcsname @@ -1869,11 +1869,13 @@ \romannumeral`&&@#3\xint:#2\xint:}% \def\XINT_iidivtrunc_a #1#2% #1 de A, #2 de B. {% - \if0#2\xint_dothis{\XINT_iidivround_divbyzero#1#2}\fi - \if0#1\xint_dothis\XINT_iidivround_aiszero\fi + \if0#2\xint_dothis{\XINT_iidivtrunc_divbyzero#1#2}\fi + \if0#1\xint_dothis\XINT_iidivtrunc_aiszero\fi \if-#2\xint_dothis{\XINT_iidivtrunc_bneg #1}\fi \xint_orthat{\XINT_iidivtrunc_bpos #1#2}% }% +\let\XINT_iidivtrunc_divbyzero\XINT_iidivround_divbyzero +\let\XINT_iidivtrunc_aiszero \XINT_iidivround_aiszero \def\XINT_iidivtrunc_bpos #1% {% \xint_UDsignfork @@ -1891,36 +1893,75 @@ \def\XINT_iidivtrunc_pos #1#2\xint:#3\xint: {\expandafter\xint_firstoftwo_thenstop \romannumeral0\XINT_div_prepare {#2}{#1#3}}% -\def\xintiMod {\romannumeral0\XINT_signaldeprecated{xintcore}{xintiMod}\xintimod }% -\def\xintimod #1{\expandafter\XINT_iimod\romannumeral0\xintnum{#1}\xint:}% -\def\xintiiMod {\romannumeral0\xintiimod }% -\def\xintiimod #1{\expandafter\XINT_iimod\romannumeral`&&@#1\xint:}% -\def\XINT_iimod #1#2\xint:#3{\expandafter\XINT_iimod_a\expandafter #1% +\def\xintiMod {\romannumeral0\XINT_signaldeprecated{xintcore}{xintiMod}\xintimod }% +\def\xintimod #1{\expandafter\XINT_iimodtrunc\romannumeral0\xintnum{#1}\xint:}% +\def\xintiiModTrunc {\romannumeral0\xintiimodtrunc }% +\def\xintiimodtrunc #1{\expandafter\XINT_iimodtrunc\romannumeral`&&@#1\xint:}% +\def\XINT_iimodtrunc #1#2\xint:#3{\expandafter\XINT_iimodtrunc_a\expandafter #1% \romannumeral`&&@#3\xint:#2\xint:}% -\def\XINT_iimod_a #1#2% #1 de A, #2 de B. +\def\XINT_iimodtrunc_a #1#2% #1 de A, #2 de B. {% - \if0#2\xint_dothis{\XINT_iidivround_divbyzero#1#2}\fi - \if0#1\xint_dothis\XINT_iidivround_aiszero\fi - \if-#2\xint_dothis{\XINT_iimod_bneg #1}\fi - \xint_orthat{\XINT_iimod_bpos #1#2}% + \if0#2\xint_dothis{\XINT_iimodtrunc_divbyzero#1#2}\fi + \if0#1\xint_dothis\XINT_iimodtrunc_aiszero\fi + \if-#2\xint_dothis{\XINT_iimodtrunc_bneg #1}\fi + \xint_orthat{\XINT_iimodtrunc_bpos #1#2}% }% -\def\XINT_iimod_bpos #1% +\let\XINT_iimodtrunc_divbyzero\XINT_iidivround_divbyzero +\let\XINT_iimodtrunc_aiszero \XINT_iidivround_aiszero +\def\XINT_iimodtrunc_bpos #1% {% \xint_UDsignfork - #1{\xintiiopp\XINT_iimod_pos {}}% - -{\XINT_iimod_pos #1}% + #1{\xintiiopp\XINT_iimodtrunc_pos {}}% + -{\XINT_iimodtrunc_pos #1}% \krof }% -\def\XINT_iimod_bneg #1% +\def\XINT_iimodtrunc_bneg #1% {% \xint_UDsignfork - #1{\xintiiopp\XINT_iimod_pos {}}% - -{\XINT_iimod_pos #1}% + #1{\xintiiopp\XINT_iimodtrunc_pos {}}% + -{\XINT_iimodtrunc_pos #1}% \krof }% -\def\XINT_iimod_pos #1#2\xint:#3\xint: +\def\XINT_iimodtrunc_pos #1#2\xint:#3\xint: {\expandafter\xint_secondoftwo_thenstop\romannumeral0\XINT_div_prepare {#2}{#1#3}}% +\def\xintiiDivMod {\romannumeral0\xintiidivmod }% +\def\xintiidivmod #1{\expandafter\XINT_iidivmod\romannumeral`&&@#1\xint:}% +\def\XINT_iidivmod #1#2\xint:#3{\expandafter\XINT_iidivmod_a\expandafter #1% + \romannumeral`&&@#3\xint:#2\xint:}% +\def\XINT_iidivmod_a #1#2% #1 de A, #2 de B. +{% + \if0#2\xint_dothis{\XINT_iidivmod_divbyzero#1#2}\fi + \if0#1\xint_dothis\XINT_iidivmod_aiszero\fi + \if-#2\xint_dothis{\XINT_iidivmod_bneg #1}\fi + \xint_orthat{\XINT_iidivmod_bpos #1#2}% +}% +\def\XINT_iidivmod_divbyzero #1#2\xint:#3\xint: +{% + \XINT_signalcondition{DivisionByZero}{Division by #2 of #1#3}{}% + {{0}{0}}% à revoir... +}% +\def\XINT_iidivmod_aiszero #1#2\xint:#3\xint:{{0}{0}}% +\def\XINT_iidivmod_bneg #1% +{% + \expandafter\XINT_iidivmod_bneg_finish + \romannumeral0\xint_UDsignfork + #1{\XINT_iidivmod_bpos {}}% + -{\XINT_iidivmod_bpos {-#1}}% + \krof +}% +\def\XINT_iidivmod_bneg_finish#1#2% +{% + \expandafter\xint_exchangetwo_keepbraces\expandafter + {\romannumeral0\xintiiopp#2}{#1}% +}% +\def\XINT_iidivmod_bpos #1#2\xint:#3\xint:{\xintiidivision{#1#3}{#2}}% +\def\xintiiDivFloor {\romannumeral0\xintiidivfloor}% +\def\xintiidivfloor {\expandafter\xint_firstoftwo_thenstop + \romannumeral0\xintiidivmod}% +\def\xintiiMod {\romannumeral0\xintiimod}% +\def\xintiimod {\expandafter\xint_secondoftwo_thenstop + \romannumeral0\xintiidivmod}% \def\xintiiSqr {\romannumeral0\xintiisqr }% \def\xintiisqr #1% {% diff --git a/Master/texmf-dist/tex/generic/xint/xintexpr.sty b/Master/texmf-dist/tex/generic/xint/xintexpr.sty index 15789f2d24e..610ba1449c2 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.2o 2017/08/29 +%% The xint bundle 1.2p 2017/12/05 %% Copyright (C) 2013-2017 by Jean-Francois Burnol %% xintexpr: Expandable expression parser %% --------------------------------------------------------------- @@ -81,7 +81,7 @@ \XINTsetupcatcodes% \XINT_providespackage \ProvidesPackage{xintexpr}% - [2017/08/29 1.2o Expandable expression parser (JFB)]% + [2017/12/05 1.2p Expandable expression parser (JFB)]% \catcode`! 11 \let\XINT_Cmp \xintiiCmp \def\xint_gob_til_! #1!{}% ! with catcode 11 @@ -95,7 +95,8 @@ {\expandafter\XINT_expr_inhex\romannumeral`&&@\XINT_expr_unlock#1;}% \def\XINT_expr_inhex #1.#2#3;% expanded inside \csname..\endcsname {% - \if#2>\xintHexToDec{#1}% + \if#2>% + \xintHexToDec{#1}% \else \xintiiMul{\xintiiPow{625}{\xintLength{#3}}}{\xintHexToDec{#1#3}}% [\the\numexpr-4*\xintLength{#3}]% @@ -303,11 +304,11 @@ \def\XINT_expr_scan_nbr_or_func #1% this #1 has necessarily here catcode 12 {% \if "#1\xint_dothis \XINT_expr_scanhex_I\fi - \if `#1\xint_dothis {\XINT_expr_onlitteral_`}\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_onlitteral_` #1#2#3({\xint_c_xviii `{#2}}% +\def\XINT_expr_onliteral_` #1#2#3({\xint_c_xviii `{#2}}% \catcode96 12 % ` \def\XINT_expr_startint #1% {% @@ -743,12 +744,12 @@ \XINT_expr_defbin_b {expr} {..} {iii}{vi} {xintSeq::csv}% \XINT_expr_defbin_b {flexpr}{..} {iii}{vi} {xintSeq::csv}% \XINT_expr_defbin_b {iiexpr}{..} {iii}{vi} {xintiiSeq::csv}% -\XINT_expr_defbin_b {expr} {//} {vii}{vii}{xintDivTrunc}% -\XINT_expr_defbin_b {flexpr}{//} {vii}{vii}{xintDivTrunc}% -\XINT_expr_defbin_b {iiexpr}{//} {vii}{vii}{xintiiDivTrunc}% -\XINT_expr_defbin_b {expr} {/:} {vii}{vii}{xintMod}% -\XINT_expr_defbin_b {flexpr}{/:} {vii}{vii}{xintMod}% -\XINT_expr_defbin_b {iiexpr}{/:} {vii}{vii}{xintiiMod}% +\XINT_expr_defbin_b {expr} {//} {vii}{vii}{xintDivFloor}% CHANGED IN 1.2p! +\XINT_expr_defbin_b {flexpr}{//} {vii}{vii}{XINTinFloatDivFloor}% " +\XINT_expr_defbin_b {iiexpr}{//} {vii}{vii}{xintiiDivFloor}% " +\XINT_expr_defbin_b {expr} {/:} {vii}{vii}{xintMod}% " +\XINT_expr_defbin_b {flexpr}{/:} {vii}{vii}{XINTinFloatMod}% " +\XINT_expr_defbin_b {iiexpr}{/:} {vii}{vii}{xintiiMod}% " \XINT_expr_defbin_b {expr} + {vi}{vi} {xintAdd}% \XINT_expr_defbin_b {flexpr} + {vi}{vi} {XINTinFloatAdd}% \XINT_expr_defbin_b {iiexpr} + {vi}{vi} {xintiiAdd}% @@ -1385,8 +1386,8 @@ \ifcsname XINT_#3_func_##1\endcsname \xint_dothis{\expandafter\expandafter \csname XINT_#3_func_##1\endcsname\romannumeral`&&@#2}\fi - \ifcsname XINT_expr_onlitteral_##1\endcsname - \xint_dothis{\csname XINT_expr_onlitteral_##1\endcsname}\fi + \ifcsname XINT_expr_onliteral_##1\endcsname + \xint_dothis{\csname XINT_expr_onliteral_##1\endcsname}\fi \xint_orthat{\XINT_expr_unknown_function {##1}% \expandafter\XINT_expr_func_unknown\romannumeral`&&@#2}% }% @@ -1400,21 +1401,21 @@ }% \def\XINT_expr_func_unknown #1#2#3% {\expandafter #1\expandafter #2\csname .=0\endcsname }% -\def\XINT_expr_onlitteral_bool #1)% +\def\XINT_expr_onliteral_bool #1)% {\expandafter\XINT_expr_getop\csname .=\xintBool{#1}\endcsname }% -\def\XINT_expr_onlitteral_togl #1)% +\def\XINT_expr_onliteral_togl #1)% {\expandafter\XINT_expr_getop\csname .=\xintToggle{#1}\endcsname }% -\def\XINT_expr_onlitteral_protect #1)% +\def\XINT_expr_onliteral_protect #1)% {\expandafter\XINT_expr_getop\csname .=\detokenize{#1}\endcsname }% \def\XINT_expr_func_break #1#2#3% {\expandafter #1\expandafter #2\csname.=?\romannumeral`&&@\XINT_expr_unlock #3\endcsname }% \let\XINT_flexpr_func_break \XINT_expr_func_break \let\XINT_iiexpr_func_break \XINT_expr_func_break -\def\XINT_expr_onlitteral_qint #1)% +\def\XINT_expr_onliteral_qint #1)% {\expandafter\XINT_expr_getop\csname .=\xintiNum{#1}\endcsname }% -\def\XINT_expr_onlitteral_qfrac #1)% +\def\XINT_expr_onliteral_qfrac #1)% {\expandafter\XINT_expr_getop\csname .=\xintRaw{#1}\endcsname }% -\def\XINT_expr_onlitteral_qfloat #1)% +\def\XINT_expr_onliteral_qfloat #1)% {\expandafter\XINT_expr_getop\csname .=\XINTinFloatdigits{#1}\endcsname }% \def\XINT_expr_op__ #1% op__ with two _'s {% @@ -1432,25 +1433,54 @@ \let\XINT_flexpr_op__ \XINT_expr_op__ \let\XINT_iiexpr_op__ \XINT_expr_op__ \catcode`* 11 -\def\XINT_expr_defvar #1#2#3;{% - \edef\XINT_expr_tmpa{#2}% - \edef\XINT_expr_tmpa {\xint_zapspaces_o\XINT_expr_tmpa}% - \ifnum\expandafter\xintLength\expandafter{\XINT_expr_tmpa}=\z@ - \xintMessage {xintexpr}{Warning} - {Error: impossible to declare variable with empty name.}% - \else - \edef\XINT_expr_tmpb {\romannumeral0#1#3\relax }% - \expandafter\edef\csname XINT_expr_var_\XINT_expr_tmpa\endcsname - {\expandafter\noexpand\XINT_expr_tmpb}% - \expandafter\edef\csname XINT_expr_onlitteral_\XINT_expr_tmpa\endcsname - {\XINT_expr_precedence_*** *\expandafter\noexpand\XINT_expr_tmpb (}% - \ifxintverbose\xintMessage {xintexpr}{Info} - {Variable "\XINT_expr_tmpa" defined with value - \expandafter\XINT_expr_unlock\XINT_expr_tmpb.}% - \fi - \fi +\def\XINT_expr_defvar_one #1#2% +{% + \expandafter\edef\csname XINT_expr_var_#1\endcsname + {\expandafter\noexpand#2}% + \expandafter\edef\csname XINT_expr_onliteral_#1\endcsname + {\XINT_expr_precedence_*** *\expandafter\noexpand#2(}% + \ifxintverbose\xintMessage{xintexpr}{Info} + {Variable "#1" defined with value \expandafter\XINT_expr_unlock#2.}% + \fi }% \catcode`* 12 +\def\XINT_expr_defvar #1#2#3;% +{% + \edef\XINT_expr_tmpa{#2}% + \edef\XINT_expr_tmpa{\xint_zapspaces_o\XINT_expr_tmpa}% + \edef\XINT_expr_tmpc{\xintCSVLength{\XINT_expr_tmpa}}% + \ifcase\XINT_expr_tmpc + \xintMessage {xintexpr}{Warning} + {Aborting: impossible to declare variable with empty name.}% + \or + \edef\XINT_expr_tmpb{\romannumeral0#1#3\relax}% + \XINT_expr_defvar_one\XINT_expr_tmpa\XINT_expr_tmpb + \else + \edef\XINT_expr_tmpb + {\expandafter\XINT_expr_unlock\romannumeral0#1#3\relax}% + \edef\XINT_expr_tmpd{\xintCSVLength{\XINT_expr_tmpb}}% + \ifnum\XINT_expr_tmpc=\XINT_expr_tmpd\space + \xintAssignArray\xintCSVtoList\XINT_expr_tmpa\to\XINT_expr_tmpvar + \xintAssignArray + \xintApply\XINT_expr_lockit{\xintCSVtoList\XINT_expr_tmpb}% + \to\XINT_expr_tmpval + \def\XINT_expr_tmpd{1}% + \xintloop + \expandafter\XINT_expr_defvar_one + \csname XINT_expr_tmpvar\XINT_expr_tmpd\expandafter\endcsname + \csname XINT_expr_tmpval\XINT_expr_tmpd\endcsname + \ifnum\XINT_expr_tmpd<\XINT_expr_tmpc\space + \edef\XINT_expr_tmpd{\the\numexpr\XINT_expr_tmpd+1}% + \repeat + \xintRelaxArray\XINT_expr_tmpvar + \xintRelaxArray\XINT_expr_tmpval + \else + \xintMessage {xintexpr}{Warning} + {Aborting: mismatch between number of variables (\XINT_expr_tmpc) + and number of values (\XINT_expr_tmpd).}% + \fi + \fi +}% \catcode`: 12 \def\xintdefvar #1:={\XINT_expr_defvar\xintbareeval {#1}}% \def\xintdefiivar #1:={\XINT_expr_defvar\xintbareiieval {#1}}% @@ -1468,7 +1498,7 @@ \else \expandafter\edef\csname XINT_expr_var_\XINT_expr_tmpa\endcsname {\csname .=0\endcsname\noexpand\XINT_expr_undefined {\XINT_expr_tmpa}}% - \expandafter\edef\csname XINT_expr_onlitteral_\XINT_expr_tmpa\endcsname + \expandafter\edef\csname XINT_expr_onliteral_\XINT_expr_tmpa\endcsname {\csname .=0\endcsname\noexpand\XINT_expr_undefined {\XINT_expr_tmpa}*}% \ifxintverbose\xintMessage {xintexpr}{Info} {Variable \XINT_expr_tmpa\space has been ``unassigned''.}% @@ -1485,7 +1515,7 @@ {% \expandafter\def\csname XINT_expr_var_#1\endcsname ##1\relax !#1##2% {##2##1\relax !#1##2}% - \expandafter\def\csname XINT_expr_onlitteral_#1\endcsname ##1\relax !#1##2% + \expandafter\def\csname XINT_expr_onliteral_#1\endcsname ##1\relax !#1##2% {\XINT_expr_precedence_*** *##2(##1\relax !#1##2}% }% \xintApplyUnbraced \XINT_expr_makedummy {abcdefghijklmnopqrstuvwxyz}% @@ -1497,7 +1527,7 @@ \fi }% \edef\XINT_expr_var_nil {\expandafter\noexpand\csname .= \endcsname}% -\edef\XINT_expr_onlitteral_nil +\edef\XINT_expr_onliteral_nil {\XINT_expr_precedence_*** *\expandafter\noexpand\csname .= \endcsname (}% \catcode`* 12 \edef\XINT_expr_var_omit #1\relax !{1\string !?!\relax !}% @@ -1511,13 +1541,13 @@ \expandafter\def\csname XINT_expr_var_@2\endcsname #1~#2#3{#3#1~#2#3}% \expandafter\def\csname XINT_expr_var_@3\endcsname #1~#2#3#4{#4#1~#2#3#4}% \expandafter\def\csname XINT_expr_var_@4\endcsname #1~#2#3#4#5{#5#1~#2#3#4#5}% -\def\XINT_expr_onlitteral_@ #1~#2{\XINT_expr_precedence_*** *#2(#1~#2}% -\expandafter\let\csname XINT_expr_onlitteral_@1\endcsname \XINT_expr_onlitteral_@ -\expandafter\def\csname XINT_expr_onlitteral_@2\endcsname #1~#2#3% +\def\XINT_expr_onliteral_@ #1~#2{\XINT_expr_precedence_*** *#2(#1~#2}% +\expandafter\let\csname XINT_expr_onliteral_@1\endcsname \XINT_expr_onliteral_@ +\expandafter\def\csname XINT_expr_onliteral_@2\endcsname #1~#2#3% {\XINT_expr_precedence_*** *#3(#1~#2#3}% -\expandafter\def\csname XINT_expr_onlitteral_@3\endcsname #1~#2#3#4% +\expandafter\def\csname XINT_expr_onliteral_@3\endcsname #1~#2#3#4% {\XINT_expr_precedence_*** *#4(#1~#2#3#4}% -\expandafter\def\csname XINT_expr_onlitteral_@4\endcsname #1~#2#3#4#5% +\expandafter\def\csname XINT_expr_onliteral_@4\endcsname #1~#2#3#4#5% {\XINT_expr_precedence_*** *#5(#1~#2#3#4#5}% \catcode`* 12 \def\XINT_expr_func_@@ #1#2#3#4~#5?% @@ -1554,31 +1584,31 @@ {\XINT_expr_unlock#3}{#7}#4~#5~#6~#7?% }% \catcode`? 11 -\def\XINT_expr_onlitteral_seq - {\expandafter\XINT_expr_onlitteral_seq_f\romannumeral`&&@\XINT_expr_onlitteral_seq_a {}}% -\def\XINT_expr_onlitteral_seq_f #1#2{\xint_c_xviii `{seqx}#2)\relax #1}% -\def\XINT_expr_onlitteral_seq_a #1#2,% +\def\XINT_expr_onliteral_seq + {\expandafter\XINT_expr_onliteral_seq_f\romannumeral`&&@\XINT_expr_onliteral_seq_a {}}% +\def\XINT_expr_onliteral_seq_f #1#2{\xint_c_xviii `{seqx}#2)\relax #1}% +\def\XINT_expr_onliteral_seq_a #1#2,% {% \ifcase\XINT_isbalanced_a \relax #1#2(\xint_bye)\xint_bye - \expandafter\XINT_expr_onlitteral_seq_c - \or\expandafter\XINT_expr_onlitteral_seq_b + \expandafter\XINT_expr_onliteral_seq_c + \or\expandafter\XINT_expr_onliteral_seq_b \else\expandafter\xintError:we_are_doomed \fi {#1#2},% }% -\def\XINT_expr_onlitteral_seq_b #1,{\XINT_expr_onlitteral_seq_a {#1,}}% -\def\XINT_expr_onlitteral_seq_c #1,#2#3% #3 pour absorber le = +\def\XINT_expr_onliteral_seq_b #1,{\XINT_expr_onliteral_seq_a {#1,}}% +\def\XINT_expr_onliteral_seq_c #1,#2#3% #3 pour absorber le = {% - \XINT_expr_onlitteral_seq_d {#2{#1}}{}% + \XINT_expr_onliteral_seq_d {#2{#1}}{}% }% -\def\XINT_expr_onlitteral_seq_d #1#2#3)% +\def\XINT_expr_onliteral_seq_d #1#2#3)% {% \ifcase\XINT_isbalanced_a \relax #2#3(\xint_bye)\xint_bye - \or\expandafter\XINT_expr_onlitteral_seq_e + \or\expandafter\XINT_expr_onliteral_seq_e \else\expandafter\xintError:we_are_doomed \fi {#1}{#2#3}% }% -\def\XINT_expr_onlitteral_seq_e #1#2{\XINT_expr_onlitteral_seq_d {#1}{#2)}}% +\def\XINT_expr_onliteral_seq_e #1#2{\XINT_expr_onliteral_seq_d {#1}{#2)}}% \def\XINT_isbalanced_a #1({\XINT_isbalanced_b #1)\xint_bye }% \def\XINT_isbalanced_b #1)#2% {\xint_bye #2\XINT_isbalanced_c\xint_bye\XINT_isbalanced_error }% @@ -1636,12 +1666,12 @@ \def\XINT_expr_seq:_Goon #1!#2#3% {,#1\expandafter\XINT_expr_seq:_D \csname.=\the\numexpr \XINT_expr_unlock#3+\xint_c_i\endcsname}% -\def\XINT_expr_onlitteral_add - {\expandafter\XINT_expr_onlitteral_add_f\romannumeral`&&@\XINT_expr_onlitteral_seq_a {}}% -\def\XINT_expr_onlitteral_add_f #1#2{\xint_c_xviii `{opxadd}#2)\relax #1}% -\def\XINT_expr_onlitteral_mul - {\expandafter\XINT_expr_onlitteral_mul_f\romannumeral`&&@\XINT_expr_onlitteral_seq_a {}}% -\def\XINT_expr_onlitteral_mul_f #1#2{\xint_c_xviii `{opxmul}#2)\relax #1}% +\def\XINT_expr_onliteral_add + {\expandafter\XINT_expr_onliteral_add_f\romannumeral`&&@\XINT_expr_onliteral_seq_a {}}% +\def\XINT_expr_onliteral_add_f #1#2{\xint_c_xviii `{opxadd}#2)\relax #1}% +\def\XINT_expr_onliteral_mul + {\expandafter\XINT_expr_onliteral_mul_f\romannumeral`&&@\XINT_expr_onliteral_seq_a {}}% +\def\XINT_expr_onliteral_mul_f #1#2{\xint_c_xviii `{opxmul}#2)\relax #1}% \def\XINT_expr_func_opxadd #1#2{\XINT_allexpr_opx \xintbareeval {\xintAdd 0}}% \def\XINT_flexpr_func_opxadd #1#2{\XINT_allexpr_opx \xintbarefloateval {\XINTinFloatAdd 0}}% \def\XINT_iiexpr_func_opxadd #1#2{\XINT_allexpr_opx \xintbareiieval {\xintiiAdd 0}}% @@ -1666,9 +1696,9 @@ {\romannumeral`&&@#4{\XINT_expr_unlock#1}{#5}}}% \def\XINT_expr_op:_noop\csname.=,#1\endcsname #2#3#4{\XINT_expr_op:_b #3{#4}{#2}#1,}% \def\XINT_expr_op:_end \csname.=^\endcsname #1#2#3{#3}% -\def\XINT_expr_onlitteral_subs - {\expandafter\XINT_expr_onlitteral_subs_f\romannumeral`&&@\XINT_expr_onlitteral_seq_a {}}% -\def\XINT_expr_onlitteral_subs_f #1#2{\xint_c_xviii `{subx}#2)\relax #1}% +\def\XINT_expr_onliteral_subs + {\expandafter\XINT_expr_onliteral_subs_f\romannumeral`&&@\XINT_expr_onliteral_seq_a {}}% +\def\XINT_expr_onliteral_subs_f #1#2{\xint_c_xviii `{subx}#2)\relax #1}% \def\XINT_expr_func_subx #1#2{\XINT_allexpr_subx \xintbareeval }% \def\XINT_flexpr_func_subx #1#2{\XINT_allexpr_subx \xintbarefloateval}% \def\XINT_iiexpr_func_subx #1#2{\XINT_allexpr_subx \xintbareiieval }% @@ -1684,7 +1714,7 @@ \def\XINT_allexpr_rseq #1#2#3% {% \expandafter\XINT_expr_rseqx\expandafter #1\expandafter#2\expandafter - #3\romannumeral`&&@\XINT_expr_onlitteral_seq_a {}% + #3\romannumeral`&&@\XINT_expr_onliteral_seq_a {}% }% \def\XINT_expr_rseqx #1#2#3#4#5% {% @@ -1742,7 +1772,7 @@ \def\XINT_allexpr_iter #1#2#3% {% \expandafter\XINT_expr_iterx\expandafter #1\expandafter#2\expandafter - #3\romannumeral`&&@\XINT_expr_onlitteral_seq_a {}% + #3\romannumeral`&&@\XINT_expr_onliteral_seq_a {}% }% \def\XINT_expr_iterx #1#2#3#4#5% {% @@ -1800,7 +1830,7 @@ \def\XINT_allexpr_rrseq #1#2#3% {% \expandafter\XINT_expr_rrseqx\expandafter #1\expandafter#2\expandafter - #3\romannumeral`&&@\XINT_expr_onlitteral_seq_a {}% + #3\romannumeral`&&@\XINT_expr_onliteral_seq_a {}% }% \def\XINT_expr_rrseqx #1#2#3#4#5% {% @@ -1863,7 +1893,7 @@ \def\XINT_allexpr_iterr #1#2#3% {% \expandafter\XINT_expr_iterrx\expandafter #1\expandafter #2\expandafter - #3\romannumeral`&&@\XINT_expr_onlitteral_seq_a {}% + #3\romannumeral`&&@\XINT_expr_onliteral_seq_a {}% }% \def\XINT_expr_iterrx #1#2#3#4#5% {% @@ -2000,6 +2030,7 @@ \def\XINTinFloatPrd:csv #1{\expandafter\XINT_oncsv:_a\expandafter\XINTinfloatmul \expandafter\XINTinFloatdigits\romannumeral`&&@#1,^,{1[0]}}% \def\XINT_expr_twoargs #1,#2,{{#1}{#2}}% +\def\XINT_expr_totwoargs #1#2{#1,#2}% \def\XINT_expr_argandopt #1,#2,#3.#4#5% {% \if\relax#3\relax\expandafter\xint_firstoftwo\else @@ -2126,6 +2157,29 @@ \endcsname }% \let\XINT_flexpr_func_float\XINT_expr_func_float +\def\XINT_expr_func_divmod #1#2#3% +{% + \expandafter #1\expandafter #2\csname .=% + \expandafter\XINT_expr_totwoargs + \romannumeral0\expandafter\xintDivMod + \romannumeral`&&@\expandafter\XINT_expr_twoargs + \romannumeral`&&@\XINT_expr_unlock #3,\endcsname +}% +\def\XINT_flexpr_func_divmod #1#2#3% +{% + \expandafter #1\expandafter #2\csname .=% + \expandafter\XINTinFloatDivMod + \romannumeral`&&@\expandafter\XINT_expr_twoargs + \romannumeral`&&@\XINT_expr_unlock #3,\endcsname +}% +\def\XINT_iiexpr_func_divmod #1#2#3% +{% + \expandafter #1\expandafter #2\csname .=% + \expandafter\XINT_expr_totwoargs + \romannumeral0\expandafter\xintiiDivMod + \romannumeral`&&@\expandafter\XINT_expr_twoargs + \romannumeral`&&@\XINT_expr_unlock #3,\endcsname +}% \def\XINT_expr_func_mod #1#2#3% {% \expandafter #1\expandafter #2\csname .=% @@ -2566,8 +2620,8 @@ }% \toks0 {}% \xintFor #1 in - {DivTrunc,Mod,Round,Trunc,iRound,iTrunc,iQuo,iRem, - iiDivTrunc,iiDivRound,iiMod,iiQuo,iiRem,% + {DivFloor,Mod,Round,Trunc,iRound,iTrunc,iQuo,iRem, + iiDivFloor,iiDivRound,iiMod,iiQuo,iiRem,% Lt,Gt,Eq,LtorEq,GtorEq,NotEq,% iiLt,iiGt,iiEq,iiLtorEq,iiGtorEq,iiNotEq,% Add,Sub,Mul,Div,Pow,E,% @@ -2601,7 +2655,8 @@ \expandafter\XINT_NEfork_one \romannumeral`&&@##1!{~XINTinFloatFac}{XINTinFloatFac}{}{}}% }% -\xintFor #1 in {Add,Sub,Mul,Div,Binomial,PFactorial,PowerH,E,Mod,SeqA::csv}\do +\xintFor #1 in {Add,Sub,Mul,Div,Binomial,PFactorial,PowerH,E,% + Mod,DivFloor,DivMod,SeqA::csv}\do {\toks0 \expandafter{\the\toks0% \expandafter\let\csname XINTinFloat#1NE\expandafter\endcsname diff --git a/Master/texmf-dist/tex/generic/xint/xintfrac.sty b/Master/texmf-dist/tex/generic/xint/xintfrac.sty index 4dda12fb0c2..c223619a52a 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.2o 2017/08/29 +%% The xint bundle 1.2p 2017/12/05 %% Copyright (C) 2013-2017 by Jean-Francois Burnol %% xintfrac: Expandable operations on fractions %% --------------------------------------------------------------- @@ -70,7 +70,7 @@ \XINTsetupcatcodes% defined in xintkernel.sty \XINT_providespackage \ProvidesPackage{xintfrac}% - [2017/08/29 1.2o Expandable operations on fractions (JFB)]% + [2017/12/05 1.2p Expandable operations on fractions (JFB)]% \def\xintSgn {\romannumeral0\xintsgn }% deprecated from xintcore \def\xintCmp {\romannumeral0\xintcmp }% deprecated from xintcore \def\xintEq {\romannumeral0\xinteq }% deprecated from xint @@ -1423,11 +1423,94 @@ }% \def\XINT_fdiv_C #1#2{\XINT_outfrac {#2}{#1}}% \def\xintDivFloor {\romannumeral0\xintdivfloor }% -\def\xintdivfloor #1#2{\xintfloor{\xintDiv {#1}{#2}}}% +\def\xintdivfloor #1#2{\xintifloor{\xintDiv {#1}{#2}}}% \def\xintDivTrunc {\romannumeral0\xintdivtrunc }% \def\xintdivtrunc #1#2{\xintttrunc {\xintDiv {#1}{#2}}}% \def\xintDivRound {\romannumeral0\xintdivround }% \def\xintdivround #1#2{\xintiround 0{\xintDiv {#1}{#2}}}% +\def\xintModTrunc {\romannumeral0\xintmodtrunc }% +\def\xintmodtrunc #1{\expandafter\XINT_modtrunc_a\romannumeral0\xintraw{#1}.}% +\def\XINT_modtrunc_a #1#2.#3% + {\expandafter\XINT_modtrunc_b\expandafter #1\romannumeral0\xintraw{#3}#2.}% +\def\XINT_modtrunc_b #1#2% #1 de A, #2 de B. +{% + \if0#2\xint_dothis{\XINT_modtrunc_divbyzero #1#2}\fi + \if0#1\xint_dothis\XINT_modtrunc_aiszero\fi + \if-#2\xint_dothis{\XINT_modtrunc_bneg #1}\fi + \xint_orthat{\XINT_modtrunc_bpos #1#2}% +}% +\def\XINT_modtrunc_divbyzero #1#2[#3]#4.% +{% + \XINT_signalcondition{DivisionByZero}{Division by #2[#3] of #1#4}{}{0/1[0]}% +}% +\def\XINT_modtrunc_aiszero #1.{ 0/1[0]}% +\def\XINT_modtrunc_bneg #1% +{% + \xint_UDsignfork + #1{\xintiiopp\XINT_modtrunc_pos {}}% + -{\XINT_modtrunc_pos #1}% + \krof +}% +\def\XINT_modtrunc_bpos #1% +{% + \xint_UDsignfork + #1{\xintiiopp\XINT_modtrunc_pos {}}% + -{\XINT_modtrunc_pos #1}% + \krof +}% +\def\XINT_modtrunc_pos #1#2/#3[#4]#5/#6[#7].% +{% + \expandafter\XINT_modtrunc_pos_a + \the\numexpr\ifnum#7>#4 #4\else #7\fi\expandafter.\expandafter + {\romannumeral0\xintiimul {#6}{#3}}% + {\xintiiE{\xintiiMul {#1#5}{#3}}{#7-#4}}% + {\xintiiE{\xintiiMul {#2}{#6}}{#4-#7}}% +}% +\def\XINT_modtrunc_pos_a #1.#2#3#4{\xintiirem {#3}{#4}/#2[#1]}% +\def\xintDivMod {\romannumeral0\xintdivmod }% +\def\xintdivmod #1{\expandafter\XINT_divmod_a\romannumeral0\xintraw{#1}.}% +\def\XINT_divmod_a #1#2.#3% + {\expandafter\XINT_divmod_b\expandafter #1\romannumeral0\xintraw{#3}#2.}% +\def\XINT_divmod_b #1#2% #1 de A, #2 de B. +{% + \if0#2\xint_dothis{\XINT_divmod_divbyzero #1#2}\fi + \if0#1\xint_dothis\XINT_divmod_aiszero\fi + \if-#2\xint_dothis{\XINT_divmod_bneg #1}\fi + \xint_orthat{\XINT_divmod_bpos #1#2}% +}% +\def\XINT_divmod_divbyzero #1#2[#3]#4.% +{% + \XINT_signalcondition{DivisionByZero}{Division by #2[#3] of #1#4}{}% + {{0}{0/1[0]}}% à revoir... +}% +\def\XINT_divmod_aiszero #1.{{0}{0/1[0]}}% +\def\XINT_divmod_bneg #1% f // -g = (-f) // g, f % -g = - ((-f) % g) +{% + \expandafter\XINT_divmod_bneg_finish + \romannumeral0\xint_UDsignfork + #1{\XINT_divmod_bpos {}}% + -{\XINT_divmod_bpos {-#1}}% + \krof +}% +\def\XINT_divmod_bneg_finish#1#2% +{% + \expandafter\xint_exchangetwo_keepbraces\expandafter + {\romannumeral0\xintiiopp#2}{#1}% +}% +\def\XINT_divmod_bpos #1#2/#3[#4]#5/#6[#7].% +{% + \expandafter\XINT_divmod_bpos_a + \the\numexpr\ifnum#7>#4 #4\else #7\fi\expandafter.\expandafter + {\romannumeral0\xintiimul {#6}{#3}}% + {\xintiiE{\xintiiMul {#1#5}{#3}}{#7-#4}}% + {\xintiiE{\xintiiMul {#2}{#6}}{#4-#7}}% +}% +\def\XINT_divmod_bpos_a #1.#2#3#4% +{% + \expandafter\XINT_divmod_bpos_finish + \romannumeral0\xintiidivision{#3}{#4}{/#2[#1]}% +}% +\def\XINT_divmod_bpos_finish #1#2#3{{#1}{#2#3}}% \def\xintMod {\romannumeral0\xintmod }% \def\xintmod #1{\expandafter\XINT_mod_a\romannumeral0\xintraw{#1}.}% \def\XINT_mod_a #1#2.#3% @@ -1439,34 +1522,24 @@ \if-#2\xint_dothis{\XINT_mod_bneg #1}\fi \xint_orthat{\XINT_mod_bpos #1#2}% }% -\def\XINT_mod_bpos #1% -{% - \xint_UDsignfork - #1{\xintiiopp\XINT_mod_pos {}}% - -{\XINT_mod_pos #1}% - \krof -}% -\def\XINT_mod_bneg #1% +\let\XINT_mod_divbyzero\XINT_modtrunc_divbyzero +\let\XINT_mod_aiszero \XINT_modtrunc_aiszero +\def\XINT_mod_bneg #1% f % -g = - ((-f) % g), for g > 0 {% - \xint_UDsignfork - #1{\xintiiopp\XINT_mod_pos {}}% - -{\XINT_mod_pos #1}% + \xintiiopp\xint_UDsignfork + #1{\XINT_mod_bpos {}}% + -{\XINT_mod_bpos {-#1}}% \krof }% -\def\XINT_mod_divbyzero #1#2[#3]#4.% +\def\XINT_mod_bpos #1#2/#3[#4]#5/#6[#7].% {% - \XINT_signalcondition{DivisionByZero}{Division by #2[#3] of #1#4}{}{0/1[0]}% -}% -\def\XINT_mod_aiszero #1.{ 0/1[0]}% -\def\XINT_mod_pos #1#2/#3[#4]#5/#6[#7].% -{% - \expandafter\XINT_mod_pos_a + \expandafter\XINT_mod_bpos_a \the\numexpr\ifnum#7>#4 #4\else #7\fi\expandafter.\expandafter - {\romannumeral0\xintiimul {#6}{#3}}% n fois u - {\xintiiE{\xintiiMul {#1#5}{#3}}{#7-#4}}% m fois u - {\xintiiE{\xintiiMul {#2}{#6}}{#4-#7}}% t fois n + {\romannumeral0\xintiimul {#6}{#3}}% + {\xintiiE{\xintiiMul {#1#5}{#3}}{#7-#4}}% + {\xintiiE{\xintiiMul {#2}{#6}}{#4-#7}}% }% -\def\XINT_mod_pos_a #1.#2#3#4{\xintiirem {#3}{#4}/#2[#1]}% +\def\XINT_mod_bpos_a #1.#2#3#4{\xintiirem {#3}{#4}/#2[#1]}% \def\xintIsOne {\romannumeral0\xintisone }% \def\xintisone #1{\expandafter\XINT_fracisone \romannumeral0\xintrawwithzeros{#1}\Z }% @@ -3057,11 +3130,29 @@ {\expandafter\XINT_infloate_end\the\numexpr #3+#2.{#1}}% \def\XINT_infloate_end #1.#2{ #2[#1]}% \def\XINTinFloatMod {\romannumeral0\XINTinfloatmod [\XINTdigits]}% -\def\XINTinfloatmod [#1]#2#3{\expandafter\XINT_infloatmod\expandafter - {\romannumeral0\XINTinfloat[#1]{#2}}% - {\romannumeral0\XINTinfloat[#1]{#3}}{#1}}% -\def\XINT_infloatmod #1#2{\expandafter\XINT_infloatmod_a\expandafter {#2}{#1}}% -\def\XINT_infloatmod_a #1#2#3{\XINTinfloat [#3]{\xintMod {#2}{#1}}}% +\def\XINTinfloatmod [#1]#2#3% +{% + \XINTinfloat[#1]{\xintMod + {\romannumeral0\XINTinfloat[#1]{#2}}% + {\romannumeral0\XINTinfloat[#1]{#3}}}% +}% +\def\XINTinFloatDivFloor {\romannumeral0\XINTinfloatdivfloor [\XINTdigits]}% +\def\XINTinfloatdivfloor [#1]#2#3% +{% + \xintdivfloor + {\romannumeral0\XINTinfloat[#1]{#2}}% + {\romannumeral0\XINTinfloat[#1]{#3}}% +}% +\def\XINTinFloatDivMod {\romannumeral0\XINTinfloatdivmod [\XINTdigits]}% +\def\XINTinfloatdivmod [#1]#2#3% +{% + \expandafter\XINT_infloatdivmod + \romannumeral0\xintdivmod + {\romannumeral0\XINTinfloat[#1]{#2}}% + {\romannumeral0\XINTinfloat[#1]{#3}}% + {#1}% +}% +\def\XINT_infloatdivmod #1#2#3{ #1,\XINTinFloat[#3]{#2}}% \ifdefined\documentclass\ifdefined\AtEndDocument \AtEndDocument{% \XINT_ifFlagRaised{Deprecated-xintfrac}% diff --git a/Master/texmf-dist/tex/generic/xint/xintgcd.sty b/Master/texmf-dist/tex/generic/xint/xintgcd.sty index 981520a4909..cc32e455e57 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.2o 2017/08/29 +%% The xint bundle 1.2p 2017/12/05 %% Copyright (C) 2013-2017 by Jean-Francois Burnol %% xintgcd: Euclidean algorithm with xint package %% --------------------------------------------------------------- @@ -70,24 +70,17 @@ \XINTsetupcatcodes% defined in xintkernel.sty \XINT_providespackage \ProvidesPackage{xintgcd}% - [2017/08/29 1.2o Euclide algorithm with xint package (JFB)]% + [2017/12/05 1.2p Euclide algorithm with xint package (JFB)]% \def\xintGCD {\romannumeral0\xintgcd }% -\def\xintgcd #1% -{% - \expandafter\XINT_gcd\expandafter{\romannumeral0\xintiabs {#1}}% -}% -\def\XINT_gcd #1#2% -{% - \expandafter\XINT_gcd_fork\romannumeral0\xintiabs {#2}\Z #1\Z -}% +\def\xintgcd #1#2{\xintiigcd {\xintNum{#1}}{\xintNum{#2}}}% \def\xintiiGCD {\romannumeral0\xintiigcd }% \def\xintiigcd #1% {% - \expandafter\XINT_iigcd\expandafter{\romannumeral0\xintiiabs {#1}}% + \expandafter\XINT_iigcd\expandafter{\romannumeral0\xintiiabs{#1}}% }% \def\XINT_iigcd #1#2% {% - \expandafter\XINT_gcd_fork\romannumeral0\xintiiabs {#2}\Z #1\Z + \expandafter\XINT_gcd_fork\romannumeral0\xintiiabs{#2}\Z #1\Z }% \def\XINT_gcd_fork #1#2\Z #3#4\Z {% @@ -114,22 +107,15 @@ {#1}% }% \def\xintLCM {\romannumeral0\xintlcm}% -\def\xintlcm #1% -{% - \expandafter\XINT_lcm\expandafter{\romannumeral0\xintiabs {#1}}% -}% -\def\XINT_lcm #1#2% -{% - \expandafter\XINT_lcm_fork\romannumeral0\xintiabs {#2}\Z #1\Z -}% +\def\xintlcm #1#2{\xintiilcm{\xintNum{#1}}{\xintNum{#2}}}% \def\xintiiLCM {\romannumeral0\xintiilcm}% \def\xintiilcm #1% {% - \expandafter\XINT_iilcm\expandafter{\romannumeral0\xintiiabs {#1}}% + \expandafter\XINT_iilcm\expandafter{\romannumeral0\xintiiabs{#1}}% }% \def\XINT_iilcm #1#2% {% - \expandafter\XINT_lcm_fork\romannumeral0\xintiiabs {#2}\Z #1\Z + \expandafter\XINT_lcm_fork\romannumeral0\xintiiabs{#2}\Z #1\Z }% \def\XINT_lcm_fork #1#2\Z #3#4\Z {% @@ -166,113 +152,135 @@ #3-\XINT_bezout_plusminus % A < 0, B > 0 --\XINT_bezout_plusplus % A > 0, B > 0 \krof - {#2}{#4}#1#3{#3#4}{#1#2}% #1#2=B, #3#4=A + {#2}{#4}#1#3% #1#2=B, #3#4=A }% -\def\XINT_bezout_botharezero #1\krof#2#3#4#5#6#7% - {\XINT_signalcondition{InvalidOperation} - {No Bezout identity for 0 and 0}{}{{0}{0}{0}{0}{0}}}% -\def\XINT_bezout_firstiszero #1\krof#2#3#4#5#6#7% +\def\XINT_bezout_botharezero #1\krof#2#300{{0}{0}{0}}% +\def\XINT_bezout_firstiszero #1\krof#2#3#4#5% {% \xint_UDsignfork - #4{{0}{#7}{0}{1}{#2}}% - -{{0}{#7}{0}{-1}{#7}}% + #4{{0}{-1}{#2}}% + -{{0}{1}{#4#2}}% \krof }% -\def\XINT_bezout_secondiszero #1\krof#2#3#4#5#6#7% +\def\XINT_bezout_secondiszero #1\krof#2#3#4#5% {% \xint_UDsignfork - #5{{#6}{0}{-1}{0}{#3}}% - -{{#6}{0}{1}{0}{#6}}% + #5{{-1}{0}{#3}}% + -{{1}{0}{#5#3}}% \krof }% \def\XINT_bezout_minusminus #1#2#3#4% {% \expandafter\XINT_bezout_mm_post - \romannumeral0\XINT_bezout_loop_a 1{#1}{#2}1001% + \romannumeral0\expandafter\XINT_bezout_preloop_a + \romannumeral0\XINT_div_prepare {#1}{#2}{#1}% }% \def\XINT_bezout_mm_post #1#2% {% \expandafter\XINT_bezout_mm_postb\expandafter {\romannumeral0\xintiiopp{#2}}{\romannumeral0\xintiiopp{#1}}% }% -\def\XINT_bezout_mm_postb #1#2% -{% - \expandafter\XINT_bezout_mm_postc\expandafter {#2}{#1}% -}% -\def\XINT_bezout_mm_postc #1#2#3#4#5{{#4}{#5}{#1}{#2}{#3}}% +\def\XINT_bezout_mm_postb #1#2{\expandafter{#2}{#1}}% \def\XINT_bezout_minusplus #1#2#3#4% {% \expandafter\XINT_bezout_mp_post - \romannumeral0\XINT_bezout_loop_a 1{#1}{#4#2}1001% + \romannumeral0\expandafter\XINT_bezout_preloop_a + \romannumeral0\XINT_div_prepare {#1}{#4#2}{#1}% }% \def\XINT_bezout_mp_post #1#2% {% - \expandafter\XINT_bezout_mp_postb\expandafter - {\romannumeral0\xintiiopp {#2}}{#1}% + \expandafter\xint_exchangetwo_keepbraces\expandafter + {\romannumeral0\xintiiopp {#2}}{#1}% }% -\def\XINT_bezout_mp_postb #1#2#3#4#5{{#4}{#5}{#2}{#1}{#3}}% \def\XINT_bezout_plusminus #1#2#3#4% {% \expandafter\XINT_bezout_pm_post - \romannumeral0\XINT_bezout_loop_a 1{#3#1}{#2}1001% + \romannumeral0\expandafter\XINT_bezout_preloop_a + \romannumeral0\XINT_div_prepare {#3#1}{#2}{#3#1}% +}% +\def\XINT_bezout_pm_post #1{\expandafter{\romannumeral0\xintiiopp{#1}}}% +\def\XINT_bezout_plusplus #1#2#3#4% +{% + \expandafter\XINT_bezout_preloop_a + \romannumeral0\XINT_div_prepare {#3#1}{#4#2}{#3#1}% }% -\def\XINT_bezout_pm_post #1% +\def\XINT_bezout_preloop_a #1#2#3% {% - \expandafter \XINT_bezout_pm_postb \expandafter - {\romannumeral0\xintiiopp{#1}}% + \if0#1\xint_dothis\XINT_bezout_preloop_exchange\fi + \if0#2\xint_dothis\XINT_bezout_preloop_exit\fi + \xint_orthat{\expandafter\XINT_bezout_loop_B}% + \romannumeral0\XINT_div_prepare {#2}{#3}{#2}{#1}110% }% -\def\XINT_bezout_pm_postb #1#2#3#4#5{{#4}{#5}{#1}{#2}{#3}}% -\def\XINT_bezout_plusplus #1#2#3#4% +\def\XINT_bezout_preloop_exit + \romannumeral0\XINT_div_prepare #1#2#3#4#5#6#7% {% - \expandafter\XINT_bezout_pp_post - \romannumeral0\XINT_bezout_loop_a 1{#3#1}{#4#2}1001% + {0}{1}{#2}% }% -\def\XINT_bezout_pp_post #1#2#3#4#5{{#4}{#5}{#1}{#2}{#3}}% -\def\XINT_bezout_loop_a #1#2#3% +\def\XINT_bezout_preloop_exchange {% - \expandafter\XINT_bezout_loop_b\the\numexpr -#1\expandafter.% - \romannumeral0\XINT_div_prepare {#2}{#3}{#2}% + \expandafter\xint_exchangetwo_keepbraces + \romannumeral0\expandafter\XINT_bezout_preloop_A }% -\def\XINT_bezout_loop_b #1.#2#3#4#5#6#7#8% +\def\XINT_bezout_preloop_A #1#2#3#4% {% - \expandafter\XINT_bezout_loop_c\expandafter - {\romannumeral0\xintiiadd{\XINT_mul_fork #5\xint:#2\xint:}{#7}}% - {\romannumeral0\xintiiadd{\XINT_mul_fork #6\xint:#2\xint:}{#8}}% - {#1}{#3}{#4}{#5}{#6}% + \if0#2\xint_dothis\XINT_bezout_preloop_exit\fi + \xint_orthat{\expandafter\XINT_bezout_loop_B}% + \romannumeral0\XINT_div_prepare {#2}{#3}{#2}{#1}% }% -\def\XINT_bezout_loop_c #1#2% +\def\XINT_bezout_loop_B #1#2% {% - \expandafter\XINT_bezout_loop_d\expandafter{#2}{#1}% + \if0#2\expandafter\XINT_bezout_exitA + \else\expandafter\XINT_bezout_loop_C + \fi {#1}{#2}% }% -\def\XINT_bezout_loop_d #1#2#3#4#5% +\def\XINT_bezout_loop_C #1#2#3#4#5#6#7% {% - \XINT_bezout_loop_e #4\Z {#3}{#5}{#2}{#1}% + \expandafter\XINT_bezout_loop_D\expandafter + {\romannumeral0\xintiiadd{\XINT_mul_plusplus{}{}#1\xint:#4\xint:}{#6}}% + {\romannumeral0\xintiiadd{\XINT_mul_plusplus{}{}#1\xint:#5\xint:}{#7}}% + {#2}{#3}{#4}{#5}% }% -\def\XINT_bezout_loop_e #1#2\Z +\def\XINT_bezout_loop_D #1#2% {% - \xint_gob_til_zero #1\XINT_bezout_loop_exit0\XINT_bezout_loop_f {#1#2}% + \expandafter\XINT_bezout_loop_E\expandafter{#2}{#1}% }% -\def\XINT_bezout_loop_f #1#2% +\def\XINT_bezout_loop_E #1#2#3#4% {% - \XINT_bezout_loop_a {#2}{#1}% + \expandafter\XINT_bezout_loop_b + \romannumeral0\XINT_div_prepare {#3}{#4}{#3}{#2}{#1}% }% -\def\XINT_bezout_loop_exit0\XINT_bezout_loop_f #1#2% +\def\XINT_bezout_loop_b #1#2% {% - \ifcase #2 - \or \expandafter\XINT_bezout_exiteven - \else\expandafter\XINT_bezout_exitodd - \fi + \if0#2\expandafter\XINT_bezout_exita + \else\expandafter\XINT_bezout_loop_c + \fi {#1}{#2}% +}% +\def\XINT_bezout_loop_c #1#2#3#4#5#6#7% +{% + \expandafter\XINT_bezout_loop_d\expandafter + {\romannumeral0\xintiiadd{\XINT_mul_plusplus{}{}#1\xint:#4\xint:}{#6}}% + {\romannumeral0\xintiiadd{\XINT_mul_plusplus{}{}#1\xint:#5\xint:}{#7}}% + {#2}{#3}{#4}{#5}% +}% +\def\XINT_bezout_loop_d #1#2% +{% + \expandafter\XINT_bezout_loop_e\expandafter{#2}{#1}% +}% +\def\XINT_bezout_loop_e #1#2#3#4% +{% + \expandafter\XINT_bezout_loop_B + \romannumeral0\XINT_div_prepare {#3}{#4}{#3}{#2}{#1}% }% -\def\XINT_bezout_exiteven #1#2#3#4#5{{#5}{#4}{#1}}% -\def\XINT_bezout_exitodd #1#2#3#4#5{{-#5}{-#4}{#1}}% +\def\XINT_bezout_exita #1#2#3#4#5#6#7{{-#5}{#4}{#3}}% +\def\XINT_bezout_exitA #1#2#3#4#5#6#7{{#5}{-#4}{#3}}% \def\xintEuclideAlgorithm {\romannumeral0\xinteuclidealgorithm }% \def\xinteuclidealgorithm #1% {% - \expandafter\XINT_euc\expandafter{\romannumeral0\xintiabs {#1}}% + \expandafter\XINT_euc\expandafter{\romannumeral0\xintiiabs{\xintNum{#1}}}% }% \def\XINT_euc #1#2% {% - \expandafter\XINT_euc_fork\romannumeral0\xintiabs {#2}\Z #1\Z + \expandafter\XINT_euc_fork\romannumeral0\xintiiabs{\xintNum{#2}}\Z #1\Z }% \def\XINT_euc_fork #1#2\Z #3#4\Z {% @@ -312,11 +320,12 @@ \def\xintBezoutAlgorithm {\romannumeral0\xintbezoutalgorithm }% \def\xintbezoutalgorithm #1% {% - \expandafter \XINT_bezalg \expandafter{\romannumeral0\xintiabs {#1}}% + \expandafter \XINT_bezalg + \expandafter{\romannumeral0\xintiiabs{\xintNum{#1}}}% }% \def\XINT_bezalg #1#2% {% - \expandafter\XINT_bezalg_fork \romannumeral0\xintiabs {#2}\Z #1\Z + \expandafter\XINT_bezalg_fork\romannumeral0\xintiiabs{\xintNum{#2}}\Z #1\Z }% \def\XINT_bezalg_fork #1#2\Z #3#4\Z {% diff --git a/Master/texmf-dist/tex/generic/xint/xintkernel.sty b/Master/texmf-dist/tex/generic/xint/xintkernel.sty index 2a9707aab89..6a2710b0f56 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.2o 2017/08/29 +%% The xint bundle 1.2p 2017/12/05 %% Copyright (C) 2013-2017 by Jean-Francois Burnol %% xintkernel: Paraphernalia for the xint packages %% --------------------------------------------------------------- @@ -156,7 +156,7 @@ \fi \XINT_providespackage \ProvidesPackage {xintkernel}% - [2017/08/29 1.2o Paraphernalia for the xint packages (JFB)]% + [2017/12/05 1.2p Paraphernalia for the xint packages (JFB)]% \chardef\xint_c_ 0 \chardef\xint_c_i 1 \chardef\xint_c_ii 2 diff --git a/Master/texmf-dist/tex/generic/xint/xintseries.sty b/Master/texmf-dist/tex/generic/xint/xintseries.sty index 7adc2b328da..4f2350f24b5 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.2o 2017/08/29 +%% The xint bundle 1.2p 2017/12/05 %% Copyright (C) 2013-2017 by Jean-Francois Burnol %% xintseries: Expandable partial sums with xint package %% --------------------------------------------------------------- @@ -70,7 +70,7 @@ \XINTsetupcatcodes% defined in xintkernel.sty \XINT_providespackage \ProvidesPackage{xintseries}% - [2017/08/29 1.2o Expandable partial sums with xint package (JFB)]% + [2017/12/05 1.2p 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 2c522f602f7..9c041bef7d3 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.2o 2017/08/29 +%% The xint bundle 1.2p 2017/12/05 %% Copyright (C) 2013-2017 by Jean-Francois Burnol %% xinttools: Expandable and non-expandable utilities %% --------------------------------------------------------------- @@ -70,7 +70,7 @@ \XINTsetupcatcodes% defined in xintkernel.sty \XINT_providespackage \ProvidesPackage{xinttools}% - [2017/08/29 1.2o Expandable and non-expandable utilities (JFB)]% + [2017/12/05 1.2p Expandable and non-expandable utilities (JFB)]% \newtoks\XINT_toks \xint_firstofone{\let\XINT_sptoken= } %<- space here! \def\xintgodef {\global\xintodef }% @@ -221,25 +221,49 @@ { #9{#1}{#2}{#3}{#4}{#5}{#6}}% \long\def\XINT_csvtol_finish_di\Z #1#2#3#4#5#6#7#8#9% { #9{#1}{#2}{#3}{#4}{#5}{#6}{#7}}% -\def\xintListWithSep {\romannumeral0\xintlistwithsep }% +\def\xintListWithSep {\romannumeral0\xintlistwithsep }% \def\xintListWithSepNoExpand {\romannumeral0\xintlistwithsepnoexpand }% \long\def\xintlistwithsep #1#2% {\expandafter\XINT_lws\expandafter {\romannumeral`&&@#2}{#1}}% -\long\def\XINT_lws #1#2{\XINT_lws_start {#2}#1\xint_bye }% -\long\def\xintlistwithsepnoexpand #1#2{\XINT_lws_start {#1}#2\xint_bye }% -\long\def\XINT_lws_start #1#2% -{% - \xint_bye #2\XINT_lws_dont\xint_bye - \XINT_lws_loop_a {#2}{#1}% -}% -\long\def\XINT_lws_dont\xint_bye\XINT_lws_loop_a #1#2{ }% -\long\def\XINT_lws_loop_a #1#2#3% -{% - \xint_bye #3\XINT_lws_end\xint_bye - \XINT_lws_loop_b {#1}{#2#3}{#2}% -}% -\long\def\XINT_lws_loop_b #1#2{\XINT_lws_loop_a {#1#2}}% -\long\def\XINT_lws_end\xint_bye\XINT_lws_loop_b #1#2#3{ #1}% +\long\def\xintlistwithsepnoexpand #1#2% +{% + \XINT_lws_loop_a {#1}#2{\xint_bye\XINT_lws_e_vi}% + {\xint_bye\XINT_lws_e_v}{\xint_bye\XINT_lws_e_iv}% + {\xint_bye\XINT_lws_e_iii}{\xint_bye\XINT_lws_e_ii}% + {\xint_bye\XINT_lws_e_i}{\xint_bye\XINT_lws_e}% + {\xint_bye\expandafter\space}\xint_bye +}% +\long\def\XINT_lws #1#2% +{% + \XINT_lws_loop_a {#2}#1{\xint_bye\XINT_lws_e_vi}% + {\xint_bye\XINT_lws_e_v}{\xint_bye\XINT_lws_e_iv}% + {\xint_bye\XINT_lws_e_iii}{\xint_bye\XINT_lws_e_ii}% + {\xint_bye\XINT_lws_e_i}{\xint_bye\XINT_lws_e}% + {\xint_bye\expandafter\space}\xint_bye +}% +\long\def\XINT_lws_loop_a #1#2#3#4#5#6#7#8#9% +{% + \xint_bye #9\xint_bye + \XINT_lws_loop_b {#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}{#9}% +}% +\long\def\XINT_lws_loop_b #1#2#3#4#5#6#7#8#9% +{% + \XINT_lws_loop_a {#1}{#2#1#3#1#4#1#5#1#6#1#7#1#8#1#9}% +}% +\long\def\XINT_lws_e_vi\xint_bye\XINT_lws_loop_b #1#2#3#4#5#6#7#8#9\xint_bye + { #2#1#3#1#4#1#5#1#6#1#7#1#8}% +\long\def\XINT_lws_e_v\xint_bye\XINT_lws_loop_b #1#2#3#4#5#6#7#8\xint_bye + { #2#1#3#1#4#1#5#1#6#1#7}% +\long\def\XINT_lws_e_iv\xint_bye\XINT_lws_loop_b #1#2#3#4#5#6#7\xint_bye + { #2#1#3#1#4#1#5#1#6}% +\long\def\XINT_lws_e_iii\xint_bye\XINT_lws_loop_b #1#2#3#4#5#6\xint_bye + { #2#1#3#1#4#1#5}% +\long\def\XINT_lws_e_ii\xint_bye\XINT_lws_loop_b #1#2#3#4#5\xint_bye + { #2#1#3#1#4}% +\long\def\XINT_lws_e_i\xint_bye\XINT_lws_loop_b #1#2#3#4\xint_bye + { #2#1#3}% +\long\def\XINT_lws_e\xint_bye\XINT_lws_loop_b #1#2#3\xint_bye + { #2}% \def\xintNthElt {\romannumeral0\xintnthelt }% \def\xintNthEltNoExpand {\romannumeral0\xintntheltnoexpand }% \long\def\xintnthelt #1#2{\expandafter\XINT_nthelt_a\the\numexpr #1\expandafter.% |