From d9dac37ce48e9caf9f59e903857484b52bec72cb Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 24 Sep 2013 22:26:51 +0000 Subject: xint (24sep13) git-svn-id: svn://tug.org/texlive/trunk@31744 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/generic/xint/xint.sty | 329 +++++- Master/texmf-dist/tex/generic/xint/xintbinhex.sty | 8 +- Master/texmf-dist/tex/generic/xint/xintcfrac.sty | 36 +- Master/texmf-dist/tex/generic/xint/xintexpr.sty | 1112 +++++++++++++-------- Master/texmf-dist/tex/generic/xint/xintfrac.sty | 303 ++++-- Master/texmf-dist/tex/generic/xint/xintgcd.sty | 68 +- Master/texmf-dist/tex/generic/xint/xintseries.sty | 24 +- 7 files changed, 1312 insertions(+), 568 deletions(-) (limited to 'Master/texmf-dist/tex/generic/xint') diff --git a/Master/texmf-dist/tex/generic/xint/xint.sty b/Master/texmf-dist/tex/generic/xint/xint.sty index 21911c686ee..3b0f6239b6d 100644 --- a/Master/texmf-dist/tex/generic/xint/xint.sty +++ b/Master/texmf-dist/tex/generic/xint/xint.sty @@ -22,7 +22,7 @@ %% in the same archive or directory.) %% %%---------------------------------------------------------------- -%% The xint bundle (version 1.08b of June 14, 2013) +%% The xint bundle (version 1.09a of September 22, 2013) %% xint: Expandable operations on long numbers %% Copyright (C) 2013 by Jean-Francois Burnol %%---------------------------------------------------------------- @@ -140,7 +140,7 @@ \fi \expandafter\x\csname ver@xint.sty\endcsname \ProvidesPackage{xint}% - [2013/06/14 v1.08b Expandable operations on long numbers (jfB)]% + [2013/09/24 v1.09a Expandable operations on long numbers (jfB)]% \def\xint_gobble_ {}% \def\xint_gobble_i #1{}% \def\xint_gobble_ii #1#2{}% @@ -271,7 +271,7 @@ \def\xintilen #1% {% \expandafter\XINT_length_fork - \romannumeral-`0#1\xint_relax\xint_relax\xint_relax\xint_relax + \romannumeral0\xintnum{#1}\xint_relax\xint_relax\xint_relax\xint_relax \xint_relax\xint_relax\xint_relax\xint_relax\Z }% \let\xintLen\xintiLen \let\xintlen\xintilen @@ -474,6 +474,17 @@ \def\XINT_applyunbr_loop_b #1#2{\XINT_applyunbr_loop_a {#2#1}}% \def\XINT_applyunbr_end\Z \expandafter\XINT_applyunbr_loop_b\expandafter #1#2#3{ #2}% +\def\xintApplyInline #1#2% +{% + \def\XINT_apply_themacro {#1}% + \expandafter\XINT_applyinline_a\romannumeral-`0#2:% +}% +\def\XINT_applyinline_a {\futurelet\XINT_apply_nexttoken\XINT_applyinline_b }% +\def\XINT_applyinline_b #1% +{% + \ifx\XINT_apply_nexttoken :\expandafter\xint_gobble_iii\fi + \XINT_apply_themacro {#1}\XINT_applyinline_a +}% \def\xintAssign #1\to {% \expandafter\XINT_assign_a\romannumeral-`0#1{}\to @@ -706,6 +717,8 @@ }% \def\XINT_cuz_stop #1\W #2\Z{ #1}% \def\xint_cuz_backtoloop 0\XINT_cuz_stop 0{\XINT_cuz_loop }% +\def\xintIsOne {\romannumeral0\xintisone }% +\def\xintisone #1{\expandafter\XINT_isone \romannumeral0\xintnum{#1}\W\Z }% \def\XINT_isOne #1{\romannumeral0\XINT_isone #1\W\Z }% \def\XINT_isone #1#2% {% @@ -762,7 +775,11 @@ {% \expandafter\XINT_sgn \romannumeral-`0#1\Z% }% -\let\xintSgn\xintiSgn \let\xintsgn\xintisgn +\def\xintSgn {\romannumeral0\xintsgn }% +\def\xintsgn #1% +{% + \expandafter\XINT_sgn \romannumeral0\xintnum{#1}\Z% +}% \def\XINT_Sgn #1{\romannumeral0\XINT_sgn #1\Z }% \def\XINT_sgn #1#2\Z {% @@ -780,10 +797,66 @@ \else\xint_afterfi{\expandafter\space\xint_firstofthree}% \fi }% +\def\xintifSgn {\romannumeral0\xintifsgn }% +\def\xintifsgn #1% +{% + \ifcase \romannumeral0\xintsgn{#1} + \xint_afterfi{\expandafter\space\xint_secondofthree}% + \or\xint_afterfi{\expandafter\space\xint_thirdofthree}% + \else\xint_afterfi{\expandafter\space\xint_firstofthree}% + \fi +}% +\def\xintifZero {\romannumeral0\xintifzero }% +\def\xintifzero #1% +{% + \if\xintSgn{\xintAbs{#1}}0% + \xint_afterfi{\expandafter\space\xint_firstoftwo}% + \else + \xint_afterfi{\expandafter\space\xint_secondoftwo}% + \fi +}% +\def\xintifNotZero {\romannumeral0\xintifnotzero }% +\def\xintifnotzero #1% +{% + \if\xintSgn{\xintAbs{#1}}1% + \xint_afterfi{\expandafter\space\xint_firstoftwo}% + \else + \xint_afterfi{\expandafter\space\xint_secondoftwo}% + \fi +}% +\def\xintifEq {\romannumeral0\xintifeq }% +\def\xintifeq #1#2% +{% + \if\xintCmp{#1}{#2}0% + \xint_afterfi{\expandafter\space\xint_firstoftwo}% + \else\xint_afterfi{\expandafter\space\xint_secondoftwo}% + \fi +}% +\def\xintifGt {\romannumeral0\xintifgt }% +\def\xintifgt #1#2% +{% + \if\xintCmp{#1}{#2}1% + \xint_afterfi{\expandafter\space\xint_firstoftwo}% + \else\xint_afterfi{\expandafter\space\xint_secondoftwo}% + \fi +}% +\def\xintifLt {\romannumeral0\xintiflt }% +\def\xintiflt #1#2% +{% + \xintSgnFork{\xintCmp{#1}{#2}}% + {\expandafter\space\xint_firstoftwo}% + {\expandafter\space\xint_secondoftwo}% + {\expandafter\space\xint_secondoftwo}% +}% +\def\xintiiOpp {\romannumeral0\xintiiopp }% +\def\xintiiopp #1% +{% + \expandafter\XINT_opp \romannumeral-`0#1% +}% \def\xintiOpp {\romannumeral0\xintiopp }% \def\xintiopp #1% {% - \expandafter\XINT_opp \romannumeral-`0#1% + \expandafter\XINT_opp \romannumeral0\xintnum{#1}% }% \let\xintOpp\xintiOpp \let\xintopp\xintiopp \def\XINT_Opp #1{\romannumeral0\XINT_opp #1}% @@ -795,10 +868,15 @@ 0-\dummy { -#1}% positive \krof }% +\def\xintiiAbs {\romannumeral0\xintiiabs }% +\def\xintiiabs #1% +{% + \expandafter\XINT_abs \romannumeral-`0#1% +}% \def\xintiAbs {\romannumeral0\xintiabs }% \def\xintiabs #1% {% - \expandafter\XINT_abs \romannumeral-`0#1% + \expandafter\XINT_abs \romannumeral0\xintnum{#1}% }% \let\xintAbs\xintiAbs \let\xintabs\xintiabs \def\XINT_Abs #1{\romannumeral0\XINT_abs #1}% @@ -1131,16 +1209,25 @@ \def\XINT_addp_endGy_zeros 0000\XINT_addp_endGy 0000#1\Z{ #1}% \def\XINT_addp_endGy #1#2#3#4#5\Z{ #5#1#2#3#4}% \def\xint_addp_Gz\W\XINT_addp_G #1#2{ #2}% +\def\xintiiAdd {\romannumeral0\xintiiadd }% +\def\xintiiadd #1% +{% + \expandafter\xint_iiadd\expandafter{\romannumeral-`0#1}% +}% +\def\xint_iiadd #1#2% +{% + \expandafter\XINT_add_fork \romannumeral-`0#2\Z #1\Z +}% \def\xintiAdd {\romannumeral0\xintiadd }% \def\xintiadd #1% {% - \expandafter\xint_add\expandafter{\romannumeral-`0#1}% + \expandafter\xint_add\expandafter{\romannumeral0\xintnum{#1}}% }% -\let\xintAdd\xintiAdd \let\xintadd\xintiadd \def\xint_add #1#2% {% - \expandafter\XINT_add_fork \romannumeral-`0#2\Z #1\Z + \expandafter\XINT_add_fork \romannumeral0\xintnum{#2}\Z #1\Z }% +\let\xintAdd\xintiAdd \let\xintadd\xintiadd \def\XINT_Add #1#2{\romannumeral0\XINT_add_fork #2\Z #1\Z }% \def\XINT_add #1#2{\XINT_add_fork #2\Z #1\Z }% \def\XINT_add_fork #1#2\Z #3#4\Z @@ -1189,18 +1276,27 @@ \romannumeral0\XINT_RQ {}#2\R\R\R\R\R\R\R\R\Z \W\X\Y\Z #1\W\X\Y\Z }% +\def\xintiiSub {\romannumeral0\xintiisub }% +\def\xintiisub #1% +{% + \expandafter\xint_iisub\expandafter{\romannumeral-`0#1}% +}% +\def\xint_iisub #1#2% +{% + \expandafter\XINT_sub_fork \romannumeral-`0#2\Z #1\Z +}% \def\xintiSub {\romannumeral0\xintisub }% \def\xintisub #1% {% - \expandafter\xint_sub\expandafter{\romannumeral-`0#1}% + \expandafter\xint_sub\expandafter{\romannumeral0\xintnum{#1}}% }% -\let\xintSub\xintiSub \let\xintsub\xintisub \def\xint_sub #1#2% {% - \expandafter\XINT_sub_fork \romannumeral-`0#2\Z #1\Z + \expandafter\XINT_sub_fork \romannumeral0\xintnum{#2}\Z #1\Z }% \def\XINT_Sub #1#2{\romannumeral0\XINT_sub_fork #2\Z #1\Z }% \def\XINT_sub #1#2{\XINT_sub_fork #2\Z #1\Z }% +\let\xintSub\xintiSub \let\xintsub\xintisub \def\XINT_sub_fork #1#2\Z #3#4\Z {% \xint_UDsignsfork @@ -1442,12 +1538,12 @@ \def\xintiCmp {\romannumeral0\xinticmp }% \def\xinticmp #1% {% - \expandafter\xint_cmp\expandafter{\romannumeral-`0#1}% + \expandafter\xint_cmp\expandafter{\romannumeral0\xintnum{#1}}% }% \let\xintCmp\xintiCmp \let\xintcmp\xinticmp \def\xint_cmp #1#2% {% - \expandafter\XINT_cmp_fork \romannumeral-`0#2\Z #1\Z + \expandafter\XINT_cmp_fork \romannumeral0\xintnum{#2}\Z #1\Z }% \def\XINT_Cmp #1#2{\romannumeral0\XINT_cmp_fork #2\Z #1\Z }% \def\XINT_cmp_fork #1#2\Z #3#4\Z @@ -1546,15 +1642,94 @@ \def\XINT_OneIfPositive_finish #1\W\X\Y\Z{ 1}% \def\xint_OneIfPositive_backtomain 0\XINT_OneIfPositive_finish 0% {\XINT_OneIfPositive_main }% +\def\xintEq {\romannumeral0\xinteq }% +\def\xinteq #1#2{\xintifeq{#1}{#2}{1}{0}}% +\def\xintGt {\romannumeral0\xintgt }% +\def\xintgt #1#2{\xintifgt{#1}{#2}{1}{0}}% +\def\xintLt {\romannumeral0\xintlt }% +\def\xintlt #1#2{\xintiflt{#1}{#2}{1}{0}}% +\def\xintIsZero {\romannumeral0\xintiszero }% +\def\xintiszero #1{\xintifsgn {#1}{0}{1}{0}}% +\def\xintIsNotZero {\romannumeral0\xintisnotzero }% +\def\xintisnotzero #1{\xintifsgn {#1}{1}{0}{1}}% +\def\xintAND {\romannumeral0\xintand }% +\def\xintand #1#2{\xintifzero {#1}{0}{\xintifzero {#2}{0}{1}}}% +\def\xintOR {\romannumeral0\xintor }% +\def\xintor #1#2{\xintifzero {#1}{\xintifzero {#2}{0}{1}}{1}}% +\def\xintXOR {\romannumeral0\xintxor }% +\def\xintxor #1#2{\ifcase \numexpr\xintIsZero{#1}+\xintIsZero{#2}\relax + \xint_afterfi{ 0}% + \or\xint_afterfi{ 1}% + \else\xint_afterfi { 0}% + \fi }% +\def\xintANDof {\romannumeral0\xintandof }% +\def\xintandof #1{\expandafter\XINT_andof_a\romannumeral-`0#1\relax }% +\def\XINT_andof_a #1{\expandafter\XINT_andof_b\romannumeral-`0#1\Z }% +\def\XINT_andof_b #1% + {\xint_gob_til_relax #1\XINT_andof_e\relax\XINT_andof_c #1}% +\def\XINT_andof_c #1\Z + {\xintifZero{#1}{\XINT_andof_no}{\XINT_andof_a}}% +\def\XINT_andof_no #1\relax { 0}% +\def\XINT_andof_e #1\Z { 1}% +\def\xintANDof:csv #1{\expandafter\XINT_andof:_a\romannumeral-`0#1,,^}% +\def\XINT_andof:_a {\expandafter\XINT_andof:_b\romannumeral-`0}% +\def\XINT_andof:_b #1{\if #1,\expandafter\XINT_andof:_e + \else\expandafter\XINT_andof:_c\fi #1}% +\def\XINT_andof:_c #1,{\xintifZero{#1}{\XINT_andof:_no}{\XINT_andof:_a}}% +\def\XINT_andof:_no #1^{0}% +\def\XINT_andof:_e #1^{1}% +\def\xintORof {\romannumeral0\xintorof }% +\def\xintorof #1{\expandafter\XINT_orof_a\romannumeral-`0#1\relax }% +\def\XINT_orof_a #1{\expandafter\XINT_orof_b\romannumeral-`0#1\Z }% +\def\XINT_orof_b #1% + {\xint_gob_til_relax #1\XINT_orof_e\relax\XINT_orof_c #1}% +\def\XINT_orof_c #1\Z + {\xintifZero{#1}{\XINT_orof_a}{\XINT_orof_yes}}% +\def\XINT_orof_yes #1\relax { 1}% +\def\XINT_orof_e #1\Z { 0}% +\def\xintORof:csv #1{\expandafter\XINT_orof:_a\romannumeral-`0#1,,^}% +\def\XINT_orof:_a {\expandafter\XINT_orof:_b\romannumeral-`0}% +\def\XINT_orof:_b #1{\if #1,\expandafter\XINT_orof:_e + \else\expandafter\XINT_orof:_c\fi #1}% +\def\XINT_orof:_c #1,{\xintifZero{#1}{\XINT_orof:_a}{\XINT_orof:_yes}}% +\def\XINT_orof:_yes #1^{1}% +\def\XINT_orof:_e #1^{0}% +\def\xintXORof {\romannumeral0\xintxorof }% +\def\xintxorof #1{\expandafter\XINT_xorof_a\expandafter + 0\romannumeral-`0#1\relax }% +\def\XINT_xorof_a #1#2{\expandafter\XINT_xorof_b\romannumeral-`0#2\Z #1}% +\def\XINT_xorof_b #1% + {\xint_gob_til_relax #1\XINT_xorof_e\relax\XINT_xorof_c #1}% +\def\XINT_xorof_c #1\Z #2% + {\xintifZero {#1}{\XINT_xorof_a #2}{\ifcase #2 + \xint_afterfi{\XINT_xorof_a 1}% + \else + \xint_afterfi{\XINT_xorof_a 0}% + \fi }% + }% +\def\XINT_xorof_e #1\Z #2{ #2}% +\def\xintXORof:csv #1{\expandafter\XINT_xorof:_a\expandafter + 0\romannumeral-`0#1,,^}% +\def\XINT_xorof:_a #1#2,{\expandafter\XINT_xorof:_b\romannumeral-`0#2,#1}% +\def\XINT_xorof:_b #1{\if #1,\expandafter\XINT_xorof:_e + \else\expandafter\XINT_xorof:_c\fi #1}% +\def\XINT_xorof:_c #1,#2% + {\xintifZero {#1}{\XINT_xorof:_a #2}{\ifcase #2 + \xint_afterfi{\XINT_xorof:_a 1}% + \else + \xint_afterfi{\XINT_xorof:_a 0}% + \fi }% + }% +\def\XINT_xorof:_e ,#1#2^{#1}% allows empty list \def\xintiGeq {\romannumeral0\xintigeq }% \def\xintigeq #1% {% - \expandafter\xint_geq\expandafter {\romannumeral-`0#1}% + \expandafter\xint_geq\expandafter {\romannumeral0\xintnum{#1}}% }% \let\xintGeq\xintiGeq \let\xintgeq\xintigeq \def\xint_geq #1#2% {% - \expandafter\XINT_geq_fork \romannumeral-`0#2\Z #1\Z + \expandafter\XINT_geq_fork \romannumeral0\xintnum{#2}\Z #1\Z }% \def\XINT_Geq #1#2{\romannumeral0\XINT_geq_fork #2\Z #1\Z }% \def\XINT_geq_fork #1#2\Z #3#4\Z @@ -1624,12 +1799,12 @@ \def\xintiMax {\romannumeral0\xintimax }% \def\xintimax #1% {% - \expandafter\xint_max\expandafter {\romannumeral-`0#1}% + \expandafter\xint_max\expandafter {\romannumeral0\xintnum{#1}}% }% \let\xintMax\xintiMax \let\xintmax\xintimax \def\xint_max #1#2% {% - \expandafter\XINT_max_pre\expandafter {\romannumeral-`0#2}{#1}% + \expandafter\XINT_max_pre\expandafter {\romannumeral0\xintnum{#2}}{#1}% }% \def\XINT_max_pre #1#2{\XINT_max_fork #1\Z #2\Z {#2}{#1}}% \def\XINT_Max #1#2{\romannumeral0\XINT_max_fork #2\Z #1\Z {#1}{#2}}% @@ -1669,15 +1844,26 @@ \expandafter\xint_secondoftwo_andstop \fi }% +\def\xintiMaxof {\romannumeral0\xintimaxof }% +\def\xintimaxof #1{\expandafter\XINT_imaxof_a\romannumeral-`0#1\relax }% +\def\XINT_imaxof_a #1{\expandafter\XINT_imaxof_b\romannumeral0\xintnum{#1}\Z }% +\def\XINT_imaxof_b #1\Z #2% + {\expandafter\XINT_imaxof_c\romannumeral-`0#2\Z {#1}\Z}% +\def\XINT_imaxof_c #1% + {\xint_gob_til_relax #1\XINT_imaxof_e\relax\XINT_imaxof_d #1}% +\def\XINT_imaxof_d #1\Z + {\expandafter\XINT_imaxof_b\romannumeral0\xintimax {#1}}% +\def\XINT_imaxof_e #1\Z #2\Z { #2}% +\let\xintMaxof\xintiMaxof \let\xintmaxof\xintimaxof \def\xintiMin {\romannumeral0\xintimin }% \def\xintimin #1% {% - \expandafter\xint_min\expandafter {\romannumeral-`0#1}% + \expandafter\xint_min\expandafter {\romannumeral0\xintnum{#1}}% }% \let\xintMin\xintiMin \let\xintmin\xintimin \def\xint_min #1#2% {% - \expandafter\XINT_min_pre\expandafter {\romannumeral-`0#2}{#1}% + \expandafter\XINT_min_pre\expandafter {\romannumeral0\xintnum{#2}}{#1}% }% \def\XINT_min_pre #1#2{\XINT_min_fork #1\Z #2\Z {#2}{#1}}% \def\XINT_Min #1#2{\romannumeral0\XINT_min_fork #2\Z #1\Z {#1}{#2}}% @@ -1717,6 +1903,17 @@ \expandafter\xint_firstoftwo_andstop \fi }% +\def\xintiMinof {\romannumeral0\xintiminof }% +\def\xintiminof #1{\expandafter\XINT_iminof_a\romannumeral-`0#1\relax }% +\def\XINT_iminof_a #1{\expandafter\XINT_iminof_b\romannumeral0\xintnum{#1}\Z }% +\def\XINT_iminof_b #1\Z #2% + {\expandafter\XINT_iminof_c\romannumeral-`0#2\Z {#1}\Z}% +\def\XINT_iminof_c #1% + {\xint_gob_til_relax #1\XINT_iminof_e\relax\XINT_iminof_d #1}% +\def\XINT_iminof_d #1\Z + {\expandafter\XINT_iminof_b\romannumeral0\xintimin {#1}}% +\def\XINT_iminof_e #1\Z #2\Z { #2}% +\let\xintMinof\xintiMinof \let\xintminof\xintiminof \def\xintiSum {\romannumeral0\xintisum }% \def\xintisum #1{\xintisumexpr #1\relax }% \def\xintiSumExpr {\romannumeral0\xintisumexpr }% @@ -1759,16 +1956,25 @@ \W\X\Y\Z #3\W\X\Y\Z }{#2}% }% \def\XINT_sum_NN #1#2{\XINT_sum_loop {#2}{#1}}% +\def\xintiiMul {\romannumeral0\xintiimul }% +\def\xintiimul #1% +{% + \expandafter\xint_iimul\expandafter {\romannumeral-`0#1}% +}% +\def\xint_iimul #1#2% +{% + \expandafter\XINT_mul_fork \romannumeral-`0#2\Z #1\Z +}% \def\xintiMul {\romannumeral0\xintimul }% \def\xintimul #1% {% - \expandafter\xint_mul\expandafter {\romannumeral-`0#1}% + \expandafter\xint_mul\expandafter {\romannumeral0\xintnum{#1}}% }% -\let\xintMul\xintiMul \let\xintmul\xintimul \def\xint_mul #1#2% {% - \expandafter\XINT_mul_fork \romannumeral-`0#2\Z #1\Z + \expandafter\XINT_mul_fork \romannumeral0\xintnum{#2}\Z #1\Z }% +\let\xintMul\xintiMul \let\xintmul\xintimul \def\XINT_Mul #1#2{\romannumeral0\XINT_mul_fork #2\Z #1\Z }% \def\XINT_mul_fork #1#2\Z #3#4\Z {% @@ -2128,6 +2334,11 @@ \romannumeral0\XINT_mul_Mr {#2}#4\Z\Z\Z\Z \W\X\Y\Z 0#3\W\X\Y\Z }% \def\XINT_mulr_finish_c #1\XINT_mulr_finish_ciii \W\W\W\W #2#3\Z\Z\Z\Z { #2}% +\def\xintiiSqr {\romannumeral0\xintiisqr }% +\def\xintiisqr #1% +{% + \expandafter\XINT_sqr\expandafter {\romannumeral0\xintiiabs{#1}}% +}% \def\xintiSqr {\romannumeral0\xintisqr }% \def\xintisqr #1% {% @@ -2169,7 +2380,11 @@ {% \expandafter\XINT_fac_fork\expandafter{\the\numexpr #1}% }% -\let\xintFac\xintiFac \let\xintfac\xintifac +\def\xintFac {\romannumeral0\xintfac }% +\def\xintfac #1% +{% + \expandafter\XINT_fac_fork\expandafter{\romannumeral0\xintnum{#1}}% +}% \def\XINT_fac_fork #1% {% \ifcase\XINT_Sgn {#1} @@ -2250,7 +2465,7 @@ \def\xintiPow {\romannumeral0\xintipow }% \def\xintipow #1% {% - \expandafter\xint_pow\romannumeral-`0#1\Z% + \expandafter\xint_pow\romannumeral0\xintnum{#1}\Z% }% \let\xintPow\xintiPow \let\xintpow\xintipow \def\xint_pow #1#2\Z @@ -2338,7 +2553,7 @@ \xint_afterfi{\expandafter\XINT_pow_loop_a \expandafter{\the\numexpr 2*(#1/2)-#1\expandafter }% b mod 2 \expandafter{\the\numexpr #1-#1/2\expandafter }% [b/2] - \expandafter{\romannumeral0\xintisqr{#2}}}% + \expandafter{\romannumeral0\xintiisqr{#2}}}% \fi {{#2}}% }% @@ -2400,12 +2615,12 @@ \def\xintiDivision {\romannumeral0\xintidivision }% \def\xintidivision #1% {% - \expandafter\xint_division\expandafter {\romannumeral-`0#1}% + \expandafter\xint_division\expandafter {\romannumeral0\xintnum{#1}}% }% \let\xintDivision\xintiDivision \let\xintdivision\xintidivision \def\xint_division #1#2% {% - \expandafter\XINT_div_fork \romannumeral-`0#2\Z #1\Z + \expandafter\XINT_div_fork \romannumeral0\xintnum{#2}\Z #1\Z }% \def\XINT_Division #1#2{\romannumeral0\XINT_div_fork #2\Z #1\Z }% \def\XINT_div_fork #1#2\Z #3#4\Z @@ -2458,7 +2673,7 @@ \def\XINT_div_AisNegative_posrem #1% {% \expandafter \XINT_div_AisNegative_posrem_b \expandafter - {\romannumeral0\xintiopp{\xintInc {#1}}}% + {\romannumeral0\xintiiopp{\xintInc {#1}}}% }% \def\XINT_div_AisNegative_posrem_b #1#2#3% {% @@ -2618,14 +2833,14 @@ \def\XINT_div_final_dP #1#2#3#4#5% q,A,Q,L,B (puis c) {% \expandafter \XINT_div_final_f \expandafter - {\romannumeral0\xintisub {#2}% + {\romannumeral0\xintiisub {#2}% {\romannumeral0\XINT_mul_M {#1}#5\Z\Z\Z\Z }}% {\romannumeral0\XINT_add_A 0{}#1000\W\X\Y\Z #3\W\X\Y\Z }% }% \def\XINT_div_final_db #1#2#3#4#5% q,A,Q,L,B (puis c) {% \expandafter\XINT_div_final_dc\expandafter - {\romannumeral0\xintisub {#2}% + {\romannumeral0\xintiisub {#2}% {\romannumeral0\XINT_mul_M {#1}#5\Z\Z\Z\Z }}% {#1}{#2}{#3}{#4}{#5}% }% @@ -2882,7 +3097,11 @@ {% \expandafter\XINT_fdg \romannumeral-`0#1\W\Z }% -\let\xintFDg\xintiFDg \let\xintfdg\xintifdg +\def\xintFDg {\romannumeral0\xintfdg }% +\def\xintfdg #1% +{% + \expandafter\XINT_fdg \romannumeral0\xintnum{#1}\W\Z +}% \def\XINT_FDg #1{\romannumeral0\XINT_fdg #1\W\Z }% \def\XINT_fdg #1#2#3\Z {% @@ -2897,7 +3116,11 @@ {% \expandafter\XINT_ldg\expandafter {\romannumeral-`0#1}% }% -\let\xintLDg\xintiLDg \let\xintldg\xintildg +\def\xintLDg {\romannumeral0\xintldg }% +\def\xintldg #1% +{% + \expandafter\XINT_ldg\expandafter {\romannumeral0\xintnum{#1}}% +}% \def\XINT_LDg #1{\romannumeral0\XINT_ldg {#1}}% \def\XINT_ldg #1% {% @@ -2922,8 +3145,24 @@ \xint_afterfi{ -1}% \fi }% -\let\xintMON\xintiMON \let\xintmon\xintimon -\let\xintMMON\xintiMMON \let\xintmmon\xintimmon +\def\xintMON {\romannumeral0\xintmon }% +\def\xintmon #1% +{% + \ifodd\xintLDg {#1} + \xint_afterfi{ -1}% + \else + \xint_afterfi{ 1}% + \fi +}% +\def\xintMMON {\romannumeral0\xintmmon }% +\def\xintmmon #1% +{% + \ifodd\xintLDg {#1} + \xint_afterfi{ 1}% + \else + \xint_afterfi{ -1}% + \fi +}% \def\xintiOdd {\romannumeral0\xintiodd }% \def\xintiodd #1% {% @@ -2941,7 +3180,15 @@ \xint_afterfi{ 0}% \fi }% -\let\xintOdd\xintiOdd \let\xintodd\xintiodd +\def\xintOdd {\romannumeral0\xintodd }% +\def\xintodd #1% +{% + \ifodd\xintLDg{#1} + \xint_afterfi{ 1}% + \else + \xint_afterfi{ 0}% + \fi +}% \def\xintDSL {\romannumeral0\xintdsl }% \def\xintdsl #1% {% @@ -3458,7 +3705,7 @@ \W\W\W\W\W\W\W\W }% \def\xintiSquareRoot {\romannumeral0\xintisquareroot }% \def\xintisquareroot #1% - {\expandafter\XINT_sqrt_checkin\romannumeral-`0#1\Z}% + {\expandafter\XINT_sqrt_checkin\romannumeral0\xintnum{#1}\Z}% \def\XINT_sqrt_checkin #1% {% \xint_UDzerominusfork @@ -3612,13 +3859,13 @@ {% \expandafter\XINT_sqrt_big_f_a\expandafter {\the\numexpr #2+#3\expandafter}\expandafter - {\romannumeral-`0\XINT_dsx_addzerosnofuss + {\romannumeral0\XINT_dsx_addzerosnofuss {\numexpr #4-\xint_c_iv\relax}{#1}}{#4}% }% \def\XINT_sqrt_big_f_a #1#2#3#4% {% \expandafter\XINT_sqrt_big_g\expandafter - {\romannumeral0\xintisub + {\romannumeral0\xintiisub {\XINT_dsx_addzerosnofuss {\numexpr \xint_c_ii*#3-\xint_c_viii\relax}{#1}}{#4}}% {#2}{#3}% @@ -3639,8 +3886,8 @@ \def\XINT_sqrt_big_k #1#2#3% {% \expandafter\XINT_sqrt_big_l\expandafter - {\romannumeral0\xintisub {#3}{#1}}% - {\romannumeral0\xintiadd {#2}{\xintiSqr {#1}}}% + {\romannumeral0\xintiisub {#3}{#1}}% + {\romannumeral0\xintiiadd {#2}{\xintiiSqr {#1}}}% }% \def\XINT_sqrt_big_l #1#2% {% diff --git a/Master/texmf-dist/tex/generic/xint/xintbinhex.sty b/Master/texmf-dist/tex/generic/xint/xintbinhex.sty index d023151c236..8b9ab594cf3 100644 --- a/Master/texmf-dist/tex/generic/xint/xintbinhex.sty +++ b/Master/texmf-dist/tex/generic/xint/xintbinhex.sty @@ -22,7 +22,7 @@ %% in the same archive or directory.) %% %%---------------------------------------------------------------- -%% The xint bundle (version 1.08b of June 14, 2013) +%% The xint bundle (version 1.09a of September 22, 2013) %% xintbinhex: Expandable binary and hexadecimal conversions %% Copyright (C) 2013 by Jean-Francois Burnol %%---------------------------------------------------------------- @@ -163,7 +163,7 @@ \fi \expandafter\x\csname ver@xintbinhex.sty\endcsname \ProvidesPackage{xintbinhex}% - [2013/06/14 v1.08b Expandable binary and hexadecimal conversions (jfB)]% + [2013/09/24 v1.09a Expandable binary and hexadecimal conversions (jfB)]% \chardef\xint_c_xvi 16 \chardef\xint_c_ii^v 32 \chardef\xint_c_ii^vi 64 @@ -178,14 +178,14 @@ \expandafter\edef\csname XINT_sdth_#1\endcsname {\ifcase #1 0\or 1\or 2\or 3\or 4\or 5\or 6\or 7\or 8\or 9\or A\or B\or C\or D\or E\or F\fi}}% -\xintApplyUnbraced\XINT_tmp_def +\xintApplyInline\XINT_tmp_def {{0}{1}{2}{3}{4}{5}{6}{7}{8}{9}{10}{11}{12}{13}{14}{15}}% \def\XINT_tmp_def #1{% \expandafter\edef\csname XINT_sdtb_#1\endcsname {\ifcase #1 0000\or 0001\or 0010\or 0011\or 0100\or 0101\or 0110\or 0111\or 1000\or 1001\or 1010\or 1011\or 1100\or 1101\or 1110\or 1111\fi}}% -\xintApplyUnbraced\XINT_tmp_def +\xintApplyInline\XINT_tmp_def {{0}{1}{2}{3}{4}{5}{6}{7}{8}{9}{10}{11}{12}{13}{14}{15}}% \let\XINT_tmp_def\empty \expandafter\def\csname XINT_sbtd_0000\endcsname {0}% diff --git a/Master/texmf-dist/tex/generic/xint/xintcfrac.sty b/Master/texmf-dist/tex/generic/xint/xintcfrac.sty index 87eabb785ed..139e4cb47f6 100644 --- a/Master/texmf-dist/tex/generic/xint/xintcfrac.sty +++ b/Master/texmf-dist/tex/generic/xint/xintcfrac.sty @@ -22,7 +22,7 @@ %% in the same archive or directory.) %% %%---------------------------------------------------------------- -%% The xint bundle (version 1.08b of June 14, 2013) +%% The xint bundle (version 1.09a of September 22, 2013) %% xintcfrac: Expandable continued fractions with xint package %% Copyright (C) 2013 by Jean-Francois Burnol %%---------------------------------------------------------------- @@ -165,7 +165,7 @@ \fi \expandafter\x\csname ver@xintcfrac.sty\endcsname \ProvidesPackage{xintcfrac}% - [2013/06/14 v1.08b Expandable continued fractions with xint package (jfB)]% + [2013/09/24 v1.09a Expandable continued fractions with xint package (jfB)]% \def\xintCFrac {\romannumeral0\xintcfrac }% \def\xintcfrac #1% {% @@ -485,8 +485,8 @@ \expandafter\XINT_cstf_loop_c\expandafter {\romannumeral0\XINT_mul_fork #2\Z #4\Z }% {\romannumeral0\XINT_mul_fork #2\Z #3\Z }% - {\romannumeral0\xintiadd {\XINT_Mul {#2}{#6}}{\XINT_Mul {#1}{#4}}}% - {\romannumeral0\xintiadd {\XINT_Mul {#2}{#5}}{\XINT_Mul {#1}{#3}}}% + {\romannumeral0\xintiiadd {\XINT_Mul {#2}{#6}}{\XINT_Mul {#1}{#4}}}% + {\romannumeral0\xintiiadd {\XINT_Mul {#2}{#5}}{\XINT_Mul {#1}{#3}}}% }% \def\XINT_cstf_loop_c #1#2% {% @@ -519,8 +519,8 @@ \def\XINT_icstf_loop_b #1.#2#3#4#5% {% \expandafter\XINT_icstf_loop_c\expandafter - {\romannumeral0\xintiadd {#5}{\XINT_Mul {#1}{#3}}}% - {\romannumeral0\xintiadd {#4}{\XINT_Mul {#1}{#2}}}% + {\romannumeral0\xintiiadd {#5}{\XINT_Mul {#1}{#3}}}% + {\romannumeral0\xintiiadd {#4}{\XINT_Mul {#1}{#2}}}% {#2}{#3}% }% \def\XINT_icstf_loop_c #1#2% @@ -547,8 +547,8 @@ \expandafter\XINT_gctf_loop_c\expandafter {\romannumeral0\XINT_mul_fork #2\Z #4\Z }% {\romannumeral0\XINT_mul_fork #2\Z #3\Z }% - {\romannumeral0\xintiadd {\XINT_Mul {#2}{#6}}{\XINT_Mul {#1}{#4}}}% - {\romannumeral0\xintiadd {\XINT_Mul {#2}{#5}}{\XINT_Mul {#1}{#3}}}% + {\romannumeral0\xintiiadd {\XINT_Mul {#2}{#6}}{\XINT_Mul {#1}{#4}}}% + {\romannumeral0\xintiiadd {\XINT_Mul {#2}{#5}}{\XINT_Mul {#1}{#3}}}% }% \def\XINT_gctf_loop_c #1#2% {% @@ -606,8 +606,8 @@ \def\XINT_igctf_loop_b #1.#2#3#4#5% {% \expandafter\XINT_igctf_loop_c\expandafter - {\romannumeral0\xintiadd {#5}{\XINT_Mul {#1}{#3}}}% - {\romannumeral0\xintiadd {#4}{\XINT_Mul {#1}{#2}}}% + {\romannumeral0\xintiiadd {#5}{\XINT_Mul {#1}{#3}}}% + {\romannumeral0\xintiiadd {#4}{\XINT_Mul {#1}{#2}}}% {#2}{#3}% }% \def\XINT_igctf_loop_c #1#2% @@ -655,8 +655,8 @@ \expandafter\XINT_cstcv_loop_c\expandafter {\romannumeral0\XINT_mul_fork #2\Z #4\Z }% {\romannumeral0\XINT_mul_fork #2\Z #3\Z }% - {\romannumeral0\xintiadd {\XINT_Mul {#2}{#6}}{\XINT_Mul {#1}{#4}}}% - {\romannumeral0\xintiadd {\XINT_Mul {#2}{#5}}{\XINT_Mul {#1}{#3}}}% + {\romannumeral0\xintiiadd {\XINT_Mul {#2}{#6}}{\XINT_Mul {#1}{#4}}}% + {\romannumeral0\xintiiadd {\XINT_Mul {#2}{#5}}{\XINT_Mul {#1}{#3}}}% }% \def\XINT_cstcv_loop_c #1#2% {% @@ -695,8 +695,8 @@ \def\XINT_icstcv_loop_b #1.#2#3#4#5% {% \expandafter\XINT_icstcv_loop_c\expandafter - {\romannumeral0\xintiadd {#5}{\XINT_Mul {#1}{#3}}}% - {\romannumeral0\xintiadd {#4}{\XINT_Mul {#1}{#2}}}% + {\romannumeral0\xintiiadd {#5}{\XINT_Mul {#1}{#3}}}% + {\romannumeral0\xintiiadd {#4}{\XINT_Mul {#1}{#2}}}% {{#2}{#3}}% }% \def\XINT_icstcv_loop_c #1#2% @@ -729,8 +729,8 @@ \expandafter\XINT_gctcv_loop_c\expandafter {\romannumeral0\XINT_mul_fork #2\Z #4\Z }% {\romannumeral0\XINT_mul_fork #2\Z #3\Z }% - {\romannumeral0\xintiadd {\XINT_Mul {#2}{#6}}{\XINT_Mul {#1}{#4}}}% - {\romannumeral0\xintiadd {\XINT_Mul {#2}{#5}}{\XINT_Mul {#1}{#3}}}% + {\romannumeral0\xintiiadd {\XINT_Mul {#2}{#6}}{\XINT_Mul {#1}{#4}}}% + {\romannumeral0\xintiiadd {\XINT_Mul {#2}{#5}}{\XINT_Mul {#1}{#3}}}% }% \def\XINT_gctcv_loop_c #1#2% {% @@ -798,8 +798,8 @@ \def\XINT_igctcv_loop_b #1.#2#3#4#5% {% \expandafter\XINT_igctcv_loop_c\expandafter - {\romannumeral0\xintiadd {#5}{\XINT_Mul {#1}{#3}}}% - {\romannumeral0\xintiadd {#4}{\XINT_Mul {#1}{#2}}}% + {\romannumeral0\xintiiadd {#5}{\XINT_Mul {#1}{#3}}}% + {\romannumeral0\xintiiadd {#4}{\XINT_Mul {#1}{#2}}}% {{#2}{#3}}% }% \def\XINT_igctcv_loop_c #1#2% diff --git a/Master/texmf-dist/tex/generic/xint/xintexpr.sty b/Master/texmf-dist/tex/generic/xint/xintexpr.sty index 45378ace18a..3c1de7ed8a9 100644 --- a/Master/texmf-dist/tex/generic/xint/xintexpr.sty +++ b/Master/texmf-dist/tex/generic/xint/xintexpr.sty @@ -22,7 +22,7 @@ %% in the same archive or directory.) %% %%---------------------------------------------------------------- -%% The xint bundle (version 1.08b of June 14, 2013) +%% The xint bundle (version 1.09a of September 22, 2013) %% xintexpr: Expandable expression parser %% Copyright (C) 2013 by Jean-Francois Burnol %%---------------------------------------------------------------- @@ -114,6 +114,10 @@ \endgroup \edef\XINT_expr_restorecatcodes_endinput {% + \catcode63=\the\catcode63 % ? + \catcode124=\the\catcode124 % | + \catcode38=\the\catcode38 % & + \catcode64=\the\catcode64 % @ \catcode33=\the\catcode33 % ! \catcode93=\the\catcode93 % ] \catcode91=\the\catcode91 % [ @@ -141,14 +145,17 @@ \noexpand\endinput }% \XINT_setcatcodes % defined in xint.sty - \catcode91=12 % [ - \catcode93=12 % ] - \catcode33=11 % ! + \catcode91=12 % [ + \catcode93=12 % ] + \catcode33=11 % ! + \catcode64=11 % @ + \catcode38=12 % & + \catcode124=12 % | + \catcode63=11 % ? }% \x \begingroup - \catcode64=11 % @ - \catcode58=12 % : + \catcode58=12 % : (but doesn't matter) \expandafter\ifx\csname ProvidesPackage\endcsname\relax \def\x#1#2#3[#4]{\endgroup \immediate\write-1{Package: #3 #4}% @@ -167,191 +174,40 @@ \fi \expandafter\x\csname ver@xintexpr.sty\endcsname \ProvidesPackage{xintexpr}% - [2013/06/14 v1.08b Expandable expression parser (jfB)]% + [2013/09/24 v1.09a Expandable expression parser (jfB)]% \def\xint_gob_til_dot #1.{}% \def\xint_gob_til_dot_andstop #1.{ }% -\def\xint_gob_til_! #1!{}% ! of catcode 11 -\def\XINT_expr_string {\expandafter\xint_gob_til_dot\string }% +\def\xint_gob_til_! #1!{}% nota bene: ! is of catcode 11 \def\XINT_expr_unexpectedtoken {\xintError:ignored }% -\def\xintexpr {\romannumeral0\xinteval }% +\def\XINT_newexpr_stripprefix #1>{\noexpand\romannumeral-`0}% +\def\xint_firstofone #1{#1}% +\def\XINT_expr_lock #1!{\expandafter\space\csname .#1\endcsname }% +\def\XINT_expr_unlock {\expandafter\xint_gob_til_dot\string }% +\def\XINT_expr_usethe {use_xintthe!\xintError:use_xintthe! }% +\def\XINT_expr_done {!\XINT_expr_usethe\XINT_expr_print }% +\def\XINT_expr_print #1{\XINT_expr_unlock #1}% +\def\XINT_flexpr_done {!\XINT_expr_usethe\XINT_flexpr_print }% +\def\XINT_flexpr_print #1{\xintFloat:csv{\XINT_expr_unlock #1}}% +\def\XINT_numexpr_print #1{\xintRound:csv{\XINT_expr_unlock #1}}% +\def\xintexpr {\romannumeral0\xinteval }% \def\xinteval {% - \expandafter\XINT_expr_until_end\romannumeral-`0% - \expandafter\XINT_expr_checkifprefix_ii\romannumeral-`0% - \XINT_expr_getnext -}% -\def\xinttheexpr {\romannumeral0\xinttheeval }% -\def\xinttheeval {\expandafter\XINT_expr_the\romannumeral0\xinteval }% -\def\XINT_expr_the #1#2#3{\xintraw{\XINT_expr_string #3}}% -\def\xintthe #1{\ifx#1\xintexpr \expandafter\xinttheexpr - \else\expandafter\xintthefloatexpr\fi}% -\def\XINT_expr_until_end #1% -{% - \ifcase#1% - \expandafter\xint_gobble_vi - \or - \expandafter\XINT_expr_extra_closing_paren - \fi - \expandafter\XINT_expr_until_end\romannumeral-`0\romannumeral-`0% -}% -\def\XINT_expr_extra_closing_paren {\xintError:removed }% -\def\XINT_expr_endofexpr {!\XINT_illegaluse }% -\def\XINT_illegaluse - {Illegal_here_use_xintthe\xintError:use_xintthe!\xint_gobble_i }% -\def\XINT_expr_oparen -{% - \expandafter\XINT_expr_until_cparen\romannumeral-`0% - \expandafter\XINT_expr_checkifprefix_ii\romannumeral-`0% - \XINT_expr_getnext -}% -\def\XINT_expr_until_cparen #1% -{% - \ifcase#1% - \expandafter\XINT_expr_missing_cparen - \or - \else \xint_afterfi - {\expandafter\XINT_expr_until_cparen\romannumeral-`0\romannumeral-`0}% - \fi -}% -\def\XINT_expr_missing_cparen #1% -{% - \xintError:inserted \xint_c_ \XINT_expr_endofexpr -}% -\def\xint_tmp_def #1#2#3% -{% - \expandafter\xint_tmp_do_defs - \csname XINT_expr_op_#1\expandafter\endcsname - \csname XINT_expr_until_#1\expandafter\endcsname - \csname XINT_expr_checkifprefix_#2\expandafter\endcsname - \csname XINT_expr_precedence_#1\expandafter\endcsname - \csname xint_c_#2\expandafter\endcsname - \csname xint#3\endcsname -}% -\def\xint_tmp_do_defs #1#2#3#4#5#6% -{% - \def #1##1% \XINT_expr_op_? - {% - \expandafter #2\expandafter ##1\romannumeral-`0\expandafter - #3\romannumeral-`0\XINT_expr_getnext - }% - \def #2##1##2##3##4% \XINT_expr_until_? - {% - \ifnum ##2>#5% - \xint_afterfi {\expandafter #2\expandafter ##1\romannumeral-`0##3##4}% - \else - \xint_afterfi - {\expandafter ##2\expandafter ##3% - \csname .#6{\XINT_expr_string ##1}{\XINT_expr_string ##4}\endcsname }% - \fi - }% - \let #4#5% -}% -\xint_tmp_def +{ii}{Add}% -\xint_tmp_def -{ii}{Sub}% -\xint_tmp_def *{iii}{Mul}% -\xint_tmp_def /{iii}{Div}% -\xint_tmp_def ^{iv}{Pow}% -\xint_tmp_def e{v}{fE}% -\xint_tmp_def E{v}{fE}% -\def\xint_tmp_def #1% -{% - \expandafter\xint_tmp_do_defs - \csname XINT_expr_checkifprefix_#1\expandafter\endcsname - \csname XINT_expr_op_-#1\endcsname -}% -\def\xint_tmp_do_defs #1#2% -{% - \def #1##1% - {\xint_UDsignfork - ##1\dummy #2% - -\dummy ##1% - \krof }% -}% -\xint_tmp_def {ii}% -\xint_tmp_def {iii}% -\xint_tmp_def {iv}% -\xint_tmp_def {v}% -\def\xint_tmp_def #1% -{% - \expandafter\xint_tmp_do_defs - \csname XINT_expr_op_-#1\expandafter\endcsname - \csname XINT_expr_until_-#1\expandafter\endcsname - \csname XINT_expr_checkifprefix_#1\expandafter\endcsname - \csname xint_c_#1\endcsname -}% -\def\xint_tmp_do_defs #1#2#3#4% -{% - \def #1% \XINT_expr_op_-ii,iii,iv,v - {% - \expandafter #2\romannumeral-`0\expandafter - #3\romannumeral-`0\XINT_expr_getnext - }% - \def #2##1##2##3% \XINT_expr_until_-ii,iii,iv,v - {% - \ifnum ##1>#4% - \xint_afterfi {\expandafter #2\romannumeral-`0##2##3}% - \else - \xint_afterfi {\expandafter ##1\expandafter ##2% - \csname .\xintOpp{\XINT_expr_string ##3}\endcsname }% - \fi - }% -}% -\xint_tmp_def {ii}% -\xint_tmp_def {iii}% -\xint_tmp_def {iv}% -\xint_tmp_def {v}% -\def\XINT_expr_getop #1% -{% - \expandafter\XINT_expr_getop_a\expandafter #1% - \romannumeral-`0\romannumeral-`0% -}% -\def\XINT_expr_getop_a #1#2% -{% - \ifcat #2\relax - \ifx #2\relax - \expandafter\expandafter\expandafter - \XINT_expr_foundendofexpr - \else - \XINT_expr_unexpectedtoken - \expandafter\expandafter\expandafter - \XINT_expr_getop - \fi - \else - \expandafter\XINT_expr_op_found\expandafter #2% - \fi - #1% + \expandafter\XINT_expr_until_end_a \romannumeral-`0\XINT_expr_getnext }% -\def\XINT_expr_foundendofexpr {\xint_c_ \XINT_expr_endofexpr }% -\def\XINT_expr_op_found #1% -{% - \ifcsname XINT_expr_precedence_\string #1\endcsname - \expandafter\xint_afterfi\expandafter - {\csname XINT_expr_precedence_\string #1\expandafter\endcsname - \csname XINT_expr_op_\string #1\endcsname }% - \else - \XINT_expr_unexpectedtoken - \expandafter\XINT_expr_getop - \fi -}% -\expandafter\let\csname XINT_expr_precedence_)\endcsname \xint_c_i -\expandafter\let\csname XINT_expr_op_)\endcsname\XINT_expr_getop -\def\xint_tmp_def -{% - \expandafter\xint_tmp_do_defs - \csname XINT_expr_precedence_!\expandafter\endcsname - \csname XINT_expr_op_!\endcsname -}% -\def\xint_tmp_do_defs #1#2% +\def\xinttheeval {\expandafter\xint_gobble_ii\romannumeral0\xinteval }% +\def\xinttheexpr {\romannumeral-`0\xinttheeval }% +\def\XINT_numexpr_post !\XINT_expr_usethe\XINT_expr_print% + { !\XINT_expr_usethe\XINT_numexpr_print }% +\def\xintnumexpr {\romannumeral0\expandafter\XINT_numexpr_post + \romannumeral0\xinteval }% +\def\xintthenumexpr {\romannumeral-`0\xintthe\xintnumexpr }% +\def\xintfloatexpr {\romannumeral0\xintfloateval }% +\def\xintfloateval {% - \def #1##1##2% - {\ifx ##1#2% - \expandafter\xint_firstoftwo - \else\expandafter\xint_secondoftwo - \fi{\expandafter\XINT_expr_getop}{\expandafter\XINT_flexpr_getop}% - \csname .\xintFac{\XINT_expr_string ##2}/1[0]\endcsname }% - \let#2\empty + \expandafter\XINT_flexpr_until_end_a \romannumeral-`0\XINT_expr_getnext }% -\xint_tmp_def +\def\xintthefloatexpr {\romannumeral-`0\xintthe\xintfloatexpr }% +\def\xintthe #1{\romannumeral-`0\expandafter\xint_gobble_ii\romannumeral-`0#1}% \def\XINT_expr_getnext {% \expandafter\XINT_expr_getnext_checkforbraced_a @@ -385,300 +241,648 @@ #2\dummy \XINT_expr_getnext_onetoken_wehope \W\dummy \XINT_expr_getnext_gotbracedstuff \krof -}% +}% doubly braced things are not acceptable, will cause errors. \def\XINT_expr_getnext_emptybracepair #1{\XINT_expr_getnext }% -\def\XINT_expr_getnext_gotbracedstuff #1\W\Z #2% +\def\XINT_expr_getnext_gotbracedstuff #1\W\Z #2% {..} -> number/fraction {% \expandafter\XINT_expr_getop\csname .#2\endcsname }% -\def\XINT_expr_getnext_onetoken_wehope\Z #1% +\def\XINT_expr_getnext_onetoken_wehope\Z #1% #1 isn't a control sequence! {% \xint_gob_til_! #1\XINT_expr_subexpr !% \expandafter\XINT_expr_getnext_onetoken_fork\string #1% -}% -\def\XINT_expr_subexpr !#1!{\expandafter\XINT_expr_getop\xint_gobble_i }% +}% after this #1 should be now a catcode 12 token. +\def\XINT_expr_subexpr !#1!{\expandafter\XINT_expr_getop\xint_gobble_ii }% \begingroup -\lccode`*=`_ +\lccode`*=`# \lowercase{\endgroup \def\XINT_expr_sixwayfork #1(-.+*\dummy #2#3\krof {#2}% \def\XINT_expr_getnext_onetoken_fork #1% -{% +{% The * is in truth catcode 12 #. For (clever!) use with \xintNewExpr. \XINT_expr_sixwayfork - #1-.+*\dummy \XINT_expr_oparen + #1-.+*\dummy {\xint_c_x ({}}% back to until to trigger oparen (#1.+*\dummy -% - (-#1+*\dummy {\XINT_expr_scannum_start\XINT_expr_scannum_decpart_b.}% + (-#1+*\dummy {\XINT_expr_scandec_II.}% (-.#1*\dummy \XINT_expr_getnext% - (-.+#1\dummy {\XINT_expr_scannum_start\XINT_expr_scannum_decpart_b*}% - (-.+*\dummy {\XINT_expr_scannum_check #1}% + (-.+#1\dummy {\XINT_expr_scandec_II}% + (-.+*\dummy {\XINT_expr_scan_dec_or_func #1}% \krof }}% -\def\XINT_expr_scannum_check #1% +\def\XINT_expr_scan_dec_or_func #1% this #1 of catcode 12 {% \ifnum \xint_c_ix<1#1 - \expandafter\XINT_expr_scannum_start + \expandafter\XINT_expr_scandec_I + \else % We assume we are dealing with a function name!! + \expandafter\XINT_expr_scanfunc + \fi #1% +}% +\def\XINT_expr_scanfunc +{% + \expandafter\XINT_expr_func\romannumeral-`0\XINT_expr_scanfunc_c +}% +\def\XINT_expr_scanfunc_c #1% +{% + \expandafter #1\romannumeral-`0\expandafter + \XINT_expr_scanfunc_a\romannumeral-`0\romannumeral-`0% +}% +\def\XINT_expr_scanfunc_a #1% please no braced things here! +{% + \ifcat #1\relax % missing opening parenthesis, probably + \expandafter\XINT_expr_scanfunc_panic \else - \xint_afterfi{\XINT_expr_unexpectedtoken - \expandafter\XINT_expr_getnext\xint_gobble_ii}% - \fi \XINT_expr_scannum_intpart_b #1% + \xint_afterfi{\expandafter\XINT_expr_scanfunc_b \string #1}% + \fi +}% +\def\XINT_expr_scanfunc_b #1% +{% + \if #1(\else\expandafter \XINT_expr_scanfunc_c \fi #1% +}% +\def\XINT_expr_scanfunc_panic {\xintError:bigtroubleahead(0\relax }% +\def\XINT_expr_func #1(% common to expr and flexpr +{% + \xint_c_x @{#1}% }% -\def\XINT_expr_scannum_stopscan {!}% ! catcode 11 -\def\XINT_expr_gathernum #1!% ! with catcode 11 +\def\XINT_expr_scandec_I {% - \expandafter\space\csname .#1\endcsname + \expandafter\XINT_expr_getop\romannumeral-`0\expandafter + \XINT_expr_lock\romannumeral-`0\XINT_expr_scanintpart_b }% -\def\XINT_expr_scannum_start #1% +\def\XINT_expr_scandec_II {% - \expandafter\XINT_expr_getop - \romannumeral-`0\expandafter\XINT_expr_gathernum - \romannumeral-`0#1% + \expandafter\XINT_expr_getop\romannumeral-`0\expandafter + \XINT_expr_lock\romannumeral-`0\XINT_expr_scanfracpart_b }% -\def\XINT_expr_scannum_intpart_a #1% +\def\XINT_expr_scanintpart_a #1% {% \ifnum \xint_c_ix<1\string#1 - \expandafter\expandafter\expandafter - \XINT_expr_scannum_intpart_b + \expandafter\expandafter\expandafter\XINT_expr_scanintpart_b \expandafter\string \else \if #1.% \expandafter\expandafter\expandafter - \XINT_expr_scannum_transition + \XINT_expr_scandec_transition \else - \expandafter\expandafter\expandafter - \XINT_expr_scannum_stopscan + \expandafter\expandafter\expandafter !% ! of catcode 11... \fi \fi #1% }% -\def\XINT_expr_scannum_intpart_b #1% +\def\XINT_expr_scanintpart_b #1% {% \expandafter #1\romannumeral-`0\expandafter - \XINT_expr_scannum_intpart_a\romannumeral-`0\romannumeral-`0% + \XINT_expr_scanintpart_a\romannumeral-`0\romannumeral-`0% }% -\def\XINT_expr_scannum_transition #1% +\def\XINT_expr_scandec_transition #1% {% \expandafter.\romannumeral-`0\expandafter - \XINT_expr_scannum_decpart_a\romannumeral-`0\romannumeral-`0% + \XINT_expr_scanfracpart_a\romannumeral-`0\romannumeral-`0% }% -\def\XINT_expr_scannum_decpart_a #1% +\def\XINT_expr_scanfracpart_a #1% {% \ifnum \xint_c_ix<1\string#1 - \expandafter\expandafter\expandafter - \XINT_expr_scannum_decpart_b\expandafter\string + \expandafter\expandafter\expandafter\XINT_expr_scanfracpart_b + \expandafter\string \else - \expandafter \XINT_expr_scannum_stopscan + \expandafter !% \fi #1% }% -\def\XINT_expr_scannum_decpart_b #1% +\def\XINT_expr_scanfracpart_b #1% {% \expandafter #1\romannumeral-`0\expandafter - \XINT_expr_scannum_decpart_a\romannumeral-`0\romannumeral-`0% + \XINT_expr_scanfracpart_a\romannumeral-`0\romannumeral-`0% }% -\def\xintfloatexpr {\romannumeral0\xintfloateval }% -\def\xintfloateval +\def\XINT_expr_getop #1% this #1 is the current locked computed value +{% full expansion of next token, first swallowing a possible space + \expandafter\XINT_expr_getop_a\expandafter #1% + \romannumeral-`0\romannumeral-`0% +}% +\def\XINT_expr_getop_a #1#2% +{% if an un-expandable control sequence is found, must be the ending \relax + \ifcat #2\relax + \ifx #2\relax + \expandafter\expandafter\expandafter + \XINT_expr_foundend + \else + \XINT_expr_unexpectedtoken + \expandafter\expandafter\expandafter + \XINT_expr_getop + \fi + \else + \expandafter\XINT_expr_foundop\expandafter #2% + \fi + #1% +}% +\def\XINT_expr_foundend {\xint_c_ \relax }% \relax is a place holder here. +\def\XINT_expr_foundop #1% then becomes and is followed by <\.f> +{% 1.09a: no control sequence \XINT_expr_op_#1, code common to expr/flexpr + \ifcsname XINT_expr_precedence_#1\endcsname + \expandafter\xint_afterfi\expandafter + {\csname XINT_expr_precedence_#1\endcsname #1}% + \else + \XINT_expr_unexpectedtoken + \expandafter\XINT_expr_getop + \fi +}% +\def\xint_tmp_do_defs #1#2#3#4#5% {% - \expandafter\XINT_expr_until_end\romannumeral-`0% - \expandafter\XINT_flexpr_checkifprefix_ii\romannumeral-`0% - \XINT_flexpr_getnext + \def#1##1% + {% + \xint_UDsignfork + ##1\dummy {\expandafter#1\romannumeral-`0#3}% + -\dummy {#2##1}% + \krof + }% + \def#2##1##2% + {% + \ifcase ##1\expandafter #4% + \or \xint_afterfi{% + \XINT_expr_extra_closing_paren + \expandafter #1\romannumeral-`0\XINT_expr_getop + }% + \else \xint_afterfi{% + \expandafter#1\romannumeral-`0\csname XINT_#5_op_##2\endcsname + }% + \fi + }% }% -\def\xintthefloatexpr {\romannumeral0\xintthefloateval }% -\def\xintthefloateval - {\expandafter\XINT_flexpr_the\romannumeral0\xintfloateval }% -\def\XINT_flexpr_the #1#2#3{\xintfloat{\XINT_expr_string #3}}% -\def\XINT_flexpr_oparen +\expandafter\xint_tmp_do_defs + \csname XINT_expr_until_end_a\expandafter\endcsname + \csname XINT_expr_until_end_b\expandafter\endcsname + \csname XINT_expr_op_-vi\expandafter\endcsname + \csname XINT_expr_done\endcsname + {expr}% +\expandafter\xint_tmp_do_defs + \csname XINT_flexpr_until_end_a\expandafter\endcsname + \csname XINT_flexpr_until_end_b\expandafter\endcsname + \csname XINT_flexpr_op_-vi\expandafter\endcsname + \csname XINT_flexpr_done\endcsname + {flexpr}% +\def\XINT_expr_extra_closing_paren {\xintError:removed }% +\def\xint_tmp_do_defs #1#2#3#4#5#6% {% - \expandafter\XINT_expr_until_cparen\romannumeral-`0% - \expandafter\XINT_flexpr_checkifprefix_ii\romannumeral-`0% - \XINT_flexpr_getnext + \def #1{\expandafter #3\romannumeral-`0\XINT_expr_getnext }% + \let #2#1% + \def #3##1{\xint_UDsignfork + ##1\dummy {\expandafter #3\romannumeral-`0#5}% + -\dummy {#4##1}% + \krof }% + \def #4##1##2% + {% + \ifcase ##1\expandafter \XINT_expr_missing_cparen + \or \expandafter \XINT_expr_getop + \else \xint_afterfi + {\expandafter #3\romannumeral-`0\csname XINT_#6_op_##2\endcsname }% + \fi + }% }% -\def\xint_tmp_def #1#2#3% +\expandafter\xint_tmp_do_defs + \csname XINT_expr_op_(\expandafter\endcsname + \csname XINT_expr_oparen\expandafter\endcsname + \csname XINT_expr_until_)_a\expandafter\endcsname + \csname XINT_expr_until_)_b\expandafter\endcsname + \csname XINT_expr_op_-vi\endcsname + {expr}% +\expandafter\xint_tmp_do_defs + \csname XINT_flexpr_op_(\expandafter\endcsname + \csname XINT_flexpr_oparen\expandafter\endcsname + \csname XINT_flexpr_until_)_a\expandafter\endcsname + \csname XINT_flexpr_until_)_b\expandafter\endcsname + \csname XINT_flexpr_op_-vi\endcsname + {flexpr}% +\def\XINT_expr_missing_cparen {\xintError:inserted \xint_c_ \XINT_expr_done }% +\expandafter\let\csname XINT_expr_precedence_)\endcsname \xint_c_i +\expandafter\let\csname XINT_expr_op_)\endcsname\XINT_expr_getop +\expandafter\let\csname XINT_flexpr_precedence_)\endcsname \xint_c_i +\expandafter\let\csname XINT_flexpr_op_)\endcsname\XINT_expr_getop +\def\xint_tmp_def #1#2#3#4#5#6% {% \expandafter\xint_tmp_do_defs - \csname XINT_flexpr_op_#1\expandafter\endcsname - \csname XINT_flexpr_until_#1\expandafter\endcsname - \csname XINT_flexpr_checkifprefix_#2\expandafter\endcsname - \csname XINT_expr_precedence_#1\expandafter\endcsname - \csname xint_c_#2\expandafter\endcsname - \csname XINTinFloat#3\endcsname + \csname XINT_#1_op_#3\expandafter\endcsname + \csname XINT_#1_until_#3_a\expandafter\endcsname + \csname XINT_#1_until_#3_b\expandafter\endcsname + \csname XINT_#1_op_-#5\expandafter\endcsname + \csname xint_c_#4\expandafter\endcsname + \csname #2#6\expandafter\endcsname + \csname XINT_expr_precedence_#3\endcsname {#1}% +}% +\def\xint_tmp_do_defs #1#2#3#4#5#6#7#8% +{% + \def #1##1% \XINT_expr_op_ + {% keep value, get next number and operator, then do until + \expandafter #2\expandafter ##1% + \romannumeral-`0\expandafter\XINT_expr_getnext + }% + \def #2##1##2% \XINT_expr_until__a + {\xint_UDsignfork + ##2\dummy {\expandafter #2\expandafter ##1\romannumeral-`0#4}% + -\dummy {#3##1##2}% + \krof }% + \def #3##1##2##3##4% \XINT_expr_until__b + {% either execute next operation now, or first do next (possibly unary) + \ifnum ##2>#5% + \xint_afterfi {\expandafter #2\expandafter ##1\romannumeral-`0% + \csname XINT_#8_op_##3\endcsname {##4}}% + \else + \xint_afterfi + {\expandafter ##2\expandafter ##3% + \csname .#6{\XINT_expr_unlock ##1}{\XINT_expr_unlock ##4}\endcsname }% + \fi + }% + \let #7#5% }% +\def\xint_tmp_def_a #1{\xint_tmp_def {expr}{xint}#1}% +\xintApplyInline {\xint_tmp_def_a }{% + {|{iii}{vi}{OR}}% + {&{iv}{vi}{AND}}% + {<{v}{vi}{Lt}}% + {>{v}{vi}{Gt}}% + {={v}{vi}{Eq}}% + {+{vi}{vi}{Add}}% + {-{vi}{vi}{Sub}}% + {*{vii}{vii}{Mul}}% + {/{vii}{vii}{Div}}% + {^{viii}{viii}{Pow}}% + {e{ix}{ix}{fE}}% + {E{ix}{ix}{fE}}% +}% +\def\xint_tmp_def_a #1{\xint_tmp_def {flexpr}{xint}#1}% +\xintApplyInline {\xint_tmp_def_a }{% + {|{iii}{vi}{OR}}% + {&{iv}{vi}{AND}}% + {<{v}{vi}{Lt}}% + {>{v}{vi}{Gt}}% + {={v}{vi}{Eq}}% +}% +\def\xint_tmp_def_a #1{\xint_tmp_def {flexpr}{XINTinFloat}#1}% +\xintApplyInline {\xint_tmp_def_a }{% + {+{vi}{vi}{Add}}% + {-{vi}{vi}{Sub}}% + {*{vii}{vii}{Mul}}% + {/{vii}{vii}{Div}}% + {^{viii}{viii}{Power}}% + {e{ix}{ix}{fE}}% + {E{ix}{ix}{fE}}% +}% +\let\xint_tmp_def_a\empty \def\xint_tmp_do_defs #1#2#3#4#5#6% {% - \def #1##1% \XINT_flexpr_op_? + \def #1##1% \XINT_expr_op_,_a {% - \expandafter #2\expandafter ##1\romannumeral-`0\expandafter - #3\romannumeral-`0\XINT_flexpr_getnext + \expandafter #2\expandafter ##1\romannumeral-`0\XINT_expr_getnext }% - \def #2##1##2##3##4% \XINT_flexpr_until_? + \def #2##1##2% \XINT_expr_until_,_a + {\xint_UDsignfork + ##2\dummy {\expandafter #2\expandafter ##1\romannumeral-`0#4}% + -\dummy {#3##1##2}% + \krof }% + \def #3##1##2##3##4% \XINT_expr_until_,_b {% - \ifnum ##2>#5% - \xint_afterfi {\expandafter #2\expandafter ##1\romannumeral-`0##3##4}% + \ifnum ##2>\xint_c_ii + \xint_afterfi {\expandafter #2\expandafter ##1\romannumeral-`0% + \csname XINT_#6_op_##3\endcsname {##4}}% \else \xint_afterfi {\expandafter ##2\expandafter ##3% - \csname .#6{\XINT_expr_string ##1}% - {\XINT_expr_string ##4}\endcsname }% + \csname .\XINT_expr_unlock ##1,\XINT_expr_unlock ##4\endcsname }% \fi }% + \let #5\xint_c_ii }% -\xint_tmp_def +{ii}{Add}% -\xint_tmp_def -{ii}{Sub}% -\xint_tmp_def *{iii}{Mul}% -\xint_tmp_def /{iii}{Div}% -\xint_tmp_def ^{iv}{Power}% -\xint_tmp_def e{v}{fE}% -\xint_tmp_def E{v}{fE}% -\def\xint_tmp_def #1% +\expandafter\xint_tmp_do_defs + \csname XINT_expr_op_,\expandafter\endcsname + \csname XINT_expr_until_,_a\expandafter\endcsname + \csname XINT_expr_until_,_b\expandafter\endcsname + \csname XINT_expr_op_-vi\expandafter\endcsname + \csname XINT_expr_precedence_,\endcsname {expr}% +\expandafter\xint_tmp_do_defs + \csname XINT_flexpr_op_,\expandafter\endcsname + \csname XINT_flexpr_until_,_a\expandafter\endcsname + \csname XINT_flexpr_until_,_b\expandafter\endcsname + \csname XINT_flexpr_op_-vi\expandafter\endcsname + \csname XINT_expr_precedence_,\endcsname {flexpr}% +\def \XINT_expr_precedence_? #1#2#3#4% {% - \expandafter\xint_tmp_do_defs - \csname XINT_flexpr_checkifprefix_#1\expandafter\endcsname - \csname XINT_flexpr_op_-#1\endcsname + \xintifZero{\XINT_expr_unlock #2}% + {\XINT_expr_getnext #4}% + {\XINT_expr_getnext #3}% }% -\def\xint_tmp_do_defs #1#2% +\def \XINT_expr_precedence_: #1#2#3#4#5% {% - \def #1##1% - {\xint_UDsignfork - ##1\dummy #2% - -\dummy ##1% - \krof }% + \xintifSgn {\XINT_expr_unlock #2}% + {\XINT_expr_getnext #3}% + {\XINT_expr_getnext #4}% + {\XINT_expr_getnext #5}% }% -\xint_tmp_def {ii}% -\xint_tmp_def {iii}% -\xint_tmp_def {iv}% -\xint_tmp_def {v}% -\def\xint_tmp_def #1% +\def\xint_tmp_def #1#2% {% \expandafter\xint_tmp_do_defs - \csname XINT_flexpr_op_-#1\expandafter\endcsname - \csname XINT_expr_until_-#1\expandafter\endcsname - \csname XINT_flexpr_checkifprefix_#1\expandafter\endcsname - \csname xint_c_#1\endcsname + \csname XINT_#1_op_-#2\expandafter\endcsname + \csname XINT_#1_until_-#2_a\expandafter\endcsname + \csname XINT_#1_until_-#2_b\expandafter\endcsname + \csname xint_c_#2\endcsname {#1}% }% -\def\xint_tmp_do_defs #1#2#3#4% +\def\xint_tmp_do_defs #1#2#3#4#5% {% - \def #1% \XINT_flexpr_op_-ii,iii,iv,v - {% - \expandafter #2\romannumeral-`0\expandafter - #3\romannumeral-`0\XINT_flexpr_getnext + \def #1% \XINT_expr_op_- + {% get next number+operator then switch to _until macro + \expandafter #2\romannumeral-`0\XINT_expr_getnext + }% + \def #2##1% \XINT_expr_until_-_a + {\xint_UDsignfork + ##1\dummy {\expandafter #2\romannumeral-`0#1}% + -\dummy {#3##1}% + \krof }% + \def #3##1##2##3% \XINT_expr_until_-_b + {% _until tests precedence level with next op, executes now or postpones + \ifnum ##1>#4% + \xint_afterfi {\expandafter #2\romannumeral-`0% + \csname XINT_#5_op_##2\endcsname {##3}}% + \else + \xint_afterfi {\expandafter ##1\expandafter ##2% + \csname .\xintOpp{\XINT_expr_unlock ##3}\endcsname }% + \fi }% }% -\xint_tmp_def {ii}% -\xint_tmp_def {iii}% -\xint_tmp_def {iv}% -\xint_tmp_def {v}% +\xintApplyInline{\xint_tmp_def {expr}}{{vi}{vii}{viii}{ix}}% +\xintApplyInline{\xint_tmp_def {flexpr}}{{vi}{vii}{viii}{ix}}% +\expandafter\def\csname XINT_expr_precedence_!\endcsname #1#2% + {\expandafter\XINT_expr_getop + \csname .\xintFac{\XINT_expr_unlock #2}[0]\endcsname }% \let\xint_tmp_def\empty \let\xint_tmp_do_defs\empty -\def\XINT_flexpr_getop #1% +\def\XINT_expr_op_@ #1% {% - \expandafter\XINT_flexpr_getop_a\expandafter #1% - \romannumeral-`0\romannumeral-`0% + \ifcsname XINT_expr_func_#1\endcsname + \xint_afterfi{% + \expandafter\expandafter\csname XINT_expr_func_#1\endcsname + }% + \else \xintError:unknownfunction + \xint_afterfi{\expandafter\XINT_expr_func_unknown}% + \fi + \romannumeral-`0\XINT_expr_oparen }% -\def\XINT_flexpr_getop_a #1#2% +\def\XINT_flexpr_op_@ #1% {% - \ifcat #2\relax - \ifx #2\relax - \expandafter\expandafter\expandafter - \XINT_expr_foundendofexpr - \else - \XINT_expr_unexpectedtoken - \expandafter\expandafter\expandafter - \XINT_flexpr_getop - \fi - \else - \expandafter\XINT_flexpr_op_found\expandafter #2% + \ifcsname XINT_flexpr_func_#1\endcsname + \xint_afterfi{% + \expandafter\expandafter\csname XINT_flexpr_func_#1\endcsname + }% + \else \xintError:unknownfunction + \xint_afterfi{\expandafter\XINT_expr_func_unknown}% \fi - #1% + \romannumeral-`0\XINT_flexpr_oparen }% -\def\XINT_flexpr_op_found #1% +\def\XINT_expr_func_unknown #1#2#3% {% - \ifcsname XINT_expr_precedence_\string #1\endcsname - \expandafter\xint_afterfi\expandafter - {\csname XINT_expr_precedence_\string #1\expandafter\endcsname - \csname XINT_flexpr_op_\string #1\endcsname }% - \else - \XINT_expr_unexpectedtoken - \expandafter\XINT_flexpr_getop - \fi + \expandafter #1\expandafter #2\csname .0[0]\endcsname }% -\expandafter\let\csname XINT_flexpr_op_)\endcsname\XINT_flexpr_getop -\def\XINT_flexpr_getnext +\def\XINT_expr_func_reduce #1#2#3% {% - \expandafter\XINT_flexpr_getnext_checkforbraced_a - \romannumeral-`0\romannumeral-`0% + \expandafter #1\expandafter #2\csname + .\xintIrr {\XINT_expr_unlock #3}\endcsname }% -\def\XINT_flexpr_getnext_checkforbraced_a #1% +\let\XINT_flexpr_func_reduce\XINT_expr_func_reduce +\def\XINT_expr_func_sqr #1#2#3% {% - \XINT_flexpr_getnext_checkforbraced_b #1\W\Z {#1}% + \expandafter #1\expandafter #2\csname + .\xintSqr {\XINT_expr_unlock #3}\endcsname }% -\def\XINT_flexpr_getnext_checkforbraced_b #1#2% +\def\XINT_flexpr_func_sqr #1#2#3% {% - \xint_UDwfork - #1\dummy \XINT_flexpr_getnext_emptybracepair - #2\dummy \XINT_flexpr_getnext_onetoken_perhaps - \W\dummy \XINT_flexpr_getnext_gotbracedstuff - \krof + \expandafter #1\expandafter #2\csname + .\XINTinFloatMul {\XINT_expr_unlock #3}{\XINT_expr_unlock #3}\endcsname }% -\def\XINT_flexpr_getnext_onetoken_perhaps\Z #1% +\def\XINT_expr_func_abs #1#2#3% {% - \expandafter\XINT_flexpr_getnext_checkforbraced_c\expandafter - {\romannumeral-`0#1}% + \expandafter #1\expandafter #2\csname + .\xintAbs {\XINT_expr_unlock #3}\endcsname }% -\def\XINT_flexpr_getnext_checkforbraced_c #1% +\let\XINT_flexpr_func_abs\XINT_expr_func_abs +\def\XINT_expr_func_sgn #1#2#3% {% - \XINT_flexpr_getnext_checkforbraced_d #1\W\Z {#1}% + \expandafter #1\expandafter #2\csname + .\xintSgn {\XINT_expr_unlock #3}\endcsname }% -\def\XINT_flexpr_getnext_checkforbraced_d #1#2% +\let\XINT_flexpr_func_sgn\XINT_expr_func_sgn +\def\XINT_expr_func_floor #1#2#3% {% - \xint_UDwfork - #1\dummy \XINT_flexpr_getnext_emptybracepair - #2\dummy \XINT_flexpr_getnext_onetoken_wehope - \W\dummy \XINT_flexpr_getnext_gotbracedstuff - \krof + \expandafter #1\expandafter #2\csname + .\xintFloor {\XINT_expr_unlock #3}\endcsname }% -\def\XINT_flexpr_getnext_emptybracepair #1{\XINT_flexpr_getnext }% -\def\XINT_flexpr_getnext_gotbracedstuff #1\W\Z #2% +\let\XINT_flexpr_func_floor\XINT_expr_func_floor +\def\XINT_expr_func_ceil #1#2#3% {% - \expandafter\XINT_flexpr_getop\csname .#2\endcsname + \expandafter #1\expandafter #2\csname + .\xintCeil {\XINT_expr_unlock #3}\endcsname }% -\def\XINT_flexpr_getnext_onetoken_wehope\Z #1% +\let\XINT_flexpr_func_ceil\XINT_expr_func_ceil +\def\XINT_expr_twoargs #1,#2,{{#1}{#2}}% +\def\XINT_expr_func_quo #1#2#3% {% - \xint_gob_til_! #1\XINT_flexpr_subexpr !% - \expandafter\XINT_flexpr_getnext_onetoken_fork\string #1% + \expandafter #1\expandafter #2\csname .% + \expandafter\expandafter\expandafter\xintQuo + \expandafter\XINT_expr_twoargs + \romannumeral-`0\XINT_expr_unlock #3,\endcsname }% -\def\XINT_flexpr_subexpr !#1!{\expandafter\XINT_flexpr_getop\xint_gobble_i }% -\begingroup -\lccode`*=`_ -\lowercase{\endgroup -\def\XINT_flexpr_getnext_onetoken_fork #1% +\let\XINT_flexpr_func_quo\XINT_expr_func_quo +\def\XINT_expr_func_rem #1#2#3% {% - \XINT_expr_sixwayfork - #1-.+*\dummy \XINT_flexpr_oparen - (#1.+*\dummy -% - (-#1+*\dummy {\XINT_flexpr_scannum_start\XINT_expr_scannum_decpart_b.}% - (-.#1*\dummy \XINT_flexpr_getnext% - (-.+#1\dummy {\XINT_flexpr_scannum_start\XINT_expr_scannum_decpart_b*}% - (-.+*\dummy {\XINT_flexpr_scannum_check #1}% - \krof -}}% -\def\XINT_flexpr_scannum_check #1% + \expandafter #1\expandafter #2\csname .% + \expandafter\expandafter\expandafter\xintRem + \expandafter\XINT_expr_twoargs + \romannumeral-`0\XINT_expr_unlock #3,\endcsname +}% +\let\XINT_flexpr_func_rem\XINT_expr_func_rem +\def\XINT_expr_oneortwo #1#2#3,#4,#5.% {% - \ifnum \xint_c_ix<1#1 - \expandafter\XINT_flexpr_scannum_start - \else - \xint_afterfi - {\XINT_expr_unexpectedtoken - \expandafter\XINT_flexpr_getnext\xint_gobble_ii}% - \fi \XINT_expr_scannum_intpart_b #1% + \if\relax#5\relax\expandafter\xint_firstoftwo\else + \expandafter\xint_secondoftwo\fi + {#1{0}{#3}}{#2{\xintNum {#4}}{#3}}% +}% +\def\XINT_expr_func_round #1#2#3% +{% + \expandafter #1\expandafter #2\csname .% + \expandafter\XINT_expr_oneortwo + \expandafter\xintiRound\expandafter\xintRound + \romannumeral-`0\XINT_expr_unlock #3,,.\endcsname +}% +\let\XINT_flexpr_func_round\XINT_expr_func_round +\def\XINT_expr_func_trunc #1#2#3% +{% + \expandafter #1\expandafter #2\csname .% + \expandafter\XINT_expr_oneortwo + \expandafter\xintiTrunc\expandafter\xintTrunc + \romannumeral-`0\XINT_expr_unlock #3,,.\endcsname +}% +\let\XINT_flexpr_func_trunc\XINT_expr_func_trunc +\def\XINT_expr_argandopt #1,#2,#3.% +{% + \if\relax#3\relax\expandafter\xint_firstoftwo\else + \expandafter\xint_secondoftwo\fi + {[\XINTdigits]{#1}}{[\xintNum {#2}]{#1}}% +}% +\def\XINT_expr_func_float #1#2#3% +{% + \expandafter #1\expandafter #2\csname .% + \expandafter\XINTinFloat + \romannumeral-`0\expandafter\XINT_expr_argandopt + \romannumeral-`0\XINT_expr_unlock #3,,.\endcsname }% -\def\XINT_flexpr_scannum_start #1% +\let\XINT_flexpr_func_float\XINT_expr_func_float +\def\XINT_expr_func_sqrt #1#2#3% {% - \expandafter\XINT_flexpr_getop - \romannumeral-`0\expandafter\XINT_expr_gathernum - \romannumeral-`0#1% + \expandafter #1\expandafter #2\csname .% + \expandafter\XINTinFloatSqrt + \romannumeral-`0\expandafter\XINT_expr_argandopt + \romannumeral-`0\XINT_expr_unlock #3,,.\endcsname +}% +\let\XINT_flexpr_func_sqrt\XINT_expr_func_sqrt +\def\XINT_expr_func_gcd #1#2#3% +{% + \expandafter #1\expandafter #2\csname + .\xintGCDof:csv{\XINT_expr_unlock #3}\endcsname +}% +\let\XINT_flexpr_func_gcd\XINT_expr_func_gcd +\def\XINT_expr_func_lcm #1#2#3% +{% + \expandafter #1\expandafter #2\csname + .\xintLCMof:csv{\XINT_expr_unlock #3}\endcsname +}% +\let\XINT_flexpr_func_lcm\XINT_expr_func_lcm +\def\XINT_expr_func_max #1#2#3% +{% + \expandafter #1\expandafter #2\csname + .\xintMaxof:csv{\XINT_expr_unlock #3}\endcsname +}% +\def\XINT_flexpr_func_max #1#2#3% +{% + \expandafter #1\expandafter #2\csname + .\xintFloatMaxof:csv{\XINT_expr_unlock #3}\endcsname +}% +\def\XINT_expr_func_min #1#2#3% +{% + \expandafter #1\expandafter #2\csname + .\xintMinof:csv{\XINT_expr_unlock #3}\endcsname +}% +\def\XINT_flexpr_func_min #1#2#3% +{% + \expandafter #1\expandafter #2\csname + .\xintFloatMinof:csv{\XINT_expr_unlock #3}\endcsname +}% +\def\XINT_expr_func_sum #1#2#3% +{% + \expandafter #1\expandafter #2\csname + .\xintSum:csv{\XINT_expr_unlock #3}\endcsname +}% +\def\XINT_flexpr_func_sum #1#2#3% +{% + \expandafter #1\expandafter #2\csname + .\xintFloatSum:csv{\XINT_expr_unlock #3}\endcsname +}% +\def\XINT_expr_func_prd #1#2#3% +{% + \expandafter #1\expandafter #2\csname + .\xintPrd:csv{\XINT_expr_unlock #3}\endcsname +}% +\def\XINT_flexpr_func_prd #1#2#3% +{% + \expandafter #1\expandafter #2\csname + .\xintFloatPrd:csv{\XINT_expr_unlock #3}\endcsname +}% +\let\XINT_expr_func_add\XINT_expr_func_sum +\let\XINT_expr_func_mul\XINT_expr_func_prd +\let\XINT_flexpr_func_add\XINT_flexpr_func_sum +\let\XINT_flexpr_func_mul\XINT_flexpr_func_prd +\def\XINT_expr_func_? #1#2#3% +{% + \expandafter #1\expandafter #2\csname + .\xintIsNotZero {\XINT_expr_unlock #3}\endcsname +}% +\let\XINT_flexpr_func_? \XINT_expr_func_? +\def\XINT_expr_func_! #1#2#3% +{% + \expandafter #1\expandafter #2\csname + .\xintIsZero {\XINT_expr_unlock #3}\endcsname +}% +\let\XINT_flexpr_func_! \XINT_expr_func_! +\def\XINT_expr_func_not #1#2#3% +{% + \expandafter #1\expandafter #2\csname + .\xintIsZero {\XINT_expr_unlock #3}\endcsname +}% +\let\XINT_flexpr_func_not \XINT_expr_func_not +\def\XINT_expr_func_all #1#2#3% +{% + \expandafter #1\expandafter #2\csname + .\xintANDof:csv{\XINT_expr_unlock #3}\endcsname +}% +\let\XINT_flexpr_func_all\XINT_expr_func_all +\def\XINT_expr_func_any #1#2#3% +{% + \expandafter #1\expandafter #2\csname + .\xintORof:csv{\XINT_expr_unlock #3}\endcsname +}% +\let\XINT_flexpr_func_any\XINT_expr_func_any +\def\XINT_expr_func_xor #1#2#3% +{% + \expandafter #1\expandafter #2\csname + .\xintXORof:csv{\XINT_expr_unlock #3}\endcsname +}% +\let\XINT_flexpr_func_xor\XINT_expr_func_xor +\def\xintifNotZero:: #1,#2,#3,{\xintifNotZero{#1}{#2}{#3}}% +\def\XINT_expr_func_if #1#2#3% +{% + \expandafter #1\expandafter #2\csname + .\expandafter\xintifNotZero:: + \romannumeral-`0\XINT_expr_unlock #3,\endcsname +}% +\let\XINT_flexpr_func_if\XINT_expr_func_if +\def\xintifSgn:: #1,#2,#3,#4,{\xintifSgn{#1}{#2}{#3}{#4}}% +\def\XINT_expr_func_ifsgn #1#2#3% +{% + \expandafter #1\expandafter #2\csname + .\expandafter\xintifSgn:: + \romannumeral-`0\XINT_expr_unlock #3,\endcsname +}% +\let\XINT_flexpr_func_ifsgn\XINT_expr_func_ifsgn +\def\XINT_newexpr_print #1{\ifnum\xintNthElt{0}{#1}>1 + \expandafter\xint_firstoftwo + \else + \expandafter\xint_secondoftwo + \fi + {_xintListWithSep,{#1}}{\xint_firstofone#1}}% +\def\XINT_expr_tmp #1% + {\expandafter\def\csname xint#1\endcsname {_xint#1}}% +\expandafter\def\expandafter\XINT_expr_protect\expandafter +{% + \romannumeral0% + \xintapplyunbraced\XINT_expr_tmp{\xintCSVtoList{% + Floor,Ceil,iRound,Round,iTrunc,Trunc,% + Lt,Gt,Eq,AND,OR,% + IsNotZero,IsZero,% + ifNotZero,ifSgn,% + Irr,Num,Abs,Sgn,Opp,Quo,Rem,% + Add,Sub,Mul,Sqr,Div,Pow,Fac,fE}}% + \def\xintGCDof:csv ##1{_xintGCDof {\xintCSVtoList {##1}}}% + \def\xintLCMof:csv ##1{_xintLCMof {\xintCSVtoList {##1}}}% + \def\xintMaxof:csv ##1{_xintMaxof {\xintCSVtoList {##1}}}% + \def\xintMinof:csv ##1{_xintMinof {\xintCSVtoList {##1}}}% + \def\xintSum:csv ##1{_xintSum {\xintCSVtoList {##1}}}% + \def\xintPrd:csv ##1{_xintPrd {\xintCSVtoList {##1}}}% + \def\xintANDof:csv ##1{_xintANDof {\xintCSVtoList {##1}}}% + \def\xintORof:csv ##1{_xintORof {\xintCSVtoList {##1}}}% + \def\xintXORof:csv ##1{_xintXORof {\xintCSVtoList {##1}}}% + \def\XINTinFloat {_XINTinFloat}% + \def\XINTinFloatSqrt {_XINTinFloatSqrt}% + \def\XINTdigits {_XINTdigits}% + \def\XINT_expr_print ##1{\expandafter\XINT_newexpr_print\expandafter + {\romannumeral0\xintcsvtolist{\XINT_expr_unlock ##1}}}% }% \catcode`* 13 -\def\xintNewExpr #1[#2]#3% +\def\xintNewExpr #1[#2]% {% - \begingroup + \begingroup \ifcase #2\relax \toks0 {\xdef #1}% \or \toks0 {\xdef #1##1}% @@ -690,37 +894,72 @@ \or \toks0 {\xdef #1##1##2##3##4##5##6##7}% \or \toks0 {\xdef #1##1##2##3##4##5##6##7##8}% \or \toks0 {\xdef #1##1##2##3##4##5##6##7##8##9}% - \else - \immediate\write-1{Package xintexpr Error! illegal number of macro - parameters.}% \fi - \def\xintAdd {:xintAdd}% - \def\xintSub {:xintSub}% - \def\xintMul {:xintMul}% - \def\xintDiv {:xintDiv}% - \def\xintPow {:xintPow}% - \def\xintFac {:xintFac}% - \def\xintOpp {:xintOpp}% - \def\xintfE {:xintfE}% - \def\xintraw { :romannumeral0:xintraw}% - \def\XINT_expr_the ##1##2##3% - {\expandafter\xintraw - \expandafter{\romannumeral-`0\XINT_expr_string ##3}}% - \lccode`\*=`: \lowercase {\def*}{!noexpand!}% - \catcode`: 13 - \endlinechar -1 + \xintexprSafeCatcodes + \XINT_NewExpr +}% +\def\XINT_NewExpr #1% +{% + \def\xintTmp ##1##2##3##4##5##6##7##8##9{#1}% + \XINT_expr_protect + \lccode`\*=`_ \lowercase {\def*}{!noexpand!}% + \catcode`_ 13 \catcode`: 11 \endlinechar -1 \everyeof {\noexpand }% - \edef\xintNewExprtmp + \edef\XINTtmp ##1##2##3##4##5##6##7##8##9% {\scantokens - \expandafter{\romannumeral0\xinttheeval #3\relax}}% - \lccode`\*=`_ \lowercase {\def*}{####}% - \catcode`_ 13 \catcode`! 0 \catcode`: 11 - \the\toks0 {\scantokens\expandafter{\xintNewExprtmp }}% + \expandafter{\romannumeral-`0\xinttheexpr + \xintTmp {####1}{####2}{####3}% + {####4}{####5}{####6}% + {####7}{####8}{####9}% + \relax}}% + \lccode`\*=`\$ \lowercase {\def*}{####}% + \catcode`\$ 13 \catcode`! 0 \catcode`_ 11 % + \the\toks0 + {\scantokens\expandafter{\expandafter + \XINT_newexpr_stripprefix\meaning\XINTtmp}}% \endgroup }% -\def\xintNewFloatExpr #1[#2]#3% +\def\XINT_newflexpr_print #1{\ifnum\xintNthElt{0}{#1}>1 + \expandafter\xint_firstoftwo + \else + \expandafter\xint_secondoftwo + \fi + {_xintListWithSep,{\xintApply{_xintFloat}{#1}}} + {_xintFloat#1}}% +\expandafter\def\expandafter\XINT_flexpr_protect\expandafter {% - \begingroup + \romannumeral0% + \xintapplyunbraced\XINT_expr_tmp{\xintCSVtoList{% + Floor,Ceil,iRound,Round,iTrunc,Trunc,% + Lt,Gt,Eq,AND,OR,% + IsNotZero,IsZero,% + ifNotZero,ifSgn,% + Irr,Num,Abs,Sgn,Opp,Quo,Rem,Fac}}% + \def\xintGCDof:csv ##1{_xintGCDof {\xintCSVtoList {##1}}}% + \def\xintLCMof:csv ##1{_xintLCMof {\xintCSVtoList {##1}}}% + \def\xintFloatMaxof:csv ##1{_xintFloatMaxof {\xintCSVtoList {##1}}}% + \def\xintFloatMinof:csv ##1{_xintFloatMinof {\xintCSVtoList {##1}}}% + \def\xintFloatSum:csv ##1{_xintFloatSum {\xintCSVtoList {##1}}}% + \def\xintFloatPrd:csv ##1{_xintFloatPrd {\xintCSVtoList {##1}}}% + \def\xintANDof:csv ##1{_xintANDof {\xintCSVtoList {##1}}}% + \def\xintORof:csv ##1{_xintORof {\xintCSVtoList {##1}}}% + \def\xintXORof:csv ##1{_xintXORof {\xintCSVtoList {##1}}}% + \def\XINTinFloat {_XINTinFloat}% + \def\XINTinFloatSqrt {_XINTinFloatSqrt}% + \def\XINTinFloatAdd {_XINTinFloatAdd}% + \def\XINTinFloatSub {_XINTinFloatSub}% + \def\XINTinFloatMul {_XINTinFloatMul}% + \def\XINTinFloatDiv {_XINTinFloatDiv}% + \def\XINTinFloatPower {_XINTinFloatPower}% + \def\XINTinFloatfE {_XINTinFloatfE}% + \def\XINTdigits {_XINTdigits}% + \def\XINT_flexpr_print ##1{\expandafter\XINT_newflexpr_print\expandafter + {\romannumeral0\xintcsvtolist{\XINT_expr_unlock ##1}}}% +}% +\let\XINT_expr_tmp\empty +\def\xintNewFloatExpr #1[#2]% +{% + \begingroup \ifcase #2\relax \toks0 {\xdef #1}% \or \toks0 {\xdef #1##1}% @@ -732,34 +971,77 @@ \or \toks0 {\xdef #1##1##2##3##4##5##6##7}% \or \toks0 {\xdef #1##1##2##3##4##5##6##7##8}% \or \toks0 {\xdef #1##1##2##3##4##5##6##7##8##9}% - \else - \immediate\write-1{Package xintexpr Error! illegal number of macro - parameters.}% \fi - \def\XINTinFloatAdd {:XINTinFloatAdd}% - \def\XINTinFloatSub {:XINTinFloatSub}% - \def\XINTinFloatMul {:XINTinFloatMul}% - \def\XINTinFloatDiv {:XINTinFloatDiv}% - \def\XINTinFloatPower {:XINTinFloatPower}% - \def\xintFac {:xintFac}% - \def\xintOpp {:xintOpp}% - \def\XINTinFloatfE {:XINTinFloatfE}% - \def\xintfloat { :romannumeral0:xintfloat}% - \def\XINT_flexpr_the ##1##2##3% - {\expandafter\xintfloat - \expandafter{\romannumeral-`0\XINT_expr_string ##3}}% - \lccode`\*=`: \lowercase {\def*}{!noexpand!}% - \catcode`: 13 - \endlinechar -1 + \xintexprSafeCatcodes + \XINT_NewFloatExpr +}% +\def\XINT_NewFloatExpr #1% +{% + \def\xintTmp ##1##2##3##4##5##6##7##8##9{#1}% + \XINT_flexpr_protect + \lccode`\*=`_ \lowercase {\def*}{!noexpand!}% + \catcode`_ 13 \catcode`: 11 \endlinechar -1 % \everyeof {\noexpand }% - \edef\xintNewExprtmp + \edef\XINTtmp ##1##2##3##4##5##6##7##8##9% {\scantokens - \expandafter{\romannumeral0\xintthefloateval #3\relax}}% - \lccode`\*=`_ \lowercase {\def*}{####}% - \catcode`_ 13 \catcode`! 0 \catcode`: 11 - \the\toks0 {\scantokens\expandafter{\xintNewExprtmp }}% + \expandafter{\romannumeral-`0\xintthefloatexpr + \xintTmp {####1}{####2}{####3}% + {####4}{####5}{####6}% + {####7}{####8}{####9}% + \relax}}% + \lccode`\*=`\$ \lowercase {\def*}{####}% + \catcode`\$ 13 \catcode`! 0 \catcode`_ 11 % + \the\toks0 + {\scantokens\expandafter + {\expandafter\XINT_newexpr_stripprefix\meaning\XINTtmp}}% \endgroup }% +\let\xintexprRestoreCatcodes\relax +\def\xintexprSafeCatcodes +{% for end user. + \edef\xintexprRestoreCatcodes {% + \catcode63=\the\catcode63 % ? + \catcode124=\the\catcode124 % | + \catcode38=\the\catcode38 % & + \catcode33=\the\catcode33 % ! + \catcode93=\the\catcode93 % ] + \catcode91=\the\catcode91 % [ + \catcode94=\the\catcode94 % ^ + \catcode95=\the\catcode95 % _ + \catcode47=\the\catcode47 % / + \catcode41=\the\catcode41 % ) + \catcode40=\the\catcode40 % ( + \catcode42=\the\catcode42 % * + \catcode43=\the\catcode43 % + + \catcode62=\the\catcode62 % > + \catcode60=\the\catcode60 % < + \catcode58=\the\catcode58 % : + \catcode46=\the\catcode46 % . + \catcode45=\the\catcode45 % - + \catcode44=\the\catcode44 % , + \catcode61=\the\catcode61\relax % = + }% this is just for some standard situation with a few made active by Babel + \catcode63=12 % ? + \catcode124=12 % | + \catcode38=4 % & + \catcode33=12 % ! + \catcode93=12 % ] + \catcode91=12 % [ + \catcode94=7 % ^ + \catcode95=8 % _ + \catcode47=12 % / + \catcode41=12 % ) + \catcode40=12 % ( + \catcode42=12 % * + \catcode43=12 % + + \catcode62=12 % > + \catcode60=12 % < + \catcode58=12 % : + \catcode46=12 % . + \catcode45=12 % - + \catcode44=12 % , + \catcode61=12 % = +}% \XINT_expr_restorecatcodes_endinput% \endinput %% diff --git a/Master/texmf-dist/tex/generic/xint/xintfrac.sty b/Master/texmf-dist/tex/generic/xint/xintfrac.sty index 162aa549471..dc3c8ad2f9a 100644 --- a/Master/texmf-dist/tex/generic/xint/xintfrac.sty +++ b/Master/texmf-dist/tex/generic/xint/xintfrac.sty @@ -22,7 +22,7 @@ %% in the same archive or directory.) %% %%---------------------------------------------------------------- -%% The xint bundle (version 1.08b of June 14, 2013) +%% The xint bundle (version 1.09a of September 22, 2013) %% xintfrac: Expandable operations on fractions %% Copyright (C) 2013 by Jean-Francois Burnol %%---------------------------------------------------------------- @@ -165,7 +165,7 @@ \fi \expandafter\x\csname ver@xintfrac.sty\endcsname \ProvidesPackage{xintfrac}% - [2013/06/14 v1.08b Expandable operations on fractions (jfB)]% + [2013/09/24 v1.09a Expandable operations on fractions (jfB)]% \chardef\xint_c_vi 6 \chardef\xint_c_vii 7 \chardef\xint_c_xviii 18 @@ -480,6 +480,12 @@ \def\XINT_rawz_Ba #1#2#3{\expandafter\XINT_rawz_Bb \expandafter{\romannumeral0\xint_dsh {#3}{#1}}{#2}}% \def\XINT_rawz_Bb #1#2{ #2/#1}% +\def\xintFloor {\romannumeral0\xintfloor }% +\def\xintfloor #1{\expandafter\XINT_floor + \romannumeral0\xintrawwithzeros {#1}.}% +\def\XINT_floor #1/#2.{\xintiquo {#1}{#2}}% +\def\xintCeil {\romannumeral0\xintceil }% +\def\xintceil #1{\xintiiopp {\xintFloor {\xintOpp{#1}}}}% \def\xintNumerator {\romannumeral0\xintnumerator }% \def\xintnumerator {% @@ -781,8 +787,8 @@ \def\XINT_jrr_loop_b #1#2#3#4#5#6#7% {% \expandafter \XINT_jrr_loop_c \expandafter - {\romannumeral0\xintiadd{\XINT_Mul{#4}{#1}}{#6}}% - {\romannumeral0\xintiadd{\XINT_Mul{#5}{#1}}{#7}}% + {\romannumeral0\xintiiadd{\XINT_Mul{#4}{#1}}{#6}}% + {\romannumeral0\xintiiadd{\XINT_Mul{#5}{#1}}{#7}}% {#2}{#3}{#4}{#5}% }% \def\XINT_jrr_loop_c #1#2% @@ -965,10 +971,20 @@ {% \XINT_addm_A 0{}1000\W\X\Y\Z #1000\W\X\Y\Z \Z }% -\mathchardef\XINT_digits 16 +\def\xintRound:csv #1{\expandafter\XINT_round:_a\romannumeral-`0#1,,^}% +\def\XINT_round:_a {\XINT_round:_b {}}% +\def\XINT_round:_b #1#2,% + {\expandafter\XINT_round:_c\romannumeral-`0#2,{#1}}% +\def\XINT_round:_c #1{\if #1,\expandafter\XINT_round:_f + \else\expandafter\XINT_round:_d\fi #1}% +\def\XINT_round:_d #1,% + {\expandafter\XINT_round:_e\romannumeral0\xintiround 0{#1},}% +\def\XINT_round:_e #1,#2{\XINT_round:_b {#2,#1}}% +\def\XINT_round:_f ,#1#2^{\xint_gobble_i #1}% +\mathchardef\XINTdigits 16 \def\xintDigits #1#2% - {\afterassignment \xint_gobble_i \mathchardef\XINT_digits=}% -\def\xinttheDigits {\number\XINT_digits }% + {\afterassignment \xint_gobble_i \mathchardef\XINTdigits=}% +\def\xinttheDigits {\number\XINTdigits }% \def\xintFloat {\romannumeral0\xintfloat }% \def\xintfloat #1{\XINT_float_chkopt #1\Z }% \def\XINT_float_chkopt #1% @@ -979,7 +995,7 @@ }% \def\XINT_float_noopt #1\Z {% - \expandafter\XINT_float_a\expandafter\XINT_digits + \expandafter\XINT_float_a\expandafter\XINTdigits \romannumeral0\XINT_infrac {#1}\XINT_float_Q }% \def\XINT_float_opt [\Z #1]#2% @@ -1019,7 +1035,8 @@ \def\XINT_float_Ma #1#2#3% {% \expandafter\XINT_float_Mb\expandafter - {\the\numexpr #1-#2\expandafter}\expandafter + {\the\numexpr #1-#2\expandafter\expandafter\expandafter}% + \expandafter\expandafter\expandafter {\expandafter\xint_firstoftwo \romannumeral0\XINT_split_fromleft_loop {#2}{}#3\W\W\W\W\W\W\W\W\Z }{#2}% @@ -1050,7 +1067,8 @@ \expandafter\XINT_float_P\expandafter {\the\numexpr #2\expandafter}\expandafter {\the\numexpr #2\expandafter}\expandafter - {\the\numexpr #3-#1+#2\expandafter}\expandafter + {\the\numexpr #3-#1+#2\expandafter\expandafter\expandafter}% + \expandafter\expandafter\expandafter {\expandafter\xint_firstoftwo \romannumeral0\XINT_split_fromleft_loop {#2}{}#4\W\W\W\W\W\W\W\W\Z }% @@ -1072,13 +1090,13 @@ {% \expandafter\XINT_float_Sa \romannumeral0\xintiquo {#2}% - {\romannumeral-`0\XINT_dsx_addzerosnofuss {-#1}{#3}}\Z {#1}% + {\XINT_dsx_addzerosnofuss {-#1}{#3}}\Z {#1}% }% \def\XINT_float_Rii #1#2#3% {% \expandafter\XINT_float_Sa \romannumeral0\xintiquo - {\romannumeral-`0\XINT_dsx_addzerosnofuss {#1}{#2}}{#3}\Z {#1}% + {\XINT_dsx_addzerosnofuss {#1}{#2}}{#3}\Z {#1}% }% \def\XINT_float_Sa #1% {% @@ -1140,6 +1158,17 @@ {\the\numexpr #3+#4+\xint_c_i-#2}{#1}% }% \def\XINT_float_Y #1#2{ #2e#1}% +\def\xintFloat:csv #1{\expandafter\XINT_float:_a\romannumeral-`0#1,,^}% +\def\XINT_float:_a {\XINT_float:_b {}}% +\def\XINT_float:_b #1#2,% + {\expandafter\XINT_float:_c\romannumeral-`0#2,{#1}}% +\def\XINT_float:_c #1{\if #1,\expandafter\XINT_float:_f + \else\expandafter\XINT_float:_d\fi #1}% +\def\XINT_float:_d #1,% + {\expandafter\XINT_float:_e\romannumeral0\xintfloat {#1},}% +\def\XINT_float:_e #1,#2{\XINT_float:_b {#2,#1}}% +\def\XINT_float:_f ,#1#2^{\xint_gobble_i #1}% +\def\XINTinFloat {\romannumeral0\XINT_inFloat }% \def\XINT_inFloat [#1]#2% {% \expandafter\XINT_infloat_a\expandafter @@ -1158,8 +1187,8 @@ 0-\dummy {\XINT_float_K #1}% \krof }% -\def\XINT_infloat_zero #1\Z #2#3#4#5{0[0]}% -\def\XINT_infloat_J {\expandafter-\romannumeral-`0\XINT_float_K }% +\def\XINT_infloat_zero #1\Z #2#3#4#5{ 0[0]}% +\def\XINT_infloat_J {\expandafter-\romannumeral0\XINT_float_K }% \def\XINT_infloat_Q #1% {% \ifnum #1<\xint_c_ @@ -1172,13 +1201,13 @@ {% \expandafter\XINT_infloat_S\expandafter {\romannumeral0\xintiquo {#2}% - {\romannumeral-`0\XINT_dsx_addzerosnofuss {-#1}{#3}}}{#1}% + {\XINT_dsx_addzerosnofuss {-#1}{#3}}}{#1}% }% \def\XINT_infloat_Rii #1#2#3% {% \expandafter\XINT_infloat_S\expandafter {\romannumeral0\xintiquo - {\romannumeral-`0\XINT_dsx_addzerosnofuss {#1}{#2}}{#3}}{#1}% + {\XINT_dsx_addzerosnofuss {#1}{#2}}{#3}}{#1}% }% \def\XINT_infloat_S #1#2#3% {% @@ -1246,10 +1275,10 @@ \def\XINT_fadd_B #1#2#3#4#5#6#7% {% \expandafter\XINT_fadd_C\expandafter - {\romannumeral0\xintimul {#7}{#5}}% - {\romannumeral0\xintiadd - {\romannumeral0\xintimul {\xintDSH {\the\numexpr -#3+#1\relax}{#6}}{#5}}% - {\romannumeral0\xintimul {#7}{\xintDSH {\the\numexpr -#2+#1\relax}{#4}}}% + {\romannumeral0\xintiimul {#7}{#5}}% + {\romannumeral0\xintiiadd + {\romannumeral0\xintiimul {\xintDSH {\the\numexpr -#3+#1\relax}{#6}}{#5}}% + {\romannumeral0\xintiimul {#7}{\xintDSH {\the\numexpr -#2+#1\relax}{#4}}}% }% {#1}% }% @@ -1277,10 +1306,10 @@ \def\XINT_fsub_B #1#2#3#4#5#6#7% {% \expandafter\XINT_fsub_C\expandafter - {\romannumeral0\xintimul {#7}{#5}}% - {\romannumeral0\xintisub - {\romannumeral0\xintimul {\xintDSH {\the\numexpr -#3+#1\relax}{#6}}{#5}}% - {\romannumeral0\xintimul {#7}{\xintDSH {\the\numexpr -#2+#1\relax}{#4}}}% + {\romannumeral0\xintiimul {#7}{#5}}% + {\romannumeral0\xintiisub + {\romannumeral0\xintiimul {\xintDSH {\the\numexpr -#3+#1\relax}{#6}}{#5}}% + {\romannumeral0\xintiimul {#7}{\xintDSH {\the\numexpr -#2+#1\relax}{#4}}}% }% {#1}% }% @@ -1308,6 +1337,14 @@ \expandafter\XINT_fsum_loop_a\expandafter{\romannumeral0\xintadd {#2}{#1}}% }% \def\XINT_fsum_finished #1\Z #2{ #2}% +\def\xintSum:csv #1{\expandafter\XINT_sum:_a\romannumeral-`0#1,,^}% +\def\XINT_sum:_a {\XINT_sum:_b {0/1[0]}}% +\def\XINT_sum:_b #1#2,{\expandafter\XINT_sum:_c\romannumeral-`0#2,{#1}}% +\def\XINT_sum:_c #1{\if #1,\expandafter\XINT_sum:_e + \else\expandafter\XINT_sum:_d\fi #1}% +\def\XINT_sum:_d #1,#2{\expandafter\XINT_sum:_b\expandafter + {\romannumeral0\xintadd {#2}{#1}}}% +\def\XINT_sum:_e ,#1#2^{#1}% allows empty list \def\xintMul {\romannumeral0\xintmul }% \def\xintmul #1% {% @@ -1319,8 +1356,8 @@ {% \expandafter\XINT_fmul_B \expandafter{\the\numexpr #1+#4\expandafter}% - \expandafter{\romannumeral0\xintimul {#6}{#3}}% - {\romannumeral0\xintimul {#5}{#2}}% + \expandafter{\romannumeral0\xintiimul {#6}{#3}}% + {\romannumeral0\xintiimul {#5}{#2}}% }% \def\XINT_fmul_B #1#2#3% {% @@ -1398,6 +1435,14 @@ \expandafter\XINT_fprod_loop_a\expandafter{\romannumeral0\xintmul {#1}{#2}}% }% \def\XINT_fprod_finished #1\Z #2{ #2}% +\def\xintPrd:csv #1{\expandafter\XINT_prd:_a\romannumeral-`0#1,,^}% +\def\XINT_prd:_a {\XINT_prd:_b {1/1[0]}}% +\def\XINT_prd:_b #1#2,{\expandafter\XINT_prd:_c\romannumeral-`0#2,{#1}}% +\def\XINT_prd:_c #1{\if #1,\expandafter\XINT_prd:_e + \else\expandafter\XINT_prd:_d\fi #1}% +\def\XINT_prd:_d #1,#2{\expandafter\XINT_prd:_b\expandafter + {\romannumeral0\xintmul {#2}{#1}}}% +\def\XINT_prd:_e ,#1#2^{#1}% allows empty list \def\xintDiv {\romannumeral0\xintdiv }% \def\xintdiv #1% {% @@ -1409,8 +1454,8 @@ {% \expandafter\XINT_fdiv_B \expandafter{\the\numexpr #4-#1\expandafter}% - \expandafter{\romannumeral0\xintimul {#2}{#6}}% - {\romannumeral0\xintimul {#3}{#5}}% + \expandafter{\romannumeral0\xintiimul {#2}{#6}}% + {\romannumeral0\xintiimul {#3}{#5}}% }% \def\XINT_fdiv_B #1#2#3% {% @@ -1418,6 +1463,10 @@ \expandafter{#3}{#1}{#2}% }% \def\XINT_fdiv_C #1#2{\XINT_outfrac {#2}{#1}}% +\def\xintIsOne {\romannumeral0\xintisone }% +\def\xintisone #1{\expandafter\XINT_fracisone + \romannumeral0\xintrawwithzeros{#1}\Z }% +\def\XINT_fracisone #1/#2\Z{\xintsgnfork{\XINT_Cmp {#1}{#2}}{0}{1}{0}}% \def\xintGeq {\romannumeral0\xintgeq }% \def\xintgeq #1% {% @@ -1438,8 +1487,8 @@ \xint_gob_til_zero #4\XINT_fgeq_Zi 0% \expandafter\XINT_fgeq_C\expandafter {\the\numexpr #7-#3\expandafter}\expandafter - {\romannumeral0\xintimul {#4#5}{#2}}% - {\romannumeral0\xintimul {#6}{#1}}% + {\romannumeral0\xintiimul {#4#5}{#2}}% + {\romannumeral0\xintiimul {#6}{#1}}% }% \def\XINT_fgeq_Zi 0#1#2#3#4#5#6#7{ 0}% \def\XINT_fgeq_C #1#2#3% @@ -1505,6 +1554,45 @@ \or \xint_afterfi{ #2}% \fi }% +\def\xintMaxof {\romannumeral0\xintmaxof }% +\def\xintmaxof #1{\expandafter\XINT_maxof_a\romannumeral-`0#1\relax }% +\def\XINT_maxof_a #1{\expandafter\XINT_maxof_b\romannumeral0\xintraw{#1}\Z }% +\def\XINT_maxof_b #1\Z #2% + {\expandafter\XINT_maxof_c\romannumeral-`0#2\Z {#1}\Z}% +\def\XINT_maxof_c #1% + {\xint_gob_til_relax #1\XINT_maxof_e\relax\XINT_maxof_d #1}% +\def\XINT_maxof_d #1\Z + {\expandafter\XINT_maxof_b\romannumeral0\xintmax {#1}}% +\def\XINT_maxof_e #1\Z #2\Z { #2}% +\def\xintMaxof:csv #1{\expandafter\XINT_maxof:_b\romannumeral-`0#1,,}% +\def\XINT_maxof:_b #1,#2,{\expandafter\XINT_maxof:_c\romannumeral-`0#2,{#1},}% +\def\XINT_maxof:_c #1{\if #1,\expandafter\XINT_maxof:_e + \else\expandafter\XINT_maxof:_d\fi #1}% +\def\XINT_maxof:_d #1,{\expandafter\XINT_maxof:_b\romannumeral0\xintmax {#1}}% +\def\XINT_maxof:_e ,#1,{#1}% +\def\xintFloatMaxof {\romannumeral0\xintflmaxof }% +\def\xintflmaxof #1{\expandafter\XINT_flmaxof_a\romannumeral-`0#1\relax }% +\def\XINT_flmaxof_a #1{\expandafter\XINT_flmaxof_b + \romannumeral0\XINT_inFloat [\XINTdigits]{#1}\Z }% +\def\XINT_flmaxof_b #1\Z #2% + {\expandafter\XINT_flmaxof_c\romannumeral-`0#2\Z {#1}\Z}% +\def\XINT_flmaxof_c #1% + {\xint_gob_til_relax #1\XINT_flmaxof_e\relax\XINT_flmaxof_d #1}% +\def\XINT_flmaxof_d #1\Z + {\expandafter\XINT_flmaxof_b\romannumeral0\xintmax + {\XINTinFloat [\XINTdigits]{#1}}}% +\def\XINT_flmaxof_e #1\Z #2\Z { #2}% +\def\xintFloatMaxof:csv #1{\expandafter\XINT_flmaxof:_a\romannumeral-`0#1,,}% +\def\XINT_flmaxof:_a #1,{\expandafter\XINT_flmaxof:_b + \romannumeral0\XINT_inFloat [\XINTdigits]{#1},}% +\def\XINT_flmaxof:_b #1,#2,% + {\expandafter\XINT_flmaxof:_c\romannumeral-`0#2,{#1},}% +\def\XINT_flmaxof:_c #1{\if #1,\expandafter\XINT_flmaxof:_e + \else\expandafter\XINT_flmaxof:_d\fi #1}% +\def\XINT_flmaxof:_d #1,% + {\expandafter\XINT_flmaxof:_b\romannumeral0\xintmax + {\XINTinFloat [\XINTdigits]{#1}}}% +\def\XINT_flmaxof:_e ,#1,{#1}% \def\xintMin {\romannumeral0\xintmin }% \def\xintmin #1% {% @@ -1539,6 +1627,45 @@ \or \xint_afterfi{ #1}% \fi }% +\def\xintMinof {\romannumeral0\xintminof }% +\def\xintminof #1{\expandafter\XINT_minof_a\romannumeral-`0#1\relax }% +\def\XINT_minof_a #1{\expandafter\XINT_minof_b\romannumeral0\xintraw{#1}\Z }% +\def\XINT_minof_b #1\Z #2% + {\expandafter\XINT_minof_c\romannumeral-`0#2\Z {#1}\Z}% +\def\XINT_minof_c #1% + {\xint_gob_til_relax #1\XINT_minof_e\relax\XINT_minof_d #1}% +\def\XINT_minof_d #1\Z + {\expandafter\XINT_minof_b\romannumeral0\xintmin {#1}}% +\def\XINT_minof_e #1\Z #2\Z { #2}% +\def\xintMinof:csv #1{\expandafter\XINT_minof:_b\romannumeral-`0#1,,}% +\def\XINT_minof:_b #1,#2,{\expandafter\XINT_minof:_c\romannumeral-`0#2,{#1},}% +\def\XINT_minof:_c #1{\if #1,\expandafter\XINT_minof:_e + \else\expandafter\XINT_minof:_d\fi #1}% +\def\XINT_minof:_d #1,{\expandafter\XINT_minof:_b\romannumeral0\xintmin {#1}}% +\def\XINT_minof:_e ,#1,{#1}% +\def\xintFloatMinof {\romannumeral0\xintflminof }% +\def\xintflminof #1{\expandafter\XINT_flminof_a\romannumeral-`0#1\relax }% +\def\XINT_flminof_a #1{\expandafter\XINT_flminof_b + \romannumeral0\XINT_inFloat [\XINTdigits]{#1}\Z }% +\def\XINT_flminof_b #1\Z #2% + {\expandafter\XINT_flminof_c\romannumeral-`0#2\Z {#1}\Z}% +\def\XINT_flminof_c #1% + {\xint_gob_til_relax #1\XINT_flminof_e\relax\XINT_flminof_d #1}% +\def\XINT_flminof_d #1\Z + {\expandafter\XINT_flminof_b\romannumeral0\xintmin + {\XINTinFloat [\XINTdigits]{#1}}}% +\def\XINT_flminof_e #1\Z #2\Z { #2}% +\def\xintFloatMinof:csv #1{\expandafter\XINT_flminof:_a\romannumeral-`0#1,,}% +\def\XINT_flminof:_a #1,{\expandafter\XINT_flminof:_b + \romannumeral0\XINT_inFloat [\XINTdigits]{#1},}% +\def\XINT_flminof:_b #1,#2,% + {\expandafter\XINT_flminof:_c\romannumeral-`0#2,{#1},}% +\def\XINT_flminof:_c #1{\if #1,\expandafter\XINT_flminof:_e + \else\expandafter\XINT_flminof:_d\fi #1}% +\def\XINT_flminof:_d #1,% + {\expandafter\XINT_flminof:_b\romannumeral0\xintmin + {\XINTinFloat [\XINTdigits]{#1}}}% +\def\XINT_flminof:_e ,#1,{#1}% \def\xintCmp {\romannumeral0\xintcmp }% \def\xintcmp #1% {% @@ -1571,9 +1698,9 @@ \krof #1#2% }% -\def\XINT_fcmp_zerozero #1[#2]#3[#4]{ 0}% -\def\XINT_fcmp_firstzero #1[#2]#3[#4]{ -1}% -\def\XINT_fcmp_secondzero #1[#2]#3[#4]{ 1}% +\def\XINT_fcmp_zerozero #1#2#3#4{ 0}% 1.08b had some [ and ] here!!! +\def\XINT_fcmp_firstzero #1#2#3#4{ -1}% incredibly I never saw that until +\def\XINT_fcmp_secondzero #1#2#3#4{ 1}% preparing 1.09a. \def\XINT_fcmp_pos #1#2#3#4% {% \XINT_fcmp_B #1#3#2#4% @@ -1582,8 +1709,8 @@ {% \expandafter\XINT_fcmp_C\expandafter {\the\numexpr #6-#3\expandafter}\expandafter - {\romannumeral0\xintimul {#4}{#2}}% - {\romannumeral0\xintimul {#5}{#1}}% + {\romannumeral0\xintiimul {#4}{#2}}% + {\romannumeral0\xintiimul {#5}{#1}}% }% \def\XINT_fcmp_C #1#2#3% {% @@ -1696,7 +1823,7 @@ }% \def\xintFloatAdd {\romannumeral0\xintfloatadd }% \def\xintfloatadd #1{\XINT_fladd_chkopt \xintfloat #1\Z }% -\def\XINTinFloatAdd {\romannumeral-`0\XINTinfloatadd }% +\def\XINTinFloatAdd {\romannumeral0\XINTinfloatadd }% \def\XINTinfloatadd #1{\XINT_fladd_chkopt \XINT_inFloat #1\Z }% \def\XINT_fladd_chkopt #1#2% {% @@ -1706,7 +1833,7 @@ }% \def\XINT_fladd_noopt #1#2\Z #3% {% - #1[\XINT_digits]{\XINT_FL_Add {\XINT_digits+2}{#2}{#3}}% + #1[\XINTdigits]{\XINT_FL_Add {\XINTdigits+2}{#2}{#3}}% }% \def\XINT_fladd_opt #1[\Z #2]#3#4% {% @@ -1715,11 +1842,11 @@ \def\XINT_FL_Add #1#2% {% \expandafter\XINT_FL_Add_a\expandafter{\the\numexpr #1\expandafter}% - \expandafter{\romannumeral-`0\XINT_inFloat [#1]{#2}}% + \expandafter{\romannumeral0\XINT_inFloat [#1]{#2}}% }% \def\XINT_FL_Add_a #1#2#3% {% - \expandafter\XINT_FL_Add_b\romannumeral-`0\XINT_inFloat [#1]{#3}#2{#1}% + \expandafter\XINT_FL_Add_b\romannumeral0\XINT_inFloat [#1]{#3}#2{#1}% }% \def\XINT_FL_Add_b #1% {% @@ -1743,7 +1870,7 @@ \def\XINT_FL_Add_zerobis 0\XINT_FL_Add_d #1[#2]0[0]#3{#1[#2]}% \def\xintFloatSub {\romannumeral0\xintfloatsub }% \def\xintfloatsub #1{\XINT_flsub_chkopt \xintfloat #1\Z }% -\def\XINTinFloatSub {\romannumeral-`0\XINTinfloatsub }% +\def\XINTinFloatSub {\romannumeral0\XINTinfloatsub }% \def\XINTinfloatsub #1{\XINT_flsub_chkopt \XINT_inFloat #1\Z }% \def\XINT_flsub_chkopt #1#2% {% @@ -1753,7 +1880,7 @@ }% \def\XINT_flsub_noopt #1#2\Z #3% {% - #1[\XINT_digits]{\XINT_FL_Add {\XINT_digits+2}{#2}{\xintOpp{#3}}}% + #1[\XINTdigits]{\XINT_FL_Add {\XINTdigits+2}{#2}{\xintOpp{#3}}}% }% \def\XINT_flsub_opt #1[\Z #2]#3#4% {% @@ -1761,7 +1888,7 @@ }% \def\xintFloatMul {\romannumeral0\xintfloatmul}% \def\xintfloatmul #1{\XINT_flmul_chkopt \xintfloat #1\Z }% -\def\XINTinFloatMul {\romannumeral-`0\XINTinfloatmul }% +\def\XINTinFloatMul {\romannumeral0\XINTinfloatmul }% \def\XINTinfloatmul #1{\XINT_flmul_chkopt \XINT_inFloat #1\Z }% \def\XINT_flmul_chkopt #1#2% {% @@ -1771,7 +1898,7 @@ }% \def\XINT_flmul_noopt #1#2\Z #3% {% - #1[\XINT_digits]{\XINT_FL_Mul {\XINT_digits+2}{#2}{#3}}% + #1[\XINTdigits]{\XINT_FL_Mul {\XINTdigits+2}{#2}{#3}}% }% \def\XINT_flmul_opt #1[\Z #2]#3#4% {% @@ -1780,16 +1907,16 @@ \def\XINT_FL_Mul #1#2% {% \expandafter\XINT_FL_Mul_a\expandafter{\the\numexpr #1\expandafter}% - \expandafter{\romannumeral-`0\XINT_inFloat [#1]{#2}}% + \expandafter{\romannumeral0\XINT_inFloat [#1]{#2}}% }% \def\XINT_FL_Mul_a #1#2#3% {% - \expandafter\XINT_FL_Mul_b\romannumeral-`0\XINT_inFloat [#1]{#3}#2% + \expandafter\XINT_FL_Mul_b\romannumeral0\XINT_inFloat [#1]{#3}#2% }% -\def\XINT_FL_Mul_b #1[#2]#3[#4]{\xintE{\xintiMul {#1}{#3}}{#2+#4}}% +\def\XINT_FL_Mul_b #1[#2]#3[#4]{\xintE{\xintiiMul {#1}{#3}}{#2+#4}}% \def\xintFloatDiv {\romannumeral0\xintfloatdiv}% \def\xintfloatdiv #1{\XINT_fldiv_chkopt \xintfloat #1\Z }% -\def\XINTinFloatDiv {\romannumeral-`0\XINTinfloatdiv }% +\def\XINTinFloatDiv {\romannumeral0\XINTinfloatdiv }% \def\XINTinfloatdiv #1{\XINT_fldiv_chkopt \XINT_inFloat #1\Z }% \def\XINT_fldiv_chkopt #1#2% {% @@ -1799,7 +1926,7 @@ }% \def\XINT_fldiv_noopt #1#2\Z #3% {% - #1[\XINT_digits]{\XINT_FL_Div {\XINT_digits+2}{#2}{#3}}% + #1[\XINTdigits]{\XINT_FL_Div {\XINTdigits+2}{#2}{#3}}% }% \def\XINT_fldiv_opt #1[\Z #2]#3#4% {% @@ -1808,16 +1935,56 @@ \def\XINT_FL_Div #1#2% {% \expandafter\XINT_FL_Div_a\expandafter{\the\numexpr #1\expandafter}% - \expandafter{\romannumeral-`0\XINT_inFloat [#1]{#2}}% + \expandafter{\romannumeral0\XINT_inFloat [#1]{#2}}% }% \def\XINT_FL_Div_a #1#2#3% {% - \expandafter\XINT_FL_Div_b\romannumeral-`0\XINT_inFloat [#1]{#3}#2% + \expandafter\XINT_FL_Div_b\romannumeral0\XINT_inFloat [#1]{#3}#2% }% \def\XINT_FL_Div_b #1[#2]#3[#4]{\xintE{#3/#1}{#4-#2}}% +\def\xintFloatSum {\romannumeral0\xintfloatsum }% +\def\xintfloatsum #1{\expandafter\XINT_floatsum_a\romannumeral-`0#1\relax }% +\def\XINT_floatsum_a #1{\expandafter\XINT_floatsum_b + \romannumeral0\xintraw{#1}\Z }% normalizes if only 1 +\def\XINT_floatsum_b #1\Z #2% but a bit wasteful + {\expandafter\XINT_floatsum_c\romannumeral-`0#2\Z {#1}\Z}% +\def\XINT_floatsum_c #1% + {\xint_gob_til_relax #1\XINT_floatsum_e\relax\XINT_floatsum_d #1}% +\def\XINT_floatsum_d #1\Z + {\expandafter\XINT_floatsum_b\romannumeral0\XINTinfloatadd {#1}}% +\def\XINT_floatsum_e #1\Z #2\Z { #2}% +\def\xintFloatSum:csv #1{\expandafter\XINT_floatsum:_a\romannumeral-`0#1,,^}% +\def\XINT_floatsum:_a {\XINT_floatsum:_b {0/1[0]}}% +\def\XINT_floatsum:_b #1#2,% + {\expandafter\XINT_floatsum:_c\romannumeral-`0#2,{#1}}% +\def\XINT_floatsum:_c #1{\if #1,\expandafter\XINT_floatsum:_e + \else\expandafter\XINT_floatsum:_d\fi #1}% +\def\XINT_floatsum:_d #1,#2{\expandafter\XINT_floatsum:_b\expandafter + {\romannumeral0\XINTinfloatadd {#2}{#1}}}% +\def\XINT_floatsum:_e ,#1#2^{#1}% allows empty list +\def\xintFloatPrd {\romannumeral0\xintfloatprd }% +\def\xintfloatprd #1{\expandafter\XINT_floatprd_a\romannumeral-`0#1\relax }% +\def\XINT_floatprd_a #1{\expandafter\XINT_floatprd_b + \romannumeral0\xintraw{#1}\Z }% +\def\XINT_floatprd_b #1\Z #2% + {\expandafter\XINT_floatprd_c\romannumeral-`0#2\Z {#1}\Z}% +\def\XINT_floatprd_c #1% + {\xint_gob_til_relax #1\XINT_floatprd_e\relax\XINT_floatprd_d #1}% +\def\XINT_floatprd_d #1\Z + {\expandafter\XINT_floatprd_b\romannumeral0\XINTinfloatmul {#1}}% +\def\XINT_floatprd_e #1\Z #2\Z { #2}% +\def\xintFloatPrd:csv #1{\expandafter\XINT_floatprd:_a\romannumeral-`0#1,,^}% +\def\XINT_floatprd:_a {\XINT_floatprd:_b {1/1[0]}}% +\def\XINT_floatprd:_b #1#2,% + {\expandafter\XINT_floatprd:_c\romannumeral-`0#2,{#1}}% +\def\XINT_floatprd:_c #1{\if #1,\expandafter\XINT_floatprd:_e + \else\expandafter\XINT_floatprd:_d\fi #1}% +\def\XINT_floatprd:_d #1,#2{\expandafter\XINT_floatprd:_b\expandafter + {\romannumeral0\XINTinfloatmul {#2}{#1}}}% +\def\XINT_floatprd:_e ,#1#2^{#1}% allows empty list \def\xintFloatPow {\romannumeral0\xintfloatpow}% \def\xintfloatpow #1{\XINT_flpow_chkopt \xintfloat #1\Z }% -\def\XINTinFloatPow {\romannumeral-`0\XINTinfloatpow }% +\def\XINTinFloatPow {\romannumeral0\XINTinfloatpow }% \def\XINTinfloatpow #1{\XINT_flpow_chkopt \XINT_inFloat #1\Z }% \def\XINT_flpow_chkopt #1#2% {% @@ -1830,7 +1997,7 @@ {% \expandafter\XINT_flpow_checkB_start\expandafter {\the\numexpr #3\expandafter}\expandafter - {\the\numexpr \XINT_digits}{#2}{#1[\XINT_digits]}% + {\the\numexpr \XINTdigits}{#2}{#1[\XINTdigits]}% }% \def\XINT_flpow_opt #1[\Z #2]#3#4% {% @@ -1862,7 +2029,7 @@ \def\XINT_flpow_checkB_d #1#2#3#4% {% \expandafter \XINT_flpow_a - \romannumeral-`0\XINT_inFloat [#1]{#4}{#1}{#2}#3% + \romannumeral0\XINT_inFloat [#1]{#4}{#1}{#2}#3% }% \def\XINT_flpow_a #1% {% @@ -1897,7 +2064,7 @@ \xint_afterfi{\expandafter\XINT_flpow_loop_a \expandafter{\the\numexpr 2*(#2/2)-#2\expandafter }% b mod 2 \expandafter{\the\numexpr #2-#2/2\expandafter }% [b/2] - \expandafter{\romannumeral-`0\XINTinfloatmul [#1]{#3}{#3}}}% + \expandafter{\romannumeral0\XINTinfloatmul [#1]{#3}{#3}}}% \fi {#1}{{#3}}% }% @@ -1931,7 +2098,7 @@ \def\XINT_flpow_prd_compute #1\Z #2#3% {% \expandafter\XINT_flpow_prd_getnext\expandafter - {\romannumeral-`0\XINTinfloatmul [#3]{#1}{#2}}{#3}% + {\romannumeral0\XINTinfloatmul [#3]{#1}{#2}}{#3}% }% \def\XINT_flpow_prd_end\relax\XINT_flpow_prd_compute \relax\Z #1#2#3% @@ -1956,7 +2123,7 @@ }% \def\xintFloatPower {\romannumeral0\xintfloatpower}% \def\xintfloatpower #1{\XINT_flpower_chkopt \xintfloat #1\Z }% -\def\XINTinFloatPower {\romannumeral-`0\XINTinfloatpower}% +\def\XINTinFloatPower {\romannumeral0\XINTinfloatpower}% \def\XINTinfloatpower #1{\XINT_flpower_chkopt \XINT_inFloat #1\Z }% \def\XINT_flpower_chkopt #1#2% {% @@ -1968,8 +2135,8 @@ \def\XINT_flpower_noopt #1#2\Z #3% {% \expandafter\XINT_flpower_checkB_start\expandafter - {\the\numexpr \XINT_digits\expandafter}\expandafter - {\romannumeral0\xintnum{#3}}{#2}{#1[\XINT_digits]}% + {\the\numexpr \XINTdigits\expandafter}\expandafter + {\romannumeral0\xintnum{#3}}{#2}{#1[\XINTdigits]}% }% \def\XINT_flpower_opt #1[\Z #2]#3#4% {% @@ -2001,7 +2168,7 @@ \def\XINT_flpower_checkB_d #1#2#3#4% {% \expandafter \XINT_flpower_a - \romannumeral-`0\XINT_inFloat [#1]{#4}{#1}{#2}#3% + \romannumeral0\XINT_inFloat [#1]{#4}{#1}{#2}#3% }% \def\XINT_flpower_a #1% {% @@ -2033,7 +2200,7 @@ {% \ifcase\XINT_isOne {#2} \xint_afterfi{\expandafter\XINT_flpower_loop_x\expandafter - {\romannumeral-`0\XINTinfloatmul [#1]{#3}{#3}}% + {\romannumeral0\XINTinfloatmul [#1]{#3}{#3}}% {\romannumeral0\xintdivision {#2}{2}}}% \or \expandafter\XINT_flpow_loop_end \fi @@ -2055,7 +2222,7 @@ }% \def\xintFloatSqrt {\romannumeral0\xintfloatsqrt }% \def\xintfloatsqrt #1{\XINT_flsqrt_chkopt \xintfloat #1\Z }% -\def\XINTinFloatSqrt {\romannumeral-`0\XINTinfloatsqrt }% +\def\XINTinFloatSqrt {\romannumeral0\XINTinfloatsqrt }% \def\XINTinfloatsqrt #1{\XINT_flsqrt_chkopt \XINT_inFloat #1\Z }% \def\XINT_flsqrt_chkopt #1#2% {% @@ -2065,7 +2232,7 @@ }% \def\XINT_flsqrt_noopt #1#2\Z {% - #1[\XINT_digits]{\XINT_FL_sqrt \XINT_digits {#2}}% + #1[\XINTdigits]{\XINT_FL_sqrt \XINTdigits {#2}}% }% \def\XINT_flsqrt_opt #1[\Z #2]#3% {% @@ -2082,7 +2249,7 @@ \def\XINT_FL_sqrt_a #1#2% {% \expandafter\XINT_FL_sqrt_checkifzeroorneg - \romannumeral-`0\XINT_inFloat [#1]{#2}% + \romannumeral0\XINT_inFloat [#1]{#2}% }% \def\XINT_FL_sqrt_checkifzeroorneg #1% {% @@ -2182,14 +2349,14 @@ \def\XINT_flsqrt_big_f #1% {% \expandafter\XINT_flsqrt_big_fa\expandafter - {\romannumeral0\xintisqr {#1}}{#1}% + {\romannumeral0\xintiisqr {#1}}{#1}% }% \def\XINT_flsqrt_big_fa #1#2#3#4% {% \expandafter\XINT_flsqrt_big_fb\expandafter - {\romannumeral-`0\XINT_dsx_addzerosnofuss + {\romannumeral0\XINT_dsx_addzerosnofuss {\numexpr #3-\xint_c_viii\relax}{#2}}% - {\romannumeral0\xintisub + {\romannumeral0\xintiisub {\XINT_dsx_addzerosnofuss {\numexpr \xint_c_ii*(#3-\xint_c_viii)\relax}{#1}}{#4}}% {#3}% @@ -2215,7 +2382,7 @@ {% \expandafter\XINT_flsqrt_big_l\expandafter {\romannumeral0\XINT_sub_pre {#3}{#1}}% - {\romannumeral0\xintiadd {#2}{\romannumeral0\XINT_sqr {#1}}}% + {\romannumeral0\xintiiadd {#2}{\romannumeral0\XINT_sqr {#1}}}% }% \def\XINT_flsqrt_big_l #1#2% {% @@ -2226,7 +2393,7 @@ {% \expandafter\XINT_flsqrt_big_end_b\expandafter {\the\numexpr -#4+#5/\xint_c_ii\expandafter}\expandafter - {\romannumeral0\xintisub + {\romannumeral0\xintiisub {\XINT_dsx_addzerosnofuss {#4}{#3}}% {\xintHalf{\xintiQuo{\XINT_dsx_addzerosnofuss {#4}{#2}}{#3}}}}% }% diff --git a/Master/texmf-dist/tex/generic/xint/xintgcd.sty b/Master/texmf-dist/tex/generic/xint/xintgcd.sty index 467e62a9925..c7ff8245b84 100644 --- a/Master/texmf-dist/tex/generic/xint/xintgcd.sty +++ b/Master/texmf-dist/tex/generic/xint/xintgcd.sty @@ -22,7 +22,7 @@ %% in the same archive or directory.) %% %%---------------------------------------------------------------- -%% The xint bundle (version 1.08b of June 14, 2013) +%% The xint bundle (version 1.09a of September 22, 2013) %% xintgcd: Euclidean algorithm with xint package %% Copyright (C) 2013 by Jean-Francois Burnol %%---------------------------------------------------------------- @@ -165,7 +165,7 @@ \fi \expandafter\x\csname ver@xintgcd.sty\endcsname \ProvidesPackage{xintgcd}% - [2013/06/14 v1.08b Euclide algorithm with xint package (jfB)]% + [2013/09/24 v1.09a Euclide algorithm with xint package (jfB)]% \def\xintGCD {\romannumeral0\xintgcd }% \def\xintgcd #1% {% @@ -199,14 +199,62 @@ \romannumeral0\XINT_div_prepare {#1}{#2}\Z {#1}% }% +\def\xintGCDof {\romannumeral0\xintgcdof }% +\def\xintgcdof #1{\expandafter\XINT_gcdof_a\romannumeral-`0#1\relax }% +\def\XINT_gcdof_a #1{\expandafter\XINT_gcdof_b\romannumeral-`0#1\Z }% +\def\XINT_gcdof_b #1\Z #2{\expandafter\XINT_gcdof_c\romannumeral-`0#2\Z {#1}\Z}% +\def\XINT_gcdof_c #1{\xint_gob_til_relax #1\XINT_gcdof_e\relax\XINT_gcdof_d #1}% +\def\XINT_gcdof_d #1\Z {\expandafter\XINT_gcdof_b\romannumeral0\xintgcd {#1}}% +\def\XINT_gcdof_e #1\Z #2\Z { #2}% +\def\xintGCDof:csv #1{\expandafter\XINT_gcdof:_b\romannumeral-`0#1,,}% +\def\XINT_gcdof:_b #1,#2,{\expandafter\XINT_gcdof:_c\romannumeral-`0#2,{#1},}% +\def\XINT_gcdof:_c #1{\if #1,\expandafter\XINT_gcdof:_e + \else\expandafter\XINT_gcdof:_d\fi #1}% +\def\XINT_gcdof:_d #1,{\expandafter\XINT_gcdof:_b\romannumeral0\xintgcd {#1}}% +\def\XINT_gcdof:_e ,#1,{#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\XINT_lcm_fork #1#2\Z #3#4\Z +{% + \xint_UDzerofork + #1\dummy \XINT_lcm_BisZero + #3\dummy \XINT_lcm_AisZero + 0\dummy \expandafter + \krof + \XINT_lcm_notzero\expandafter{\romannumeral0\XINT_gcd_loop {#1#2}{#3#4}}% + {#1#2}{#3#4}% +}% +\def\XINT_lcm_AisZero #1#2#3#4#5{ 0}% +\def\XINT_lcm_BisZero #1#2#3#4#5{ 0}% +\def\XINT_lcm_notzero #1#2#3{\xintiimul {#2}{\xintQuo{#3}{#1}}}% +\def\xintLCMof {\romannumeral0\xintlcmof }% +\def\xintlcmof #1{\expandafter\XINT_lcmof_a\romannumeral-`0#1\relax }% +\def\XINT_lcmof_a #1{\expandafter\XINT_lcmof_b\romannumeral-`0#1\Z }% +\def\XINT_lcmof_b #1\Z #2{\expandafter\XINT_lcmof_c\romannumeral-`0#2\Z {#1}\Z}% +\def\XINT_lcmof_c #1{\xint_gob_til_relax #1\XINT_lcmof_e\relax\XINT_lcmof_d #1}% +\def\XINT_lcmof_d #1\Z {\expandafter\XINT_lcmof_b\romannumeral0\xintlcm {#1}}% +\def\XINT_lcmof_e #1\Z #2\Z { #2}% +\def\xintLCMof:csv #1{\expandafter\XINT_lcmof:_a\romannumeral-`0#1,,}% +\def\XINT_lcmof:_a #1,#2,{\expandafter\XINT_lcmof:_c\romannumeral-`0#2,{#1},}% +\def\XINT_lcmof:_c #1{\if#1,\expandafter\XINT_lcmof:_e + \else\expandafter\XINT_lcmof:_d\fi #1}% +\def\XINT_lcmof:_d #1,{\expandafter\XINT_lcmof:_a\romannumeral0\xintlcm {#1}}% +\def\XINT_lcmof:_e ,#1,{#1}% \def\xintBezout {\romannumeral0\xintbezout }% \def\xintbezout #1% {% - \expandafter\xint_bezout\expandafter {\romannumeral-`0#1}% + \expandafter\xint_bezout\expandafter {\romannumeral0\xintnum{#1}}% }% \def\xint_bezout #1#2% {% - \expandafter\XINT_bezout_fork \romannumeral-`0#2\Z #1\Z + \expandafter\XINT_bezout_fork \romannumeral0\xintnum{#2}\Z #1\Z }% \def\XINT_bezout_fork #1#2\Z #3#4\Z {% @@ -251,7 +299,7 @@ \def\XINT_bezout_mm_post #1#2% {% \expandafter\XINT_bezout_mm_postb\expandafter - {\romannumeral0\xintiopp{#2}}{\romannumeral0\xintiopp{#1}}% + {\romannumeral0\xintiiopp{#2}}{\romannumeral0\xintiiopp{#1}}% }% \def\XINT_bezout_mm_postb #1#2% {% @@ -269,7 +317,7 @@ \def\XINT_bezout_mp_post #1#2% {% \expandafter\XINT_bezout_mp_postb\expandafter - {\romannumeral0\xintiopp {#2}}{#1}% + {\romannumeral0\xintiiopp {#2}}{#1}% }% \def\XINT_bezout_mp_postb #1#2#3#4#5% {% @@ -307,8 +355,8 @@ \def\XINT_bezout_loop_b #1#2#3#4#5#6#7#8% {% \expandafter \XINT_bezout_loop_c \expandafter - {\romannumeral0\xintiadd{\XINT_Mul{#5}{#2}}{#7}}% - {\romannumeral0\xintiadd{\XINT_Mul{#6}{#2}}{#8}}% + {\romannumeral0\xintiiadd{\XINT_Mul{#5}{#2}}{#7}}% + {\romannumeral0\xintiiadd{\XINT_Mul{#6}{#2}}{#8}}% {#1}{#3}{#4}{#5}{#6}% }% \def\XINT_bezout_loop_c #1#2% @@ -421,8 +469,8 @@ \def\XINT_bezalg_b #1#2#3#4#5#6#7#8% {% \expandafter\XINT_bezalg_c\expandafter - {\romannumeral0\xintiadd {\xintiMul {#6}{#2}}{#8}}% - {\romannumeral0\xintiadd {\xintiMul {#5}{#2}}{#7}}% + {\romannumeral0\xintiiadd {\xintiiMul {#6}{#2}}{#8}}% + {\romannumeral0\xintiiadd {\xintiiMul {#5}{#2}}{#7}}% {#1}{#2}{#3}{#4}{#5}{#6}% }% \def\XINT_bezalg_c #1#2#3#4#5#6% diff --git a/Master/texmf-dist/tex/generic/xint/xintseries.sty b/Master/texmf-dist/tex/generic/xint/xintseries.sty index 2a63f12eb29..1b65cfb260f 100644 --- a/Master/texmf-dist/tex/generic/xint/xintseries.sty +++ b/Master/texmf-dist/tex/generic/xint/xintseries.sty @@ -22,7 +22,7 @@ %% in the same archive or directory.) %% %%---------------------------------------------------------------- -%% The xint bundle (version 1.08b of June 14, 2013) +%% The xint bundle (version 1.09a of September 22, 2013) %% xintseries: Expandable partial sums with xint package %% Copyright (C) 2013 by Jean-Francois Burnol %%---------------------------------------------------------------- @@ -165,7 +165,7 @@ \fi \expandafter\x\csname ver@xintseries.sty\endcsname \ProvidesPackage{xintseries}% - [2013/06/14 v1.08b Expandable partial sums with xint package (jfB)]% + [2013/09/24 v1.09a Expandable partial sums with xint package (jfB)]% \def\xintSeries {\romannumeral0\xintseries }% \def\xintseries #1#2% {% @@ -211,7 +211,7 @@ \ifnum #3>#1 \else \XINT_iseries_exit \fi \expandafter\XINT_iseries_loop\expandafter {\the\numexpr #1+1\expandafter }\expandafter - {\romannumeral0\xintiadd {#2}{#4{#1}}}% + {\romannumeral0\xintiiadd {#2}{#4{#1}}}% {#3}{#4}% }% \def\XINT_iseries_exit \fi #1#2#3#4#5#6#7#8% @@ -369,7 +369,7 @@ {% \expandafter\XINT_fppowseries_loop_i\expandafter {\the\numexpr #2+\xint_c_i\expandafter}\expandafter - {\romannumeral0\xintiadd {#4}{\xintiTrunc {#7}{\xintMul {#6{#2}}{#1}}}}% + {\romannumeral0\xintiiadd {#4}{\xintiTrunc {#7}{\xintMul {#6{#2}}{#1}}}}% {#1}{#3}{#5}{#6}{#7}% }% \def\XINT_fppowseries_exit_i\fi\expandafter\XINT_fppowseries_loop_ii @@ -377,7 +377,7 @@ \def\XINT_fppowseries_exit_ii #1#2#3#4#5#6#7% {% \xinttrunc {#7} - {\xintiAdd {#4}{\xintiTrunc {#7}{\xintMul {#6{#2}}{#1}}}[-#7]}% + {\xintiiadd {#4}{\xintiTrunc {#7}{\xintMul {#6{#2}}{#1}}}[-#7]}% }% \def\xintFxPtPowerSeriesX {\romannumeral0\xintfxptpowerseriesx }% \def\xintfxptpowerseriesx #1#2% @@ -415,7 +415,7 @@ {% \expandafter\XINT_flpowseries\expandafter {\the\numexpr #1\expandafter}\expandafter - {\the\numexpr #2}\XINT_digits + {\the\numexpr #2}\XINTdigits }% \def\XINT_flpowseries_opt [\Z #1]#2#3% {% @@ -430,7 +430,7 @@ \else \xint_afterfi {\expandafter\XINT_flpowseries_loop_pre\expandafter - {\romannumeral-`0\XINTinfloatpow [#3]{#5}{#1}}% + {\romannumeral0\XINTinfloatpow [#3]{#5}{#1}}% {#1}{#5}{#2}{#4}{#3}% }% \fi @@ -440,7 +440,7 @@ \ifnum #4>#2 \else\XINT_flpowseries_dont_i \fi \expandafter\XINT_flpowseries_loop_i\expandafter {\the\numexpr #2+\xint_c_i\expandafter}\expandafter - {\romannumeral-`0\XINTinfloatmul [#6]{#5{#2}}{#1}}% + {\romannumeral0\XINTinfloatmul [#6]{#5{#2}}{#1}}% {#1}{#3}{#4}{#5}{#6}% }% \def\XINT_flpowseries_dont_i \fi\expandafter\XINT_flpowseries_loop_i @@ -450,14 +450,14 @@ {% \ifnum #5>#1 \else \XINT_flpowseries_exit_i \fi \expandafter\XINT_flpowseries_loop_ii\expandafter - {\romannumeral-`0\XINTinfloatmul [#7]{#3}{#4}}% + {\romannumeral0\XINTinfloatmul [#7]{#3}{#4}}% {#1}{#4}{#2}{#5}{#6}{#7}% }% \def\XINT_flpowseries_loop_ii #1#2#3#4#5#6#7% {% \expandafter\XINT_flpowseries_loop_i\expandafter {\the\numexpr #2+\xint_c_i\expandafter}\expandafter - {\romannumeral-`0\XINTinfloatadd [#7]{#4}% + {\romannumeral0\XINTinfloatadd [#7]{#4}% {\XINTinfloatmul [#7]{#6{#2}}{#1}}}% {#1}{#3}{#5}{#6}{#7}% }% @@ -480,7 +480,7 @@ {% \expandafter\XINT_flpowseriesx\expandafter {\the\numexpr #1\expandafter}\expandafter - {\the\numexpr #2}\XINT_digits + {\the\numexpr #2}\XINTdigits }% \def\XINT_flpowseriesx_opt [\Z #1]#2#3% {% @@ -502,7 +502,7 @@ \def\XINT_flpowseriesx_pre #1#2#3#4#5% {% \expandafter\XINT_flpowseries_loop_pre\expandafter - {\romannumeral-`0\XINTinfloatpow [#5]{#1}{#2}}% + {\romannumeral0\XINTinfloatpow [#5]{#1}{#2}}% {#2}{#1}{#3}{#4}{#5}% }% \XINT_series_restorecatcodes_endinput% -- cgit v1.2.3