diff options
author | Karl Berry <karl@freefriends.org> | 2013-05-01 23:35:32 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-05-01 23:35:32 +0000 |
commit | 563bcfa06168849da809214cc1af73c6e6c5f36a (patch) | |
tree | db1bc3720976151d804cf307e26b6880945844a3 /Master/texmf-dist/tex/generic/xint | |
parent | 903a46840c96d822da490d9a17f0250c9b6a4d8f (diff) |
xint (1may13)
git-svn-id: svn://tug.org/texlive/trunk@30199 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/xint')
-rw-r--r-- | Master/texmf-dist/tex/generic/xint/xint.sty | 550 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/xint/xintcfrac.sty | 63 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/xint/xintfrac.sty | 830 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/xint/xintgcd.sty | 78 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/xint/xintseries.sty | 16 |
5 files changed, 738 insertions, 799 deletions
diff --git a/Master/texmf-dist/tex/generic/xint/xint.sty b/Master/texmf-dist/tex/generic/xint/xint.sty index 279468d168d..016a684c4c2 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.04 of April 25, 2013) +%% The xint bundle (version 1.05 of May 1st, 2013) %% xint: Expandable operations on long numbers %% Copyright (C) 2013 by Jean-Francois Burnol %%---------------------------------------------------------------- @@ -84,7 +84,7 @@ \endlinechar=\the\endlinechar \catcode13=\the\catcode13 % ^^M \catcode32=\the\catcode32 % - \catcode61=\the\catcode61 % = + \catcode61=\the\catcode61\relax % = \noexpand\endinput }% \def\XINT@setcatcodes @@ -134,7 +134,7 @@ \fi \expandafter\x\csname ver@xint.sty\endcsname \ProvidesPackage{xint}% - [2013/04/25 v1.04 Expandable operations on long numbers (jfB)]% + [2013/05/01 v1.05 Expandable operations on long numbers (jfB)]% \def\xint@gobble #1{}% \def\xint@gobble@one #1{}% \def\xint@gobble@two #1#2{}% @@ -191,7 +191,7 @@ }% \def\XINT@rev@negative #1#2\Z {% - \expandafter \space \expandafter -\romannumeral0\XINT@rev {#2}% + \expandafter\xint@minus@andstop\romannumeral0\XINT@rev {#2}% }% \def\XINT@rev@nonnegative #1\Z {% @@ -220,8 +220,7 @@ \def\XINT@strip@UNDEF #1\xint@UNDEF {}% \def\XINT@RQ #1#2#3#4#5#6#7#8#9% {% - \xint@r #9\XINT@RQ@end\R - \XINT@RQ {#9#8#7#6#5#4#3#2#1}% + \xint@r #9\XINT@RQ@end\R\XINT@RQ {#9#8#7#6#5#4#3#2#1}% }% \def\XINT@RQ@end\R\XINT@RQ #1#2\Z {% @@ -248,9 +247,8 @@ \def\XINT@RQ@end@ii #1\Z #2#3#4#5#6#7#8#9\Z { #3#4#5#6#7#8#900}% \def\XINT@RQ@end@i \Z #1#2#3#4#5#6#7#8\Z { #1#2#3#4#5#6#7#80}% \def\xint@cleanupzeros@andstop #1#2#3#4% -{\expandafter - \space - \the\numexpr #1#2#3#4\relax +{% + \expandafter\space\the\numexpr #1#2#3#4\relax }% \def\xint@cleanupzeros@nospace #1#2#3#4% {% @@ -304,14 +302,15 @@ \xint@w #2\XINT@isone@yes\W\expandafter\space\expandafter 0\xint@z }% \def\XINT@isone@yes #1\Z{ 1}% -\def\xintNum {\romannumeral0\xintnum }% -\def\xintnum #1% +\def\xintiNum {\romannumeral0\xintinum }% +\def\xintinum #1% {% - \expandafter\expandafter\expandafter + \expandafter\expandafter\expandafter \XINT@num - \expandafter\expandafter\expandafter + \expandafter\expandafter\expandafter {#1}% }% +\let\xintNum\xintiNum \let\xintnum\xintinum \def\XINT@Num {\romannumeral0\XINT@num }% \def\XINT@num #1{\XINT@num@loop #1\R\R\R\R\R\R\R\R\Z }% \def\XINT@num@loop #1#2#3#4#5#6#7#8% @@ -561,15 +560,13 @@ }% \let\xintSgn\xintiSgn \let\xintsgn\xintisgn \def\XINT@Sgn #1{\romannumeral0\XINT@sgn #1\Z }% -\def\XINT@sgn #1% +\def\XINT@sgn #1#2\Z {% - \xint@xpxp@andstop \xint@UDzerominusfork - #1-\dummy {\expandafter0}% zero - 0#1\dummy {\expandafter-\expandafter1}% n\'egatif - 0-\dummy {\expandafter1}% positif + #1-\dummy { 0}% + 0#1\dummy { -1}% + 0-\dummy { 1}% \xint@UDkrof - \xint@z }% \def\xintiOpp {\romannumeral0\xintiopp }% \def\xintiopp #1% @@ -605,9 +602,7 @@ }% \def\XINT@add@A #1#2#3#4#5#6% {% - \xint@w - #3\xint@add@az - \W\XINT@add@AB #1{#3#4#5#6}{#2}% + \xint@w #3\xint@add@az\W\XINT@add@AB #1{#3#4#5#6}{#2}% }% \def\xint@add@az\W\XINT@add@AB #1#2% {% @@ -615,21 +610,20 @@ }% \def\XINT@add@AB #1#2#3#4\W\X\Y\Z #5#6#7#8% {% - \xint@w - #5\xint@add@bz - \W\XINT@add@ABE #1#2{#8#7#6#5}{#3}#4\W\X\Y\Z + \xint@w #5\xint@add@bz\W + \XINT@add@ABE #1#2{#8#7#6#5}{#3}#4\W\X\Y\Z }% \def\XINT@add@ABE #1#2#3#4#5#6% -{\expandafter - \XINT@add@ABEA\the\numexpr #1+10#5#4#3#2+#6\relax.% +{% + \expandafter\XINT@add@ABEA\the\numexpr #1+10#5#4#3#2+#6\relax.% }% \def\XINT@add@ABEA #1#2#3.#4% {% \XINT@add@A #2{#3#4}% }% \def\xint@add@bz\W\XINT@add@ABE #1#2#3#4#5#6% -{\expandafter - \XINT@add@CC\the\numexpr #1+10#5#4#3#2\relax.% +{% + \expandafter\XINT@add@CC\the\numexpr #1+10#5#4#3#2\relax.% }% \def\XINT@add@CC #1#2#3.#4% {% @@ -653,20 +647,16 @@ }% \def\XINT@add@C #1#2#3#4#5% {% - \xint@w - #2\xint@add@cz - \W\XINT@add@CD {#5#4#3#2}{#1}% + \xint@w #2\xint@add@cz\W\XINT@add@CD {#5#4#3#2}{#1}%q }% \def\XINT@add@CD #1% -{\expandafter - \XINT@add@CC\the\numexpr 1+10#1\relax.% +{% + \expandafter\XINT@add@CC\the\numexpr 1+10#1\relax.% }% \def\xint@add@cz\W\XINT@add@CD #1#2{ 1#2}% \def\XINT@addr@A #1#2#3#4#5#6% {% - \xint@w - #3\xint@addr@az - \W\XINT@addr@B #1{#3#4#5#6}{#2}% + \xint@w #3\xint@addr@az\W\XINT@addr@B #1{#3#4#5#6}{#2}% }% \def\xint@addr@az\W\XINT@addr@B #1#2% {% @@ -674,21 +664,19 @@ }% \def\XINT@addr@B #1#2#3#4\W\X\Y\Z #5#6#7#8% {% - \xint@w - #5\xint@addr@bz - \W\XINT@addr@E #1#2{#8#7#6#5}{#3}#4\W\X\Y\Z + \xint@w #5\xint@addr@bz\W\XINT@addr@E #1#2{#8#7#6#5}{#3}#4\W\X\Y\Z }% \def\XINT@addr@E #1#2#3#4#5#6% -{\expandafter - \XINT@addr@ABEA\the\numexpr #1+10#5#4#3#2+#6\relax +{% + \expandafter\XINT@addr@ABEA\the\numexpr #1+10#5#4#3#2+#6\relax }% \def\XINT@addr@ABEA #1#2#3#4#5#6#7% {% \XINT@addr@A #2{#7#6#5#4#3}% }% \def\xint@addr@bz\W\XINT@addr@E #1#2#3#4#5#6% -{\expandafter - \XINT@addr@CC\the\numexpr #1+10#5#4#3#2\relax +{% + \expandafter\XINT@addr@CC\the\numexpr #1+10#5#4#3#2\relax }% \def\XINT@addr@CC #1#2#3#4#5#6#7% {% @@ -701,20 +689,16 @@ \def\xint@addr@AC@nocarry 0\XINT@addr@C #1#2\W\X\Y\Z { #1#2}% \def\XINT@addr@C #1#2#3#4#5% {% - \xint@w - #2\xint@addr@cz - \W\XINT@addr@D {#5#4#3#2}{#1}% + \xint@w #2\xint@addr@cz\W\XINT@addr@D {#5#4#3#2}{#1}% }% \def\XINT@addr@D #1% -{\expandafter - \XINT@addr@CC\the\numexpr 1+10#1\relax +{% + \expandafter\XINT@addr@CC\the\numexpr 1+10#1\relax }% \def\xint@addr@cz\W\XINT@addr@D #1#2{ #21000}% \def\XINT@addm@A #1#2#3#4#5#6% {% - \xint@w - #3\xint@addm@az - \W\XINT@addm@AB #1{#3#4#5#6}{#2}% + \xint@w #3\xint@addm@az\W\XINT@addm@AB #1{#3#4#5#6}{#2}% }% \def\xint@addm@az\W\XINT@addm@AB #1#2% {% @@ -725,8 +709,8 @@ \XINT@addm@ABE #1#2{#8#7#6#5}{#3}#4\W\X\Y\Z }% \def\XINT@addm@ABE #1#2#3#4#5#6% -{\expandafter - \XINT@addm@ABEA\the\numexpr #1+10#5#4#3#2+#6\relax.% +{% + \expandafter\XINT@addm@ABEA\the\numexpr #1+10#5#4#3#2+#6\relax.% }% \def\XINT@addm@ABEA #1#2#3.#4% {% @@ -758,8 +742,8 @@ \W\XINT@addm@CD {#5#4#3#2}{#1}% }% \def\XINT@addm@CD #1% -{\expandafter - \XINT@addm@CC\the\numexpr 1+10#1\relax.% +{% + \expandafter\XINT@addm@CC\the\numexpr 1+10#1\relax.% }% \def\XINT@addm@CC #1#2#3.#4% {% @@ -770,8 +754,8 @@ #2\xint@addm@cy #3\xint@addm@cz \W\XINT@addm@CD -{\expandafter - \XINT@addm@CDw\the\numexpr 1+#1#2#3\relax.% +{% + \expandafter\XINT@addm@CDw\the\numexpr 1+#1#2#3\relax.% }% \def\XINT@addm@CDw #1.#2#3\X\Y\Z {% @@ -781,8 +765,8 @@ #1\xint@addm@cy #2\xint@addm@cz \W\XINT@addm@CD -{\expandafter - \XINT@addm@CDx\the\numexpr 1+#1#2\relax.% +{% + \expandafter\XINT@addm@CDx\the\numexpr 1+#1#2\relax.% }% \def\XINT@addm@CDx #1.#2#3\Y\Z {% @@ -791,8 +775,8 @@ \def\xint@addm@cy #1\xint@addm@cz \W\XINT@addm@CD -{\expandafter - \XINT@addm@CDy\the\numexpr 1+#1\relax.% +{% + \expandafter\XINT@addm@CDy\the\numexpr 1+#1\relax.% }% \def\XINT@addm@CDy #1.#2#3\Z {% @@ -800,12 +784,10 @@ }% \def\xint@addm@cz\W\XINT@addm@CD #1#2#3{\XINT@addm@end #1#3}% \def\XINT@addm@end #1#2#3#4#5% - {\expandafter\space\the\numexpr #1#2#3#4#5\relax }% + {\expandafter\space\the\numexpr #1#2#3#4#5\relax}% \def\XINT@addp@A #1#2#3#4#5#6% {% - \xint@w - #3\xint@addp@az - \W\XINT@addp@AB #1{#3#4#5#6}{#2}% + \xint@w #3\xint@addp@az\W\XINT@addp@AB #1{#3#4#5#6}{#2}% }% \def\xint@addp@az\W\XINT@addp@AB #1#2% {% @@ -824,8 +806,8 @@ \XINT@addp@ABE #1#2{#8#7#6#5}{#3}#4\W\X\Y\Z }% \def\XINT@addp@ABE #1#2#3#4#5#6% -{\expandafter - \XINT@addp@ABEA\the\numexpr #1+10#5#4#3#2+#6\relax +{% + \expandafter\XINT@addp@ABEA\the\numexpr #1+10#5#4#3#2+#6\relax }% \def\XINT@addp@ABEA #1#2#3#4#5#6#7% {% @@ -841,8 +823,8 @@ \W\XINT@addp@CD {#5#4#3#2}{#1}% }% \def\XINT@addp@CD #1% -{\expandafter - \XINT@addp@CC\the\numexpr 1+10#1\relax +{% + \expandafter\XINT@addp@CC\the\numexpr 1+10#1\relax }% \def\XINT@addp@CC #1#2#3#4#5#6#7% {% @@ -853,8 +835,8 @@ #2\xint@addp@cy #3\xint@addp@cz \W\XINT@addp@CD -{\expandafter - \XINT@addp@CDw\the\numexpr 1+10#1#2#3\relax +{% + \expandafter\XINT@addp@CDw\the\numexpr 1+10#1#2#3\relax }% \def\XINT@addp@CDw #1#2#3#4#5#6% {% @@ -867,8 +849,8 @@ #1\xint@addp@cy #2\xint@addp@cz \W\XINT@addp@CD -{\expandafter - \XINT@addp@CDx\the\numexpr 1+100#1#2\relax +{% + \expandafter\XINT@addp@CDx\the\numexpr 1+100#1#2\relax }% \def\XINT@addp@CDx #1#2#3#4#5#6% {% @@ -880,8 +862,8 @@ \def\xint@addp@cy #1\xint@addp@cz \W\XINT@addp@CD -{\expandafter - \XINT@addp@CDy\the\numexpr 1+1000#1\relax +{% + \expandafter\XINT@addp@CDy\the\numexpr 1+1000#1\relax }% \def\XINT@addp@CDy #1#2#3#4#5#6% {% @@ -970,7 +952,7 @@ \def\XINT@add@firstiszero #1#2#3#4{ #3#1}% \def\XINT@add@minusminus #1#2#3#4% {% - \expandafter\space\expandafter-% + \expandafter\xint@minus@andstop% \romannumeral0\XINT@add@pre {#2}{#1}% }% \def\XINT@add@minusplus #1#2#3#4% @@ -1045,7 +1027,7 @@ \def\xint@sub@mp0\XINT@add@pre #1#2{ #2}% \def\XINT@sub@plusminus #1#2#3#4% {% - \xint@zero #3\xint@sub@pm0\expandafter\space\expandafter-% + \xint@zero #3\xint@sub@pm0\expandafter\xint@minus@andstop% \romannumeral0\XINT@add@pre {#2}{#3#1}% }% \def\xint@sub@pm #1\XINT@add@pre #2#3{ -#2}% @@ -1075,8 +1057,8 @@ \W\XINT@sub@onestep #1#2{#7#6#5#4}{#3}% }% \def\XINT@sub@onestep #1#2#3#4#5#6% -{\expandafter - \XINT@sub@backtoA\the\numexpr 11#5#4#3#2-#6+#1-1\relax.% +{% + \expandafter\XINT@sub@backtoA\the\numexpr 11#5#4#3#2-#6+#1-1\relax.% }% \def\XINT@sub@backtoA #1#2#3.#4% {% @@ -1110,8 +1092,8 @@ \W\XINT@sub@AC@onestep {#5#4#3#2}{#1}% }% \def\XINT@sub@AC@onestep #1% -{\expandafter - \XINT@sub@backtoC\the\numexpr 11#1-1\relax.% +{% + \expandafter\XINT@sub@backtoC\the\numexpr 11#1-1\relax.% }% \def\XINT@sub@backtoC #1#2#3.#4% {% @@ -1161,8 +1143,8 @@ #1{#6#5#4#3}{#2}% }% \def\XINT@sub@Eonestep #1#2% -{\expandafter - \XINT@sub@backtoE\the\numexpr 109999-#2+#1\relax.% +{% + \expandafter\XINT@sub@backtoE\the\numexpr 109999-#2+#1\relax.% }% \def\XINT@sub@backtoE #1#2#3.#4% {% @@ -1173,12 +1155,11 @@ \xint@UDonezerofork #4#1\dummy {\XINT@sub@Fdec 0}% soustraire 1. Et faire signe - #1#4\dummy {\XINT@sub@Finc 1}% additionner 1. Et faire signe - - 10\dummy \XINT@sub@DD % terminer. Mais avec signe - + 10\dummy \XINT@sub@DD % terminer. Mais avec signe - \xint@UDkrof {#3}% }% -\def\XINT@sub@DD -{\expandafter\space\expandafter-\romannumeral0\XINT@sub@D }% +\def\XINT@sub@DD {\expandafter\xint@minus@andstop\romannumeral0\XINT@sub@D }% \def\XINT@sub@Fdec #1#2#3#4#5#6% {% \xint@w @@ -1186,8 +1167,8 @@ #1{#6#5#4#3}{#2}% }% \def\XINT@sub@Fdec@onestep #1#2% -{\expandafter - \XINT@sub@backtoFdec\the\numexpr 11#2+#1-1\relax.% +{% + \expandafter\XINT@sub@backtoFdec\the\numexpr 11#2+#1-1\relax.% }% \def\XINT@sub@backtoFdec #1#2#3.#4% {% @@ -1195,7 +1176,7 @@ }% \def\xint@sub@Fdec@finish\W\XINT@sub@Fdec@onestep #1#2% {% - \expandafter\space\expandafter-\romannumeral0\XINT@cuz + \expandafter\xint@minus@andstop\romannumeral0\XINT@cuz }% \def\XINT@sub@Finc #1#2#3#4#5#6% {% @@ -1204,8 +1185,8 @@ #1{#6#5#4#3}{#2}% }% \def\XINT@sub@Finc@onestep #1#2% -{\expandafter - \XINT@sub@backtoFinc\the\numexpr 10#2+#1\relax.% +{% + \expandafter\XINT@sub@backtoFinc\the\numexpr 10#2+#1\relax.% }% \def\XINT@sub@backtoFinc #1#2#3.#4% {% @@ -1214,7 +1195,7 @@ \def\xint@sub@Finc@finish\W\XINT@sub@Finc@onestep #1#2#3% {% \xint@UDzerofork - #1\dummy {\expandafter\space\expandafter-% + #1\dummy {\expandafter\xint@minus@andstop% \xint@cleanupzeros@nospace}% 0\dummy { -1}% \xint@UDkrof @@ -1223,8 +1204,8 @@ \def\xint@sub@ez\W\XINT@sub@Eenter #1% {% \xint@UDzerofork - #1\dummy \XINT@sub@K % il y a une retenue - 0\dummy \XINT@sub@L % pas de retenue + #1\dummy \XINT@sub@K % il y a une retenue + 0\dummy \XINT@sub@L % pas de retenue \xint@UDkrof }% \def\XINT@sub@L #1\W\X\Y\Z @@ -1247,8 +1228,8 @@ #1{#6#5#4#3}{#2}% }% \def\XINT@sub@KK@onestep #1#2% -{\expandafter - \XINT@sub@backtoKK\the\numexpr 109999-#2+#1\relax.% +{% + \expandafter\XINT@sub@backtoKK\the\numexpr 109999-#2+#1\relax.% }% \def\XINT@sub@backtoKK #1#2#3.#4% {% @@ -1256,7 +1237,7 @@ }% \def\xint@sub@KK@finish\W\XINT@sub@KK@onestep #1#2#3% {% - \expandafter\space\expandafter-\romannumeral + \expandafter\xint@minus@andstop\romannumeral 0\XINT@cuz@loop #3\W\W\W\W\W\W\W\Z }% \def\xintiCmp {\romannumeral0\xinticmp }% @@ -1328,8 +1309,8 @@ \W\XINT@cmp@onestep #1#2{#7#6#5#4}{#3}% }% \def\XINT@cmp@onestep #1#2#3#4#5#6% -{\expandafter - \XINT@cmp@backtoA\the\numexpr 11#5#4#3#2-#6+#1-1\relax.% +{% + \expandafter\XINT@cmp@backtoA\the\numexpr 11#5#4#3#2-#6+#1-1\relax.% }% \def\XINT@cmp@backtoA #1#2#3.#4% {% @@ -1365,8 +1346,7 @@ \def\xint@OneIfPositive@terminated\Z\XINT@OneIfPositive@onestep\W\X\Y\Z { 0}% \def\XINT@OneIfPositive@onestep #1#2#3#4% {% - \expandafter - \XINT@OneIfPositive@check + \expandafter\XINT@OneIfPositive@check \the\numexpr #1#2#3#4\relax }% \def\XINT@OneIfPositive@check #1% @@ -1377,17 +1357,18 @@ \def\XINT@OneIfPositive@finish #1\W\X\Y\Z{ 1}% \def\xint@OneIfPositive@backtomain 0\XINT@OneIfPositive@finish 0% {\XINT@OneIfPositive@main }% -\def\xintGeq {\romannumeral0\xintgeq }% -\def\xintgeq #1% +\def\xintiGeq {\romannumeral0\xintigeq }% +\def\xintigeq #1% {% \expandafter\expandafter\expandafter \xint@geq \expandafter\expandafter\expandafter {#1}% }% +\let\xintGeq\xintiGeq \let\xintgeq\xintigeq \def\xint@geq #1#2% -{\expandafter\expandafter\expandafter - \XINT@geq@fork #2\Z #1\Z +{% + \expandafter\expandafter\expandafter\XINT@geq@fork #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 @@ -1440,8 +1421,8 @@ \W\XINT@geq@onestep #1#2{#7#6#5#4}{#3}% }% \def\XINT@geq@onestep #1#2#3#4#5#6% -{\expandafter - \XINT@geq@backtoA\the\numexpr 11#5#4#3#2-#6+#1-1\relax.% +{% + \expandafter\XINT@geq@backtoA\the\numexpr 11#5#4#3#2-#6+#1-1\relax.% }% \def\XINT@geq@backtoA #1#2#3.#4% {% @@ -1580,8 +1561,7 @@ \def\XINT@sumexpr {\XINT@sum@loop {0000}{0000}}% \def\XINT@sum@loop #1#2#3% {% - \expandafter\expandafter\expandafter - \XINT@sum@checksign #3\Z {#1}{#2}% + \expandafter\expandafter\expandafter\XINT@sum@checksign #3\Z {#1}{#2}% }% \def\XINT@sum@checksign #1% {% @@ -1652,27 +1632,27 @@ }% \def\XINT@mul@minusplus #1#2#3% {% - \expandafter\space\expandafter-\romannumeral0\expandafter + \expandafter\xint@minus@andstop\romannumeral0\expandafter \XINT@mul@choice@a \expandafter{\romannumeral0\XINT@length {#1#3}}% {\romannumeral0\XINT@length {#2}}{#2}{#1#3}% }% \def\XINT@mul@plusminus #1#2#3% {% - \expandafter\space\expandafter-\romannumeral0\expandafter + \expandafter\xint@minus@andstop\romannumeral0\expandafter \XINT@mul@choice@a \expandafter{\romannumeral0\XINT@length {#3}}% {\romannumeral0\XINT@length {#1#2}}{#1#2}{#3}% }% \def\XINT@mul@plusplus #1#2#3#4% {% - \expandafter\XINT@mul@choice@a - \expandafter{\romannumeral0\XINT@length {#2#4}}% - {\romannumeral0\XINT@length {#1#3}}{#1#3}{#2#4}% + \expandafter\XINT@mul@choice@a + \expandafter{\romannumeral0\XINT@length {#2#4}}% + {\romannumeral0\XINT@length {#1#3}}{#1#3}{#2#4}% }% \def\XINT@mul@choice@a #1#2% {% - \expandafter\XINT@mul@choice@b \expandafter{#2}{#1}% + \expandafter\XINT@mul@choice@b\expandafter{#2}{#1}% }% \def\XINT@mul@choice@b #1#2% {% @@ -1680,11 +1660,9 @@ \expandafter\XINT@mul@choice@littlebyfirst \else \ifnum #2<5 - \expandafter\expandafter\expandafter - \XINT@mul@choice@littlebysecond + \expandafter\expandafter\expandafter\XINT@mul@choice@littlebysecond \else - \expandafter\expandafter\expandafter - \XINT@mul@choice@compare + \expandafter\expandafter\expandafter\XINT@mul@choice@compare \fi \fi {#1}{#2}% @@ -1748,17 +1726,15 @@ }% \def\XINT@mul@choice@same #1#2% {% - \expandafter - \XINT@mul@enter\romannumeral0% - \XINT@RQ {}#1\R\R\R\R\R\R\R\R\Z - \W\X\Y\Z #2\W\X\Y\Z + \expandafter\XINT@mul@enter + \romannumeral0\XINT@RQ {}#1\R\R\R\R\R\R\R\R\Z + \W\X\Y\Z #2\W\X\Y\Z }% \def\XINT@mul@choice@permute #1#2% {% - \expandafter - \XINT@mul@enter\romannumeral0% - \XINT@RQ {}#2\R\R\R\R\R\R\R\R\Z - \W\X\Y\Z #1\W\X\Y\Z + \expandafter\XINT@mul@enter + \romannumeral0\XINT@RQ {}#2\R\R\R\R\R\R\R\R\Z + \W\X\Y\Z #1\W\X\Y\Z }% \def\XINT@mul@Ar #1#2#3#4#5#6% {% @@ -1769,8 +1745,9 @@ \XINT@addr@AC@checkcarry #1% }% \def\XINT@mul@Br #1#2#3#4\W\X\Y\Z #5#6#7#8% -{\expandafter - \XINT@mul@ABEAr\the\numexpr #1+10#2+#8#7#6#5\relax.{#3}#4\W\X\Y\Z +{% + \expandafter\XINT@mul@ABEAr + \the\numexpr #1+10#2+#8#7#6#5\relax.{#3}#4\W\X\Y\Z }% \def\XINT@mul@ABEAr #1#2#3#4#5#6.#7% {% @@ -1778,9 +1755,8 @@ }% \def\XINT@mul@Mr #1% {% - \expandafter - \XINT@mul@Mr@checkifzeroorone - \expandafter{\the\numexpr #1\relax}% + \expandafter\XINT@mul@Mr@checkifzeroorone + \expandafter{\the\numexpr #1}% }% \def\XINT@mul@Mr@checkifzeroorone #1% {% @@ -1800,8 +1776,8 @@ \xint@z #4\xint@mul@pr\Z\XINT@mul@Pr {#1}{#3}{#7#6#5#4}{#2}{#3}% }% \def\XINT@mul@Pr #1#2#3% -{\expandafter - \XINT@mul@Lr\the\numexpr 10000#1+#2*#3\relax +{% + \expandafter\XINT@mul@Lr\the\numexpr 10000#1+#2*#3\relax }% \def\XINT@mul@Lr 1#1#2#3#4#5#6#7#8#9% {% @@ -1815,9 +1791,9 @@ \def\XINT@mul@Mr@end@nocarry 0000\XINT@mul@Mr@end@carry 0000#1{ #1}% \def\XINT@mul@Mr@end@carry #1#2#3#4#5{ #5#4#3#2#1}% \def\XINT@mul@M #1% -{\expandafter - \XINT@mul@M@checkifzeroorone - \expandafter{\the\numexpr #1\relax}% +{% + \expandafter\XINT@mul@M@checkifzeroorone + \expandafter{\the\numexpr #1}% }% \def\XINT@mul@M@checkifzeroorone #1% {% @@ -1833,8 +1809,7 @@ \def\XINT@mul@M@zero #1\Z\Z\Z\Z { 0}% \def\XINT@mul@M@one #1#2#3#4\Z\Z\Z\Z {% - \expandafter - \xint@cleanupzeros@andstop + \expandafter\xint@cleanupzeros@andstop \romannumeral0\XINT@rev{#4}% }% \def\XINT@mul@N #1#2#3#4#5#6#7% @@ -1842,8 +1817,8 @@ \xint@z #4\xint@mul@p\Z\XINT@mul@P {#1}{#3}{#7#6#5#4}{#2}{#3}% }% \def\XINT@mul@P #1#2#3% -{\expandafter - \XINT@mul@L\the\numexpr 10000#1+#2*#3\relax +{% + \expandafter\XINT@mul@L\the\numexpr 10000#1+#2*#3\relax }% \def\XINT@mul@L 1#1#2#3#4#5#6#7#8#9% {% @@ -1854,8 +1829,8 @@ \XINT@mul@M@end #1#4% }% \def\XINT@mul@M@end #1#2#3#4#5#6#7#8% -{\expandafter\space - \the\numexpr #1#2#3#4#5#6#7#8\relax +{% + \expandafter\space\the\numexpr #1#2#3#4#5#6#7#8\relax }% \def\XINT@mul@enter #1\W\X\Y\Z #2#3#4#5% {% @@ -1888,8 +1863,8 @@ \XINT@mul@M {#1}#3\Z\Z\Z\Z }% \def\XINT@mul@start #1#2\W\X\Y\Z -{\expandafter - \XINT@mul@main \expandafter +{% + \expandafter\XINT@mul@main\expandafter {\romannumeral0\XINT@mul@Mr {#1}#2\Z\Z\Z\Z}#2\W\X\Y\Z }% \def\XINT@mul@main #1#2\W\X\Y\Z #3#4#5#6% @@ -1902,12 +1877,12 @@ \W\XINT@mul@compute {#1}{#3#4#5#6}#2\W\X\Y\Z }% \def\XINT@mul@compute #1#2#3\W\X\Y\Z -{\expandafter - \XINT@mul@main \expandafter - {\romannumeral0\expandafter - \XINT@mul@Ar \expandafter0\expandafter{\expandafter}% - \romannumeral0\XINT@mul@Mr {#2}#3\Z\Z\Z\Z - \W\X\Y\Z 0000#1\W\X\Y\Z }#3\W\X\Y\Z +{% + \expandafter\XINT@mul@main\expandafter + {\romannumeral0\expandafter + \XINT@mul@Ar\expandafter0\expandafter{\expandafter}% + \romannumeral0\XINT@mul@Mr {#2}#3\Z\Z\Z\Z + \W\X\Y\Z 0000#1\W\X\Y\Z }#3\W\X\Y\Z }% \def\xint@mul@mainw #1\xint@mul@mainx @@ -1915,8 +1890,7 @@ #3\xint@mul@mainz \W\XINT@mul@compute #4#5#6\W\X\Y\Z \X\Y\Z {% - \expandafter - \XINT@addm@A \expandafter0\expandafter{\expandafter}% + \expandafter\XINT@addm@A \expandafter0\expandafter{\expandafter}% \romannumeral0% \XINT@mul@Mr {#3#2#1}#6\Z\Z\Z\Z \W\X\Y\Z 000#4\W\X\Y\Z @@ -1926,26 +1900,23 @@ #2\xint@mul@mainz \W\XINT@mul@compute #3#4#5\W\X\Y\Z \Y\Z {% - \expandafter - \XINT@addm@A \expandafter0\expandafter{\expandafter}% - \romannumeral0% - \XINT@mul@Mr {#2#1}#5\Z\Z\Z\Z - \W\X\Y\Z 00#3\W\X\Y\Z + \expandafter\XINT@addm@A\expandafter + 0\expandafter{\expandafter}% + \romannumeral0\XINT@mul@Mr {#2#1}#5\Z\Z\Z\Z + \W\X\Y\Z 00#3\W\X\Y\Z }% \def\xint@mul@mainy #1\xint@mul@mainz \W\XINT@mul@compute #2#3#4\W\X\Y\Z \Z {% - \expandafter - \XINT@addm@A \expandafter0\expandafter{\expandafter}% - \romannumeral0% - \XINT@mul@Mr {#1}#4\Z\Z\Z\Z - \W\X\Y\Z 0#2\W\X\Y\Z + \expandafter\XINT@addm@A\expandafter + 0\expandafter{\expandafter}% + \romannumeral0\XINT@mul@Mr {#1}#4\Z\Z\Z\Z + \W\X\Y\Z 0#2\W\X\Y\Z }% \def\xint@mul@mainz\W\XINT@mul@compute #1#2#3\W\X\Y\Z {% - \expandafter - \xint@cleanupzeros@andstop\romannumeral0\XINT@rev{#1}% + \expandafter\xint@cleanupzeros@andstop\romannumeral0\XINT@rev{#1}% }% \def\XINT@mulr@enter #1\W\X\Y\Z #2#3#4#5% {% @@ -1978,8 +1949,8 @@ \XINT@mul@Mr {#1}#3\Z\Z\Z\Z }% \def\XINT@mulr@start #1#2\W\X\Y\Z -{\expandafter - \XINT@mulr@main \expandafter +{% + \expandafter\XINT@mulr@main\expandafter {\romannumeral0\XINT@mul@Mr {#1}#2\Z\Z\Z\Z }#2\W\X\Y\Z }% \def\XINT@mulr@main #1#2\W\X\Y\Z #3#4#5#6% @@ -1992,8 +1963,8 @@ \W\XINT@mulr@compute {#1}{#3#4#5#6}#2\W\X\Y\Z }% \def\XINT@mulr@compute #1#2#3\W\X\Y\Z -{\expandafter - \XINT@mulr@main \expandafter +{% + \expandafter\XINT@mulr@main\expandafter {\romannumeral0\expandafter \XINT@mul@Ar \expandafter0\expandafter{\expandafter}% \romannumeral0\XINT@mul@Mr {#2}#3\Z\Z\Z\Z \W\X\Y\Z 0000#1\W\X\Y\Z @@ -2004,8 +1975,8 @@ #2\xint@mulr@mainy #3\xint@mulr@mainz \W\XINT@mulr@compute #4#5#6\W\X\Y\Z \X\Y\Z -{\expandafter - \XINT@addp@A +{% + \expandafter\XINT@addp@A \expandafter0\expandafter{\expandafter}% \romannumeral0\XINT@mul@Mr {#3#2#1}#6\Z\Z\Z\Z \W\X\Y\Z 000#4\W\X\Y\Z @@ -2014,8 +1985,8 @@ #1\xint@mulr@mainy #2\xint@mulr@mainz \W\XINT@mulr@compute #3#4#5\W\X\Y\Z \Y\Z -{\expandafter - \XINT@addp@A +{% + \expandafter\XINT@addp@A \expandafter0\expandafter{\expandafter}% \romannumeral0\XINT@mul@Mr {#2#1}#5\Z\Z\Z\Z \W\X\Y\Z 00#3\W\X\Y\Z @@ -2023,8 +1994,8 @@ \def\xint@mulr@mainy #1\xint@mulr@mainz \W\XINT@mulr@compute #2#3#4\W\X\Y\Z \Z -{\expandafter - \XINT@addp@A +{% + \expandafter\XINT@addp@A \expandafter0\expandafter{\expandafter}% \romannumeral0\XINT@mul@Mr {#1}#4\Z\Z\Z\Z \W\X\Y\Z 0#2\W\X\Y\Z @@ -2040,8 +2011,8 @@ }% \let\xintSqr\xintiSqr \let\xintsqr\xintisqr \def\XINT@sqr #1% -{\expandafter - \XINT@mul@enter +{% + \expandafter\XINT@mul@enter \romannumeral0% \XINT@RQ {}#1\R\R\R\R\R\R\R\R\Z \W\X\Y\Z #1\W\X\Y\Z @@ -2060,8 +2031,7 @@ \def\XINT@productexpr {\XINT@prod@loop@a 1\Z }% \def\XINT@prod@loop@a #1\Z #2% {% - \expandafter\expandafter\expandafter - \XINT@prod@loop@b #2\Z #1\Z \Z + \expandafter\expandafter\expandafter\XINT@prod@loop@b #2\Z #1\Z \Z }% \def\XINT@prod@loop@b #1% {% @@ -2084,7 +2054,7 @@ \def\XINT@Fac {\romannumeral0\XINT@fac@fork }% \def\XINT@fac@fork #1% {% - \ifcase\xintiSgn {#1} + \ifcase\XINT@Sgn {#1} \xint@afterfi{\expandafter\space\expandafter 1\xint@gobble }% \or \expandafter\XINT@fac@checklength @@ -2096,7 +2066,7 @@ }% \def\XINT@fac@checklength #1% {% - \ifnum \XINT@Length {#1}> 9 + \ifnum\numexpr #1\relax>999999 \xint@afterfi{\xintError:FactorialOfTooBigNumber \expandafter\space\expandafter 1\xint@gobble }% \else @@ -2162,8 +2132,7 @@ \def\xintiPow {\romannumeral0\xintipow }% \def\xintipow #1% {% - \expandafter\expandafter\expandafter - \xint@pow + \expandafter\expandafter\expandafter\xint@pow #1\Z% }% \let\xintPow\xintiPow \let\xintpow\xintipow @@ -2237,7 +2206,7 @@ \def\XINT@pow@BisZero #1#2{ 1}% \def\XINT@pow@checkBlength #1#2% {% - \ifnum\xintiLen{#1} >9 + \ifnum\numexpr #1\relax >999999999 \expandafter\XINT@pow@BtooBig \else \expandafter\XINT@pow@loop @@ -2249,7 +2218,7 @@ \xint@UNDEF }% \def\XINT@pow@BtooBig #1\xint@UNDEF #2\xint@UNDEF - {\xintError:ExponentTooBig\space 0}% + {\xintError:ExponentTooBig\space 0}% \def\XINT@pow@loop #1#2% {% \ifnum #1 = 1 @@ -2301,31 +2270,31 @@ }% \def\XINT@pow@pprod@compute #1\Z #2% {% - \expandafter \XINT@pow@pprod@getnext \expandafter + \expandafter\XINT@pow@pprod@getnext\expandafter {\romannumeral0\XINT@mulr@enter #2\W\X\Y\Z #1\W\X\Y\Z}% }% \def\XINT@pow@pprod@end\relax\XINT@pow@pprod@compute #1\Z #2% {% - \expandafter - \xint@cleanupzeros@andstop + \expandafter\xint@cleanupzeros@andstop \romannumeral0\XINT@rev {#2}% }% -\def\xintQuo {\romannumeral0\xintquo }% -\def\xintRem {\romannumeral0\xintrem }% -\def\xintquo {\expandafter - \xint@firstoftwo@andstop - \romannumeral0\xintdivision }% -\def\xintrem {\expandafter - \xint@secondoftwo@andstop - \romannumeral0\xintdivision }% -\def\xintDivision {\romannumeral0\xintdivision }% -\def\xintdivision #1% +\def\xintiQuo {\romannumeral0\xintiquo }% +\def\xintiRem {\romannumeral0\xintirem }% +\def\xintiquo {\expandafter\xint@firstoftwo@andstop + \romannumeral0\xintidivision }% +\def\xintirem {\expandafter\xint@secondoftwo@andstop + \romannumeral0\xintidivision }% +\let\xintQuo\xintiQuo \let\xintquo\xintiquo +\let\xintRem\xintiRem \let\xintrem\xintirem +\def\xintiDivision {\romannumeral0\xintidivision }% +\def\xintidivision #1% {% \expandafter\expandafter\expandafter \xint@division \expandafter\expandafter\expandafter {#1}% }% +\let\xintDivision\xintiDivision \let\xintdivision\xintidivision \def\xint@division #1#2% {% \expandafter\expandafter\expandafter @@ -2346,8 +2315,7 @@ \xint@UDkrof {#2}{#4}#1#3% #1#2=B, #3#4=A }% -\def\XINT@div@BisZero #1#2#3#4% - {\xintError:DivisionByZero\space {0}{0}}% +\def\XINT@div@BisZero #1#2#3#4{\xintError:DivisionByZero\space {0}{0}}% \def\XINT@div@AisZero #1#2#3#4{ {0}{0}}% \def\XINT@div@plusplus #1#2#3#4% {% @@ -2369,7 +2337,7 @@ }% \def\XINT@div@AisNegative@post #1#2% {% - \ifcase\xintiSgn {#2} + \ifcase\XINT@Sgn {#2} \expandafter \XINT@div@AisNegative@zerorem \or \expandafter \XINT@div@AisNegative@posrem @@ -2416,12 +2384,12 @@ \def\XINT@div@prepareB@a #1% {% \expandafter \XINT@div@prepareB@b \expandafter - {\the\numexpr 4*((#1+1)/4)\relax}{#1}% + {\the\numexpr 4*((#1+1)/4)}{#1}% }% \def\XINT@div@prepareB@b #1#2% {% \expandafter \XINT@div@prepareB@c \expandafter - {\the\numexpr #1-#2\relax}{#1}% + {\the\numexpr #1-#2}{#1}% }% \def\XINT@div@prepareB@c #1% {% @@ -2457,12 +2425,12 @@ \def\XINT@div@prepareA@b #1% {% \expandafter\XINT@div@prepareA@c\expandafter - {\the\numexpr 4*((#1+1)/4)\relax}{#1}% + {\the\numexpr 4*((#1+1)/4)}{#1}% }% \def\XINT@div@prepareA@c #1#2% {% \expandafter\XINT@div@prepareA@d \expandafter - {\the\numexpr #1-#2\relax}{#1}% + {\the\numexpr #1-#2}{#1}% }% \def\XINT@div@prepareA@d #1% {% @@ -2487,11 +2455,9 @@ \expandafter\XINT@div@body@a \else \ifnum #2 = #4 - \expandafter\expandafter\expandafter - \XINT@div@final@a + \expandafter\expandafter\expandafter\XINT@div@final@a \else - \expandafter\expandafter\expandafter - \XINT@div@finished@a + \expandafter\expandafter\expandafter\XINT@div@finished@a \fi\fi {#1}{#4}{#3}{0000}{#2}% }% \def\XINT@div@finished@a #1#2#3% @@ -2566,8 +2532,7 @@ \def\XINT@div@final@dc #1#2% {% \ifnum\XINT@Sgn{#1}<0 - \xint@afterfi {\expandafter\XINT@div@final@dP - \the\numexpr #2-1\relax }% + \xint@afterfi {\expandafter\XINT@div@final@dP\the\numexpr #2-1\relax}% \else \xint@afterfi {\XINT@div@final@e {#1}#2}% \fi }% @@ -2606,13 +2571,10 @@ \def\XINT@div@body@d #1#2#3#4#5#6% {% \ifnum #1 > 0 - \expandafter - \XINT@div@body@d - \expandafter - {\the\numexpr #1-4\expandafter }% + \expandafter\XINT@div@body@d + \expandafter{\the\numexpr #1-4\expandafter }% \else - \expandafter - \XINT@div@body@e + \expandafter\XINT@div@body@e \fi {#6#5#4#3#2}% }% @@ -2636,8 +2598,7 @@ }% \def\XINT@div@body@gk #1#2#3% {% - \expandafter - \XINT@div@body@h + \expandafter\XINT@div@body@h \romannumeral0\XINT@div@sub@xpxp {\romannumeral0\XINT@mul@Mr {#1}#2\Z\Z\Z\Z }{#3}\Z {#1}% }% @@ -2650,8 +2611,7 @@ }% \def\XINT@div@body@gggk #1#2#3#4% {% - \expandafter - \XINT@div@body@h + \expandafter\XINT@div@body@h \romannumeral0\XINT@div@sub@xpxp {\romannumeral0\expandafter\XINT@mul@Ar \expandafter0\expandafter{\expandafter}#2\W\X\Y\Z #1\W\X\Y\Z }% @@ -2673,7 +2633,7 @@ \def\XINT@div@body@i #1#2#3#4#5#6% {% \expandafter\XINT@div@body@j - \expandafter{\the\numexpr (#1+(#6+1)/2)/(#6+1)-1\relax }% + \expandafter{\the\numexpr (#1+(#6+1)/2)/(#6+1)-1}% {#2}{#3}{#4}{#5}{#6}% }% \def\XINT@div@body@j #1#2#3#4% @@ -2685,8 +2645,7 @@ }% \def\XINT@div@body@l #1#2#3#4#5#6#7% {% - \expandafter - \XINT@div@body@m + \expandafter\XINT@div@body@m \the\numexpr 100000000+#2\relax {#6}{#3}{#7}{#1#5}{#4}% }% @@ -2723,8 +2682,7 @@ }% \def\XINT@div@body@repeatp #1#2#3#4#5#6#7% {% - \expandafter \XINT@div@body@p \expandafter - {\the\numexpr #1-4\relax}{#2}{0000#3}% + \expandafter\XINT@div@body@p\expandafter{\the\numexpr #1-4}{#2}{0000#3}% }% \def\XINT@div@body@q #1#2#3#4\Z #5#6% {% @@ -2740,13 +2698,11 @@ }% \def\XINT@div@sub@xpxp #1% {% - \expandafter \XINT@div@sub@xpxp@ \expandafter - {#1}% + \expandafter \XINT@div@sub@xpxp@ \expandafter{#1}% }% \def\XINT@div@sub@xpxp@ #1#2% {% - \expandafter\expandafter\expandafter - \XINT@div@sub@xpxp@@ + \expandafter\expandafter\expandafter\XINT@div@sub@xpxp@@ #2\W\X\Y\Z #1\W\X\Y\Z }% \def\XINT@div@sub@xpxp@@ @@ -2755,26 +2711,23 @@ }% \def\XINT@div@sub@A #1#2#3#4#5#6% {% - \xint@w - #3\xint@div@sub@az - \W\XINT@div@sub@B #1{#3#4#5#6}{#2}% + \xint@w #3\xint@div@sub@az\W + \XINT@div@sub@B #1{#3#4#5#6}{#2}% }% \def\XINT@div@sub@B #1#2#3#4\W\X\Y\Z #5#6#7#8% {% - \xint@w - #5\xint@div@sub@bz - \W\XINT@div@sub@onestep #1#2{#8#7#6#5}{#3}#4\W\X\Y\Z + \xint@w #5\xint@div@sub@bz\W + \XINT@div@sub@onestep #1#2{#8#7#6#5}{#3}#4\W\X\Y\Z }% \def\XINT@div@sub@onestep #1#2#3#4#5#6% -{\expandafter - \XINT@div@sub@backtoA\the\numexpr 11#5#4#3#2-#6+#1-1\relax.% +{% + \expandafter\XINT@div@sub@backtoA\the\numexpr 11#5#4#3#2-#6+#1-1\relax.% }% \def\XINT@div@sub@backtoA #1#2#3.#4% {% \XINT@div@sub@A #2{#3#4}% }% -\def\xint@div@sub@bz - \W\XINT@div@sub@onestep #1#2#3#4#5#6#7% +\def\xint@div@sub@bz\W\XINT@div@sub@onestep #1#2#3#4#5#6#7% {% \xint@UDzerofork #1\dummy \XINT@div@sub@C % @@ -2795,13 +2748,12 @@ }% \def\XINT@div@sub@C #1#2#3#4#5% {% - \xint@w - #2\xint@div@sub@cz - \W\XINT@div@sub@AC@onestep {#5#4#3#2}{#1}% + \xint@w #2\xint@div@sub@cz\W + \XINT@div@sub@AC@onestep {#5#4#3#2}{#1}% }% \def\XINT@div@sub@AC@onestep #1% -{\expandafter - \XINT@div@sub@backtoC\the\numexpr 11#1-1\relax.% +{% + \expandafter\XINT@div@sub@backtoC\the\numexpr 11#1-1\relax.% }% \def\XINT@div@sub@backtoC #1#2#3.#4% {% @@ -2824,64 +2776,60 @@ }% \def\xint@div@sub@cz\W\XINT@div@sub@AC@onestep #1#2{ #2}% \def\xint@div@sub@az\W\XINT@div@sub@B #1#2#3#4\Z { #3}% -\def\xintFDg {\romannumeral0\xintfdg }% -\def\xintfdg #1% +\def\xintiFDg {\romannumeral0\xintifdg }% +\def\xintifdg #1% {% - \expandafter\expandafter\expandafter - \XINT@fdg #1\W\Z + \expandafter\expandafter\expandafter\XINT@fdg #1\W\Z }% +\let\xintFDg\xintiFDg \let\xintfdg\xintifdg \def\XINT@FDg #1{\romannumeral0\XINT@fdg #1\W\Z }% -\def\XINT@fdg #1#2% +\def\XINT@fdg #1#2#3\Z {% - \xint@xpxp@andstop \xint@UDzerominusfork - #1-\dummy {\expandafter 0}% zero - 0#1\dummy {\expandafter #2}% negative - 0-\dummy {\expandafter #1}% positive + #1-\dummy { 0}% zero + 0#1\dummy { #2}% negative + 0-\dummy { #1}% positive \xint@UDkrof - \xint@z }% -\def\xintLDg {\romannumeral0\xintldg }% -\def\xintldg #1% +\def\xintiLDg {\romannumeral0\xintildg }% +\def\xintildg #1% {% \expandafter\expandafter\expandafter \XINT@ldg \expandafter\expandafter\expandafter {#1}% }% +\let\xintLDg\xintiLDg \let\xintldg\xintildg \def\XINT@LDg #1{\romannumeral0\XINT@ldg {#1}}% \def\XINT@ldg #1% {% - \expandafter - \XINT@ldg@ - \romannumeral0\XINT@rev {#1}\Z -}% -\def\XINT@ldg@ #1% -{% - \expandafter\space\expandafter #1\xint@z + \expandafter\XINT@ldg@\romannumeral0\XINT@rev {#1}\Z }% -\def\xintMON {\romannumeral0\xintmon }% -\def\xintmon #1% +\def\XINT@ldg@ #1#2\Z{ #1}% +\def\xintiMON {\romannumeral0\xintimon }% +\def\xintimon #1% {% - \ifodd\xintLDg {#1} + \ifodd\xintiLDg {#1} \xint@afterfi{ -1}% \else \xint@afterfi{ 1}% \fi }% -\def\xintMMON {\romannumeral0\xintmmon }% -\def\xintmmon #1% +\def\xintiMMON {\romannumeral0\xintimmon }% +\def\xintimmon #1% {% - \ifodd\xintLDg {#1} + \ifodd\xintiLDg {#1} \xint@afterfi{ 1}% \else \xint@afterfi{ -1}% \fi }% -\def\xintOdd {\romannumeral0\xintodd }% -\def\xintodd #1% +\let\xintMON\xintiMON \let\xintmon\xintimon +\let\xintMMON\xintiMMON \let\xintmmon\xintimmon +\def\xintiOdd {\romannumeral0\xintiodd }% +\def\xintiodd #1% {% - \ifodd\xintLDg{#1} + \ifodd\xintiLDg{#1} \xint@afterfi{ 1}% \else \xint@afterfi{ 0}% @@ -2895,11 +2843,11 @@ \xint@afterfi{ 0}% \fi }% +\let\xintOdd\xintiOdd \let\xintodd\xintiodd \def\xintDSL {\romannumeral0\xintdsl }% \def\xintdsl #1% {% - \expandafter\expandafter\expandafter - \XINT@dsl #1\Z + \expandafter\expandafter\expandafter\XINT@dsl #1\Z }% \def\XINT@DSL #1{\romannumeral0\XINT@dsl #1\Z }% \def\XINT@dsl #1% @@ -2919,24 +2867,22 @@ \def\XINT@DSR #1{\romannumeral0\XINT@dsr@a {#1}\W\Z }% \def\XINT@dsr@a {% - \expandafter - \XINT@dsr@b + \expandafter\XINT@dsr@b \romannumeral0\XINT@rev }% \def\XINT@dsr@b #1#2#3\Z {% \xint@w #2\xint@dsr@onedigit\W \xint@minus #2\xint@dsr@onedigit-% - \expandafter - \XINT@dsr@removew + \expandafter\XINT@dsr@removew \romannumeral0\XINT@rev {#2#3}% }% \def\xint@dsr@onedigit #1\XINT@rev #2{ 0}% \def\XINT@dsr@removew #1\W { }% \def\xintDSHr {\romannumeral0\xintdshr }% \def\xintdshr #1% -{\expandafter\expandafter\expandafter - \XINT@dshr@checkxpositive #1\Z +{% + \expandafter\expandafter\expandafter\XINT@dshr@checkxpositive #1\Z }% \def\XINT@dshr@checkxpositive #1% {% @@ -2949,8 +2895,7 @@ \def\XINT@dshr@xzeroorneg #1\Z #2{ 0}% \def\XINT@dshr@xpositive #1\Z {% - \expandafter - \xint@secondoftwo@andstop + \expandafter\xint@secondoftwo@andstop \romannumeral0\xintdsx {#1}% }% \def\xintDSH {\romannumeral0\xintdsh }% @@ -2977,8 +2922,7 @@ \def\XINT@dsh@xiszero #1\Z #2{ #2}% \def\XINT@dsh@xisPos #1\Z #2% {% - \expandafter - \xint@firstoftwo@andstop + \expandafter\xint@firstoftwo@andstop \romannumeral0\XINT@dsx@checksignA #2\Z {#1}% via DSx }% \def\xintDSx {\romannumeral0\xintdsx }% @@ -2991,8 +2935,7 @@ }% \def\xint@dsx #1#2% {% - \expandafter\expandafter\expandafter - \XINT@dsx@checksignx #2\Z {#1}% + \expandafter\expandafter\expandafter\XINT@dsx@checksignx #2\Z {#1}% }% \def\XINT@DSx #1#2{\romannumeral0\XINT@dsx@checksignx #1\Z {#2}}% \def\XINT@dsx #1#2{\XINT@dsx@checksignx #1\Z {#2}}% @@ -3076,8 +3019,7 @@ \def\XINT@dsx@AisZero #1\Z #2{ {0}{0}}% \def\XINT@dsx@AisNeg #1\Z #2% {% - \expandafter - \XINT@dsx@AisNeg@dosplit@andcheckfirst + \expandafter\XINT@dsx@AisNeg@dosplit@andcheckfirst \romannumeral0\XINT@split@checksizex {#2}{#1}% }% \def\XINT@dsx@AisNeg@dosplit@andcheckfirst #1% @@ -3092,26 +3034,22 @@ \def\XINT@dsx@AisNeg@finish@zero\Z \XINT@dsx@AisNeg@finish@notzero\Z #1% {% - \expandafter - \XINT@dsx@end + \expandafter\XINT@dsx@end \expandafter {\romannumeral0\XINT@num {-#1}}{0}% }% \def\XINT@dsx@AisNeg@finish@notzero #1\Z #2% {% - \expandafter - \XINT@dsx@end + \expandafter\XINT@dsx@end \expandafter {\romannumeral0\XINT@num {#2}}{-#1}% }% \def\XINT@dsx@AisPos #1\Z #2% {% - \expandafter - \XINT@dsx@AisPos@finish + \expandafter\XINT@dsx@AisPos@finish \romannumeral0\XINT@split@checksizex {#2}{#1}% }% \def\XINT@dsx@AisPos@finish #1#2% {% - \expandafter - \XINT@dsx@end + \expandafter\XINT@dsx@end \expandafter {\romannumeral0\XINT@num {#2}}% {\romannumeral0\XINT@num {#1}}% }% @@ -3123,14 +3061,12 @@ \def\xintDecSplitR {\romannumeral0\xintdecsplitr }% \def\xintdecsplitl {% - \expandafter - \xint@firstoftwo@andstop + \expandafter\xint@firstoftwo@andstop \romannumeral0\xintdecsplit }% \def\xintdecsplitr {% - \expandafter - \xint@secondoftwo@andstop + \expandafter\xint@secondoftwo@andstop \romannumeral0\xintdecsplit }% \def\xintDecSplit {\romannumeral0\xintdecsplit }% @@ -3218,10 +3154,7 @@ {% \XINT@split@fromleft@toofar@b #2\Z }% -\def\XINT@split@fromleft@toofar@b #1\W #2\Z -{% - \space {#1}{}% -}% +\def\XINT@split@fromleft@toofar@b #1\W #2\Z { {#1}{}}% \def\XINT@split@fromleft@one@andend #1\fi {\fi\expandafter\XINT@split@fromleft@checkiftoofar\XINT@split@fromleft@one }% \def\XINT@split@fromleft@one #1#2{#2{#1#2}}% @@ -3252,10 +3185,7 @@ {% \XINT@split@fromleft@wenttoofar@b #1\Z }% -\def\XINT@split@fromleft@wenttoofar@b #1\W #2\Z -{% - \space {#1}% -}% +\def\XINT@split@fromleft@wenttoofar@b #1\W #2\Z { {#1}}% \def\XINT@split@fromright #1\Z #2% {% \expandafter \XINT@split@fromright@a \expandafter diff --git a/Master/texmf-dist/tex/generic/xint/xintcfrac.sty b/Master/texmf-dist/tex/generic/xint/xintcfrac.sty index 8600e32fff7..6b3f15c7534 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.04 of April 25, 2013) +%% The xint bundle (version 1.05 of May 1st, 2013) %% xintcfrac: Expandable continued fractions with xint package %% Copyright (C) 2013 by Jean-Francois Burnol %%---------------------------------------------------------------- @@ -134,7 +134,7 @@ \endlinechar=\the\endlinechar \catcode13=\the\catcode13 % ^^M \catcode32=\the\catcode32 % - \catcode61=\the\catcode61 % = + \catcode61=\the\catcode61\relax % = \noexpand\endinput }% \XINT@setcatcodes @@ -162,7 +162,7 @@ \fi \expandafter\x\csname ver@xintcfrac.sty\endcsname \ProvidesPackage{xintcfrac}% - [2013/04/25 v1.04 Expandable continued fractions with xint package (jfB)]% + [2013/05/01 v1.05 Expandable continued fractions with xint package (jfB)]% \def\xintCFrac {\romannumeral0\xintcfrac }% \def\xintcfrac #1% {% @@ -198,7 +198,7 @@ }% \def\XINT@cfrac@A #1/#2\Z {% - \expandafter\XINT@cfrac@B\romannumeral0\xintdivision {#1}{#2}{#2}% + \expandafter\XINT@cfrac@B\romannumeral0\xintidivision {#1}{#2}{#2}% }% \def\XINT@cfrac@B #1#2% {% @@ -293,6 +293,23 @@ \XINT@gcfrac@@end #3% }% \def\XINT@gcfrac@@end #1\cfrac#2#3{ #3}% +\def\xintGCtoGCx {\romannumeral0\xintgctogcx }% +\def\xintgctogcx #1#2#3% +{% + \expandafter\expandafter\expandafter\XINT@gctgcx@start + \expandafter\expandafter\expandafter {#3}{#1}{#2}% +}% +\def\XINT@gctgcx@start #1#2#3{\XINT@gctgcx@loop@a {}{#2}{#3}#1+\W/}% +\def\XINT@gctgcx@loop@a #1#2#3#4+#5/% +{% + \xint@w #5\XINT@gctgcx@end\W + \XINT@gctgcx@loop@b {#1{#4}}{#2{#5}#3}{#2}{#3}% +}% +\def\XINT@gctgcx@loop@b #1#2% +{% + \XINT@gctgcx@loop@a {#1#2}% +}% +\def\XINT@gctgcx@end\W\XINT@gctgcx@loop@b #1#2#3#4{ #1}% \def\xintFtoCs {\romannumeral0\xintftocs }% \def\xintftocs #1% {% @@ -300,7 +317,7 @@ }% \def\XINT@ftc@A #1/#2\Z {% - \expandafter\XINT@ftc@B\romannumeral0\xintdivision {#1}{#2}{#2}% + \expandafter\XINT@ftc@B\romannumeral0\xintidivision {#1}{#2}{#2}% }% \def\XINT@ftc@B #1#2% {% @@ -336,7 +353,7 @@ }% \def\XINT@ftcx@A #1/#2\Z {% - \expandafter\XINT@ftcx@B\romannumeral0\xintdivision {#1}{#2}{#2}% + \expandafter\XINT@ftcx@B\romannumeral0\xintidivision {#1}{#2}{#2}% }% \def\XINT@ftcx@B #1#2% {% @@ -379,7 +396,7 @@ }% \def\XINT@ftcc@B #1/#2\Z {% - \expandafter\XINT@ftcc@C\expandafter {\romannumeral0\xintquo {#1}{#2}}% + \expandafter\XINT@ftcc@C\expandafter {\romannumeral0\xintiquo {#1}{#2}}% }% \def\XINT@ftcc@C #1#2% {% @@ -412,7 +429,7 @@ \def\XINT@ftcc@loop@b #1/#2\Z {% \expandafter\XINT@ftcc@loop@c\expandafter - {\romannumeral0\xintquo {#1}{#2}}% + {\romannumeral0\xintiquo {#1}{#2}}% }% \def\XINT@ftcc@loop@c #1#2% {% @@ -451,8 +468,7 @@ \def\xintCstoF {\romannumeral0\xintcstof }% \def\xintcstof #1% {% - \expandafter\expandafter\expandafter - \XINT@cstf@prep #1,\W,% + \expandafter\expandafter\expandafter\XINT@cstf@prep #1,\W,% }% \def\XINT@cstf@prep {% @@ -487,8 +503,7 @@ \def\xintiCstoF {\romannumeral0\xinticstof }% \def\xinticstof #1% {% - \expandafter\expandafter\expandafter - \XINT@icstf@prep #1,\W,% + \expandafter\expandafter\expandafter\XINT@icstf@prep #1,\W,% }% \def\XINT@icstf@prep {% @@ -515,8 +530,7 @@ \def\xintGCtoF {\romannumeral0\xintgctof }% \def\xintgctof #1% {% - \expandafter\expandafter\expandafter - \XINT@gctf@prep #1+\W/% + \expandafter\expandafter\expandafter\XINT@gctf@prep #1+\W/% }% \def\XINT@gctf@prep {% @@ -576,8 +590,7 @@ \def\xintiGCtoF {\romannumeral0\xintigctof }% \def\xintigctof #1% {% - \expandafter\expandafter\expandafter - \XINT@igctf@prep #1+\W/% + \expandafter\expandafter\expandafter\XINT@igctf@prep #1+\W/% }% \def\XINT@igctf@prep {% @@ -623,8 +636,7 @@ \def\xintCstoCv {\romannumeral0\xintcstocv }% \def\xintcstocv #1% {% - \expandafter\expandafter\expandafter - \XINT@cstcv@prep #1,\W,% + \expandafter\expandafter\expandafter\XINT@cstcv@prep #1,\W,% }% \def\XINT@cstcv@prep {% @@ -666,8 +678,7 @@ \def\xintiCstoCv {\romannumeral0\xinticstocv }% \def\xinticstocv #1% {% - \expandafter\expandafter\expandafter - \XINT@icstcv@prep #1,\W,% + \expandafter\expandafter\expandafter\XINT@icstcv@prep #1,\W,% }% \def\XINT@icstcv@prep {% @@ -700,8 +711,7 @@ \def\xintGCtoCv {\romannumeral0\xintgctocv }% \def\xintgctocv #1% {% - \expandafter\expandafter\expandafter - \XINT@gctcv@prep #1+\W/% + \expandafter\expandafter\expandafter\XINT@gctcv@prep #1+\W/% }% \def\XINT@gctcv@prep {% @@ -771,8 +781,7 @@ \def\xintiGCtoCv {\romannumeral0\xintigctocv }% \def\xintigctocv #1% {% - \expandafter\expandafter\expandafter - \XINT@igctcv@prep #1+\W/% + \expandafter\expandafter\expandafter\XINT@igctcv@prep #1+\W/% }% \def\XINT@igctcv@prep {% @@ -1022,8 +1031,7 @@ \def\xintCstoGC {\romannumeral0\xintcstogc }% \def\xintcstogc #1% {% - \expandafter\expandafter\expandafter - \XINT@cstc@prep #1,\W,% + \expandafter\expandafter\expandafter\XINT@cstc@prep #1,\W,% }% \def\XINT@cstc@prep #1,{\XINT@cstc@loop@a {{#1}}}% \def\XINT@cstc@loop@a #1#2,% @@ -1035,8 +1043,7 @@ \def\xintGCtoGC {\romannumeral0\xintgctogc }% \def\xintgctogc #1% {% - \expandafter\expandafter\expandafter - \XINT@gctgc@start #1+\W/% + \expandafter\expandafter\expandafter\XINT@gctgc@start #1+\W/% }% \def\XINT@gctgc@start {\XINT@gctgc@loop@a {}}% \def\XINT@gctgc@loop@a #1#2+#3/% diff --git a/Master/texmf-dist/tex/generic/xint/xintfrac.sty b/Master/texmf-dist/tex/generic/xint/xintfrac.sty index c4d8d8aaae5..95d8f8bbaab 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.04 of April 25, 2013) +%% The xint bundle (version 1.05 of May 1st, 2013) %% xintfrac: Expandable operations on fractions %% Copyright (C) 2013 by Jean-Francois Burnol %%---------------------------------------------------------------- @@ -135,7 +135,7 @@ \endlinechar=\the\endlinechar \catcode13=\the\catcode13 % ^^M \catcode32=\the\catcode32 % - \catcode61=\the\catcode61 % = + \catcode61=\the\catcode61\relax % = \noexpand\endinput }% \XINT@setcatcodes @@ -164,7 +164,7 @@ \fi \expandafter\x\csname ver@xintfrac.sty\endcsname \ProvidesPackage{xintfrac}% - [2013/04/25 v1.04 Expandable operations on fractions (jfB)]% + [2013/05/01 v1.05 Expandable operations on fractions (jfB)]% \def\xintLen {\romannumeral0\xintlen }% \def\xintlen #1% {% @@ -186,8 +186,7 @@ \fi {#2}{#3}[#1]% }% -\def\XINT@outfrac@divisionbyzero #1#2% - {\xintError:DivisionByZero\space #1/0}% +\def\XINT@outfrac@divisionbyzero #1#2{\xintError:DivisionByZero\space #1/0}% \def\XINT@outfrac@P #1#2% {% \ifcase\XINT@Sgn{#1} @@ -205,211 +204,10 @@ {% \expandafter\XINT@outfrac@P\expandafter {#2}{#1}% }% -\def\xintRaw {\romannumeral0\xintraw }% -\def\xintraw -{% - \expandafter\XINT@raw\romannumeral0\XINT@infrac -}% -\def\XINT@raw #1% -{% - \ifcase\XINT@Sgn {#1} - \expandafter\XINT@raw@Ba - \or - \expandafter\XINT@raw@A - \else - \expandafter\XINT@raw@Ba - \fi - {#1}% -}% -\def\XINT@raw@A #1#2#3{\xint@dsh {#2}{-#1}/#3}% -\def\XINT@raw@Ba #1#2#3{\expandafter\XINT@raw@Bb - \expandafter{\romannumeral0\xint@dsh {#3}{#1}}{#2}}% -\def\XINT@raw@Bb #1#2{ #2/#1}% -\def\xintNumerator {\romannumeral0\xintnumerator }% -\def\xintnumerator -{% - \expandafter\XINT@numer\romannumeral0\XINT@infrac -}% -\def\XINT@numer #1% -{% - \ifcase\XINT@Sgn {#1} - \expandafter\XINT@numer@B - \or - \expandafter\XINT@numer@A - \else - \expandafter\XINT@numer@B - \fi - {#1}% -}% -\def\XINT@numer@A #1#2#3{\xint@dsh {#2}{-#1}}% -\def\XINT@numer@B #1#2#3{ #2}% -\def\xintDenominator {\romannumeral0\xintdenominator }% -\def\xintdenominator -{% - \expandafter\XINT@denom\romannumeral0\XINT@infrac -}% -\def\XINT@denom #1% -{% - \ifcase\XINT@Sgn {#1} - \expandafter\XINT@denom@B - \or - \expandafter\XINT@denom@A - \else - \expandafter\XINT@denom@B - \fi - {#1}% -}% -\def\XINT@denom@A #1#2#3{ #3}% -\def\XINT@denom@B #1#2#3{\xint@dsh {#3}{#1}}% -\def\xintFrac {\romannumeral0\xintfrac }% -\def\xintfrac #1% -{% - \expandafter\XINT@@frac@A\romannumeral0\XINT@infrac {#1}% -}% -\def\XINT@@frac@A #1{\XINT@@frac@B #1\Z }% -\def\XINT@@frac@B #1#2\Z -{% - \xint@zero #1\XINT@@frac@C 0\XINT@@frac@D {10^{#1#2}}% -}% -\def\XINT@@frac@C #1#2#3#4#5% -{% - \ifcase\XINT@isOne {#5} - \or \xint@afterfi {\expandafter\xint@firstoftwo@andstop\xint@gobble@two }% - \fi - \space - \frac {#4}{#5}% -}% -\def\XINT@@frac@D #1#2#3% -{% - \ifcase\XINT@isOne {#3} - \or \XINT@@frac@E - \fi - \space - \frac {#2}{#3}#1% -}% -\def\XINT@@frac@E \fi #1#2#3#4{\fi \space #3\cdot }% -\def\xintSignedFrac {\romannumeral0\xintsignedfrac }% -\def\xintsignedfrac #1% -{% - \expandafter\XINT@sgnfrac@a\romannumeral0\XINT@infrac {#1}% -}% -\def\XINT@sgnfrac@a #1#2% -{% - \XINT@sgnfrac@b #2\Z {#1}% -}% -\def\XINT@sgnfrac@b #1% -{% - \xint@UDsignfork - #1\dummy \XINT@sgnfrac@N - -\dummy {\XINT@sgnfrac@P #1}% - \xint@UDkrof -}% -\def\XINT@sgnfrac@P #1\Z #2% -{% - \XINT@@frac@A {#2}{#1}% -}% -\def\XINT@sgnfrac@N -{% - \expandafter\xint@minus@andstop\romannumeral0\XINT@sgnfrac@P -}% -\def\xintFwOver {\romannumeral0\xintfwover }% -\def\xintfwover #1% -{% - \expandafter\XINT@fwover@A\romannumeral0\XINT@infrac {#1}% -}% -\def\XINT@fwover@A #1{\XINT@fwover@B #1\Z }% -\def\XINT@fwover@B #1#2\Z -{% - \xint@zero #1\XINT@fwover@C 0\XINT@fwover@D {10^{#1#2}}% -}% -\def\XINT@fwover@C #1#2#3#4#5% -{% - \ifcase\XINT@isOne {#5} - \xint@afterfi { {#4\over #5}}% - \or - \xint@afterfi { #4}% - \fi -}% -\def\XINT@fwover@D #1#2#3% -{% - \ifcase\XINT@isOne {#3} - \xint@afterfi { {#2\over #3}}% - \or - \xint@afterfi { #2\cdot }% - \fi - #1% -}% -\def\xintSignedFwOver {\romannumeral0\xintsignedfwover }% -\def\xintsignedfwover #1% -{% - \expandafter\XINT@sgnfwover@a\romannumeral0\XINT@infrac {#1}% -}% -\def\XINT@sgnfwover@a #1#2% -{% - \XINT@sgnfwover@b #2\Z {#1}% -}% -\def\XINT@sgnfwover@b #1% -{% - \xint@UDsignfork - #1\dummy \XINT@sgnfwover@N - -\dummy {\XINT@sgnfwover@P #1}% - \xint@UDkrof -}% -\def\XINT@sgnfwover@P #1\Z #2% -{% - \XINT@fwover@A {#2}{#1}% -}% -\def\XINT@sgnfwover@N -{% - \expandafter\xint@minus@andstop\romannumeral0\XINT@sgnfwover@P -}% -\def\xintSum {\romannumeral0\xintsum }% -\def\xintsum #1{\xintsumexpr #1\relax }% -\def\xintSumExpr {\romannumeral0\xintsumexpr }% -\def\xintsumexpr {\expandafter\expandafter\expandafter\XINT@fsumexpr }% -\def\XINT@fsumexpr {\XINT@fsum@loop@a {0[0]}}% -\def\XINT@fsum@loop@a #1#2% -{% - \expandafter\expandafter\expandafter - \XINT@fsum@loop@b #2\Z {#1}% -}% -\def\XINT@fsum@loop@b #1% -{% - \xint@relax #1\XINT@fsum@finished\relax - \XINT@fsum@loop@c #1% -}% -\def\XINT@fsum@loop@c #1\Z #2% -{% - \expandafter\XINT@fsum@loop@a\expandafter - {\romannumeral0\xintadd {#2}{#1}}% -}% -\def\XINT@fsum@finished #1\Z #2{ #2}% -\def\xintPrd {\romannumeral0\xintprd }% -\def\xintprd #1{\xintproductexpr #1\relax }% -\def\xintProductExpr {\romannumeral0\xintproductexpr }% -\def\xintproductexpr{\expandafter\expandafter\expandafter\XINT@fproductexpr }% -\def\XINT@fproductexpr {\XINT@fprod@loop@a {1[0]}}% -\def\XINT@fprod@loop@a #1#2% -{% - \expandafter\expandafter\expandafter - \XINT@fprod@loop@b #2\Z {#1}% -}% -\def\XINT@fprod@loop@b #1% -{% - \xint@relax #1\XINT@fprod@finished\relax - \XINT@fprod@loop@c #1% -}% -\def\XINT@fprod@loop@c #1\Z #2% -{% - \expandafter\XINT@fprod@loop@a\expandafter - {\romannumeral0\xintmul {#1}{#2}}% -}% -\def\XINT@fprod@finished #1\Z #2{ #2}% \def\XINT@inFrac {\romannumeral0\XINT@infrac }% \def\XINT@infrac #1% {% - \expandafter\expandafter\expandafter - \XINT@infrac@ #1[\W]\Z\T + \expandafter\expandafter\expandafter\XINT@infrac@ #1[\W]\Z\T }% \def\XINT@infrac@ #1[#2#3]#4\Z {% @@ -473,7 +271,7 @@ \def\XINT@frac@Ca \Z #1\Z {\XINT@frac@D {0}{#1}}% \def\XINT@frac@Cb #1.\W\Z #2\Z {% - \expandafter \XINT@frac@D \expandafter + \expandafter\XINT@frac@D\expandafter {\romannumeral0\XINT@length {#1}}{#2#1}% }% \def\XINT@frac@D #1#2#3#4% @@ -502,8 +300,7 @@ }% \def\XINT@frac@Gneg #1\Z #2#3% {% - \expandafter\XINT@frac@H \expandafter - {\romannumeral0\XINT@opp #2}{#3}{#1}% + \expandafter\XINT@frac@H \expandafter{\romannumeral0\XINT@opp #2}{#3}{#1}% }% \def\XINT@frac@H #1#2{ {#2}{#1}}% \def\XINT@frac@Gpos #1\Z #2#3{ {#3}{#2}{#1}}% @@ -527,12 +324,12 @@ \expandafter\XINT@cuz@cnt@checka\expandafter {\the\numexpr #1+8\relax}{#2#3#4#5#6#7#8#9}% }% -\def\XINT@cuz@cnt@toofara #1#2#3#4#5#6% +\def\XINT@cuz@cnt@toofara\R + \expandafter\XINT@cuz@cnt@checka\expandafter #1#2% {% - \XINT@cuz@cnt@toofarb {#5}#6% + \XINT@cuz@cnt@toofarb {#1}#2% }% -\def\XINT@cuz@cnt@toofarb #1#2\Z - {\XINT@cuz@cnt@toofarc #2\Z {#1}}% +\def\XINT@cuz@cnt@toofarb #1#2\Z {\XINT@cuz@cnt@toofarc #2\Z {#1}}% \def\XINT@cuz@cnt@toofarc #1#2#3#4#5#6#7#8% {% \xint@r #2\XINT@cuz@cnt@toofard 7% @@ -589,7 +386,7 @@ \def\XINT@cuz@cnt@stopc #1#2\Z #3\R #4\Z #5% {% \expandafter\XINT@cuz@cnt@stopd\expandafter - {\the\numexpr #5-#1\relax}#3% + {\the\numexpr #5-#1}#3% }% \def\XINT@cuz@cnt@stopd #1#2\R #3\Z {% @@ -600,6 +397,164 @@ \xint@undef\xint@undef\xint@undef\xint@undef \xint@UNDEF }{#1}% }% +\def\xintRaw {\romannumeral0\xintraw }% +\def\xintraw +{% + \expandafter\XINT@raw\romannumeral0\XINT@infrac +}% +\def\XINT@raw #1% +{% + \ifcase\XINT@Sgn {#1} + \expandafter\XINT@raw@Ba + \or + \expandafter\XINT@raw@A + \else + \expandafter\XINT@raw@Ba + \fi + {#1}% +}% +\def\XINT@raw@A #1#2#3{\xint@dsh {#2}{-#1}/#3}% +\def\XINT@raw@Ba #1#2#3{\expandafter\XINT@raw@Bb + \expandafter{\romannumeral0\xint@dsh {#3}{#1}}{#2}}% +\def\XINT@raw@Bb #1#2{ #2/#1}% +\def\xintNumerator {\romannumeral0\xintnumerator }% +\def\xintnumerator +{% + \expandafter\XINT@numer\romannumeral0\XINT@infrac +}% +\def\XINT@numer #1% +{% + \ifcase\XINT@Sgn {#1} + \expandafter\XINT@numer@B + \or + \expandafter\XINT@numer@A + \else + \expandafter\XINT@numer@B + \fi + {#1}% +}% +\def\XINT@numer@A #1#2#3{\xint@dsh {#2}{-#1}}% +\def\XINT@numer@B #1#2#3{ #2}% +\def\xintDenominator {\romannumeral0\xintdenominator }% +\def\xintdenominator +{% + \expandafter\XINT@denom\romannumeral0\XINT@infrac +}% +\def\XINT@denom #1% +{% + \ifcase\XINT@Sgn {#1} + \expandafter\XINT@denom@B + \or + \expandafter\XINT@denom@A + \else + \expandafter\XINT@denom@B + \fi + {#1}% +}% +\def\XINT@denom@A #1#2#3{ #3}% +\def\XINT@denom@B #1#2#3{\xint@dsh {#3}{#1}}% +\def\xintFrac {\romannumeral0\xintfrac }% +\def\xintfrac #1% +{% + \expandafter\XINT@@frac@A\romannumeral0\XINT@infrac {#1}% +}% +\def\XINT@@frac@A #1{\XINT@@frac@B #1\Z }% +\def\XINT@@frac@B #1#2\Z +{% + \xint@zero #1\XINT@@frac@C 0\XINT@@frac@D {10^{#1#2}}% +}% +\def\XINT@@frac@C #1#2#3#4#5% +{% + \ifcase\XINT@isOne {#5} + \or \xint@afterfi {\expandafter\xint@firstoftwo@andstop\xint@gobble@two }% + \fi + \space + \frac {#4}{#5}% +}% +\def\XINT@@frac@D #1#2#3% +{% + \ifcase\XINT@isOne {#3} + \or \XINT@@frac@E + \fi + \space + \frac {#2}{#3}#1% +}% +\def\XINT@@frac@E \fi #1#2#3#4{\fi \space #3\cdot }% +\def\xintSignedFrac {\romannumeral0\xintsignedfrac }% +\def\xintsignedfrac #1% +{% + \expandafter\XINT@sgnfrac@a\romannumeral0\XINT@infrac {#1}% +}% +\def\XINT@sgnfrac@a #1#2% +{% + \XINT@sgnfrac@b #2\Z {#1}% +}% +\def\XINT@sgnfrac@b #1% +{% + \xint@UDsignfork + #1\dummy \XINT@sgnfrac@N + -\dummy {\XINT@sgnfrac@P #1}% + \xint@UDkrof +}% +\def\XINT@sgnfrac@P #1\Z #2% +{% + \XINT@@frac@A {#2}{#1}% +}% +\def\XINT@sgnfrac@N +{% + \expandafter\xint@minus@andstop\romannumeral0\XINT@sgnfrac@P +}% +\def\xintFwOver {\romannumeral0\xintfwover }% +\def\xintfwover #1% +{% + \expandafter\XINT@fwover@A\romannumeral0\XINT@infrac {#1}% +}% +\def\XINT@fwover@A #1{\XINT@fwover@B #1\Z }% +\def\XINT@fwover@B #1#2\Z +{% + \xint@zero #1\XINT@fwover@C 0\XINT@fwover@D {10^{#1#2}}% +}% +\def\XINT@fwover@C #1#2#3#4#5% +{% + \ifcase\XINT@isOne {#5} + \xint@afterfi { {#4\over #5}}% + \or + \xint@afterfi { #4}% + \fi +}% +\def\XINT@fwover@D #1#2#3% +{% + \ifcase\XINT@isOne {#3} + \xint@afterfi { {#2\over #3}}% + \or + \xint@afterfi { #2\cdot }% + \fi + #1% +}% +\def\xintSignedFwOver {\romannumeral0\xintsignedfwover }% +\def\xintsignedfwover #1% +{% + \expandafter\XINT@sgnfwover@a\romannumeral0\XINT@infrac {#1}% +}% +\def\XINT@sgnfwover@a #1#2% +{% + \XINT@sgnfwover@b #2\Z {#1}% +}% +\def\XINT@sgnfwover@b #1% +{% + \xint@UDsignfork + #1\dummy \XINT@sgnfwover@N + -\dummy {\XINT@sgnfwover@P #1}% + \xint@UDkrof +}% +\def\XINT@sgnfwover@P #1\Z #2% +{% + \XINT@fwover@A {#2}{#1}% +}% +\def\XINT@sgnfwover@N +{% + \expandafter\xint@minus@andstop\romannumeral0\XINT@sgnfwover@P +}% \def\xintREZ {\romannumeral0\xintrez }% \def\xintrez {% @@ -618,8 +573,7 @@ \xint@UDkrof }% \def\XINT@rez@zero #1\Z #2#3{ 0/1[0]}% -\def\XINT@rez@neg -{\expandafter\space\expandafter-\romannumeral0\XINT@rez@B }% +\def\XINT@rez@neg {\expandafter\xint@minus@andstop\romannumeral0\XINT@rez@B }% \def\XINT@rez@B #1\Z {% \expandafter\XINT@rez@C\romannumeral0\XINT@factortens {#1}% @@ -635,76 +589,41 @@ }% \def\XINT@rez@E #1#2#3{ #3/#2[#1]}% \def\xintIrr {\romannumeral0\xintirr }% -\def\xintirr +\def\xintirr #1% {% - \expandafter\XINT@irr@putsign - \romannumeral0\expandafter\XINT@irr - \romannumeral0\XINT@infrac + \expandafter\XINT@irr@start\romannumeral0\xintraw {#1}\Z }% -\def\XINT@irr@putsign #1#2#3% +\def\XINT@irr@start #1#2/#3\Z {% - \ifcase\XINT@isOne {#2} - \xint@afterfi {#3#1/#2}% - \or - \xint@afterfi {#3#1}% - \fi -}% -\def\XINT@irr #1% -{% - \ifcase\XINT@Sgn {#1} - \expandafter\XINT@irr@B + \ifcase\XINT@isOne {#3} + \xint@afterfi + {\xint@UDsignfork + #1\dummy \XINT@irr@negative + -\dummy {\XINT@irr@nonneg #1}% + \xint@UDkrof}% \or - \expandafter\XINT@irr@A - \else - \expandafter\XINT@irr@B + \xint@afterfi{\XINT@irr@denomisone #1}% \fi - {#1}% -}% -\def\XINT@irr@A #1#2% -{% - \expandafter \XINT@irr@C - \romannumeral0\xint@dsh {#2}{-#1}\Z -}% -\def\XINT@irr@B #1#2#3% -{% - \expandafter \XINT@irr@BC \expandafter - {\romannumeral0\xint@dsh {#3}{#1}}{#2}% -}% -\def\XINT@irr@BC #1#2{\XINT@irr@C #2\Z {#1}}% -\def\XINT@irr@C #1#2\Z -{% - \xint@UDsignfork - #1\dummy \XINT@irr@negative - -\dummy {\XINT@irr@nonneg #1}% - \xint@UDkrof - #2\Z + #2\Z {#3}% }% -\def\XINT@irr@negative #1\Z #2{\XINT@irr@D #1\Z #2\Z \XINT@opp}% -\def\XINT@irr@nonneg #1\Z #2{\XINT@irr@D #1\Z #2\Z \space}% +\def\XINT@irr@denomisone #1\Z #2{ #1}% +\def\XINT@irr@negative #1\Z #2{\XINT@irr@D #1\Z #2\Z \XINT@opp}% +\def\XINT@irr@nonneg #1\Z #2{\XINT@irr@D #1\Z #2\Z \space}% \def\XINT@irr@D #1#2\Z #3#4\Z {% \xint@UDzerosfork #3#1\dummy \XINT@irr@indeterminate #30\dummy \XINT@irr@divisionbyzero #10\dummy \XINT@irr@zero - 00\dummy \XINT@irr@nonzero@checkifone + 00\dummy \XINT@irr@loop@a \xint@UDkrof {#3#4}{#1#2}{#3#4}{#1#2}% }% -\def\XINT@irr@indeterminate #1#2#3#4{\expandafter\xintError:ZeroOverZero - \space 00}% -\def\XINT@irr@divisionbyzero #1#2#3#4{\expandafter\xintError:DivisionByZero - \space {#2}0}% -\def\XINT@irr@zero #1#2#3#4{ 01}% -\def\XINT@irr@nonzero@checkifone #1% -{% - \ifcase\XINT@isOne {#1} - \xint@afterfi {\XINT@irr@loop@a {#1}}% - \or - \expandafter \XINT@irr@denomisone - \fi -}% -\def\XINT@irr@denomisone #1#2#3{ {#1}1}% +\def\XINT@irr@indeterminate #1#2#3#4#5% + {\expandafter\xintError:NaN\space 0/0}% +\def\XINT@irr@divisionbyzero #1#2#3#4#5% + {\expandafter\xintError:DivisionByZero #5#2/0}% +\def\XINT@irr@zero #1#2#3#4#5{ 0}% \def\XINT@irr@loop@a #1#2% {% \expandafter\XINT@irr@loop@d @@ -721,76 +640,64 @@ \def\xint@irr@loop@exit0\XINT@irr@loop@a #1#2#3#4% {% \expandafter\XINT@irr@loop@exitb\expandafter - {\romannumeral0\xintquo {#3}{#2}}% - {\romannumeral0\xintquo {#4}{#2}}% + {\romannumeral0\xintiquo {#3}{#2}}% + {\romannumeral0\xintiquo {#4}{#2}}% }% \def\XINT@irr@loop@exitb #1#2% {% - \expandafter\space\expandafter {#2}{#1}% + \expandafter\XINT@irr@finish\expandafter {#2}{#1}% }% -\def\xintJrr {\romannumeral0\xintjrr }% -\def\xintjrr +\def\XINT@irr@finish #1#2#3% {% - \expandafter\XINT@irr@putsign - \romannumeral0\expandafter\XINT@jrr - \romannumeral0\XINT@infrac -}% -\def\XINT@jrr #1% -{% - \ifcase\XINT@Sgn {#1} - \expandafter\XINT@jrr@B + \ifcase\XINT@isOne {#2} + \xint@afterfi {#3#1/#2}% \or - \expandafter\XINT@jrr@A - \else - \expandafter\XINT@jrr@B + \xint@afterfi {#3#1}% \fi - {#1}% }% -\def\XINT@jrr@A #1#2% +\def\xintNum {\romannumeral0\xintnum }% +\def\xintnum #1{\expandafter\XINT@intcheck\romannumeral0\xintirr {#1}/\W\Z }% +\def\XINT@intcheck #1/#2#3\Z {% - \expandafter \XINT@jrr@C - \romannumeral0\xint@dsh {#2}{-#1}\Z + \xint@w #2\xint@gobble@two\W\xintError:NotAnInteger + \space #1% }% -\def\XINT@jrr@B #1#2#3% +\def\xintJrr {\romannumeral0\xintjrr }% +\def\xintjrr #1% {% - \expandafter \XINT@jrr@BC \expandafter - {\romannumeral0\xint@dsh {#3}{#1}}{#2}% + \expandafter\XINT@jrr@start\romannumeral0\xintraw {#1}\Z }% -\def\XINT@jrr@BC #1#2{\XINT@jrr@C #2\Z {#1}}% -\def\XINT@jrr@C #1#2\Z +\def\XINT@jrr@start #1#2/#3\Z {% - \xint@UDsignfork - #1\dummy \XINT@jrr@negative - -\dummy {\XINT@jrr@nonneg #1}% - \xint@UDkrof - #2\Z + \ifcase\XINT@isOne {#3} + \xint@afterfi + {\xint@UDsignfork + #1\dummy \XINT@jrr@negative + -\dummy {\XINT@jrr@nonneg #1}% + \xint@UDkrof}% + \or + \xint@afterfi{\XINT@jrr@denomisone #1}% + \fi + #2\Z {#3}% }% -\def\XINT@jrr@negative #1\Z #2{\XINT@jrr@D #1\Z #2\Z \XINT@opp}% -\def\XINT@jrr@nonneg #1\Z #2{\XINT@jrr@D #1\Z #2\Z \space}% +\def\XINT@jrr@denomisone #1\Z #2{ #1}% +\def\XINT@jrr@negative #1\Z #2{\XINT@jrr@D #1\Z #2\Z \XINT@opp}% +\def\XINT@jrr@nonneg #1\Z #2{\XINT@jrr@D #1\Z #2\Z \space}% \def\XINT@jrr@D #1#2\Z #3#4\Z {% \xint@UDzerosfork #3#1\dummy \XINT@jrr@indeterminate #30\dummy \XINT@jrr@divisionbyzero #10\dummy \XINT@jrr@zero - 00\dummy \XINT@jrr@nonzero@checkifone + 00\dummy \XINT@jrr@loop@a \xint@UDkrof {#3#4}{#1#2}1001% }% -\def\XINT@jrr@indeterminate #1#2#3#4#5#6{\expandafter\xintError:ZeroOverZero - \space 00}% -\def\XINT@jrr@divisionbyzero #1#2#3#4#5#6{\expandafter\xintError:DivisionByZero - \space {#2}0}% -\def\XINT@jrr@zero #1#2#3#4#5#6{ 01}% -\def\XINT@jrr@nonzero@checkifone #1% -{% - \ifcase\XINT@isOne {#1} - \xint@afterfi {\XINT@jrr@loop@a {#1}}% - \or - \expandafter \XINT@jrr@denomisone - \fi -}% -\def\XINT@jrr@denomisone #1#2#3#4#5{ {#1}1}% +\def\XINT@jrr@indeterminate #1#2#3#4#5#6#7% + {\expandafter\xintError:NaN\space 0/0}% +\def\XINT@jrr@divisionbyzero #1#2#3#4#5#6#7% + {\expandafter\xintError:DivisionByZero #7#2/0}% +\def\XINT@jrr@zero #1#2#3#4#5#6#7{ 0}% \def\XINT@jrr@loop@a #1#2% {% \expandafter\XINT@jrr@loop@b @@ -805,8 +712,7 @@ }% \def\XINT@jrr@loop@c #1#2% {% - \expandafter \XINT@jrr@loop@d \expandafter - {#2}{#1}% + \expandafter \XINT@jrr@loop@d \expandafter{#2}{#1}% }% \def\XINT@jrr@loop@d #1#2#3#4% {% @@ -818,7 +724,7 @@ }% \def\xint@jrr@loop@exit0\XINT@jrr@loop@a #1#2#3#4#5#6% {% - \space {#3}{#4}% + \XINT@irr@finish {#3}{#4}% }% \def\xintTrunc {\romannumeral0\xinttrunc }% \def\xintiTrunc {\romannumeral0\xintitrunc }% @@ -851,7 +757,7 @@ \def\XINT@trunc@A #1#2#3#4% {% \expandafter\XINT@trunc@checkifzero - \expandafter{\the\numexpr #1+#4\relax}#2\Z {#3}% + \expandafter{\the\numexpr #1+#4}#2\Z {#3}% }% \def\XINT@trunc@checkifzero #1#2#3\Z {% @@ -890,10 +796,10 @@ \xint@UDkrof {#4}{#2}% }% -\def\XINT@trunc@minusminus #1#2{\xintquo {#1}{#2}\Z \space}% -\def\XINT@trunc@minusplus #1#2#3{\xintquo {#1#2}{#3}\Z \xint@minus@andstop}% -\def\XINT@trunc@plusminus #1#2#3{\xintquo {#2}{#1#3}\Z \xint@minus@andstop}% -\def\XINT@trunc@plusplus #1#2#3#4{\xintquo {#1#3}{#2#4}\Z \space}% +\def\XINT@trunc@minusminus #1#2{\xintiquo {#1}{#2}\Z \space}% +\def\XINT@trunc@minusplus #1#2#3{\xintiquo {#1#2}{#3}\Z \xint@minus@andstop}% +\def\XINT@trunc@plusminus #1#2#3{\xintiquo {#2}{#1#3}\Z \xint@minus@andstop}% +\def\XINT@trunc@plusplus #1#2#3#4{\xintiquo {#1#3}{#2#4}\Z \space}% \def\XINT@itrunc@G #1#2\Z #3#4% {% \xint@zero #1\XINT@trunc@zero 0\xint@firstoftwo {#3#1#2}0% @@ -902,7 +808,7 @@ {% \xint@zero #2\XINT@trunc@zero 0% \expandafter\XINT@trunc@H\expandafter - {\the\numexpr\romannumeral0\XINT@length {#1}-#3\relax}{#3}{#1}#2% + {\the\numexpr\romannumeral0\XINT@length {#1}-#3}{#3}{#1}#2% }% \def\XINT@trunc@zero 0#10{ 0}% \def\XINT@trunc@H #1#2% @@ -923,8 +829,8 @@ }% \def\XINT@trunc@Hb #1#2#3% {% - \expandafter #3\expandafter0\expandafter.% - \romannumeral0\XINT@dsx@zeroloop {#1}\Z {}#2% + \expandafter #3\expandafter0\expandafter.% + \romannumeral0\XINT@dsx@zeroloop {#1}\Z {}#2% }% \def\xintRound {\romannumeral0\xintround }% \def\xintiRound {\romannumeral0\xintiround }% @@ -996,6 +902,86 @@ {% \XINT@addm@A 0{}1000\W\X\Y\Z #1000\W\X\Y\Z \Z }% +\def\xintAdd {\romannumeral0\xintadd }% +\def\xintadd #1% +{% + \expandafter\xint@fadd\expandafter {\romannumeral0\XINT@infrac {#1}}% +}% +\def\xint@fadd #1#2{\expandafter\XINT@fadd@A\romannumeral0\XINT@infrac{#2}#1}% +\def\XINT@fadd@A #1#2#3#4% +{% + \ifnum #4 > #1 + \xint@afterfi {\XINT@fadd@B {#1}}% + \else + \xint@afterfi {\XINT@fadd@B {#4}}% + \fi + {#1}{#4}{#2}{#3}% +}% +\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}}}% + }% + {#1}% +}% +\def\XINT@fadd@C #1#2#3% +{% + \expandafter\XINT@fadd@D\expandafter {#2}{#3}{#1}% +}% +\def\XINT@fadd@D #1#2{\XINT@outfrac {#2}{#1}}% +\def\xintSub {\romannumeral0\xintsub }% +\def\xintsub #1% +{% + \expandafter\xint@fsub\expandafter {\romannumeral0\XINT@infrac {#1}}% +}% +\def\xint@fsub #1#2% + {\expandafter\XINT@fsub@A\romannumeral0\XINT@infrac {#2}#1}% +\def\XINT@fsub@A #1#2#3#4% +{% + \ifnum #4 > #1 + \xint@afterfi {\XINT@fsub@B {#1}}% + \else + \xint@afterfi {\XINT@fsub@B {#4}}% + \fi + {#1}{#4}{#2}{#3}% +}% +\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}}}% + }% + {#1}% +}% +\def\XINT@fsub@C #1#2#3% +{% + \expandafter\XINT@fsub@D\expandafter {#2}{#3}{#1}% +}% +\def\XINT@fsub@D #1#2{\XINT@outfrac {#2}{#1}}% +\def\xintSum {\romannumeral0\xintsum }% +\def\xintsum #1{\xintsumexpr #1\relax }% +\def\xintSumExpr {\romannumeral0\xintsumexpr }% +\def\xintsumexpr {\expandafter\expandafter\expandafter\XINT@fsumexpr }% +\def\XINT@fsumexpr {\XINT@fsum@loop@a {0[0]}}% +\def\XINT@fsum@loop@a #1#2% +{% + \expandafter\expandafter\expandafter\XINT@fsum@loop@b #2\Z {#1}% +}% +\def\XINT@fsum@loop@b #1% +{% + \xint@relax #1\XINT@fsum@finished\relax + \XINT@fsum@loop@c #1% +}% +\def\XINT@fsum@loop@c #1\Z #2% +{% + \expandafter\XINT@fsum@loop@a\expandafter{\romannumeral0\xintadd {#2}{#1}}% +}% +\def\XINT@fsum@finished #1\Z #2{ #2}% \def\xintMul {\romannumeral0\xintmul }% \def\xintmul #1% {% @@ -1029,8 +1015,7 @@ \def\xint@fpow #1#2% {% \expandafter\expandafter\expandafter - \XINT@fpow@fork - #2\Z #1% + \XINT@fpow@fork #2\Z #1% }% \def\XINT@fpow@fork #1#2\Z {% @@ -1064,6 +1049,25 @@ \expandafter\XINT@fpow@pos@B\expandafter {#3}{#1}{#2}% }% \def\XINT@fpow@pos@B #1#2{\XINT@outfrac {#2}{#1}}% +\def\xintPrd {\romannumeral0\xintprd }% +\def\xintprd #1{\xintproductexpr #1\relax }% +\def\xintProductExpr {\romannumeral0\xintproductexpr }% +\def\xintproductexpr{\expandafter\expandafter\expandafter\XINT@fproductexpr }% +\def\XINT@fproductexpr {\XINT@fprod@loop@a {1[0]}}% +\def\XINT@fprod@loop@a #1#2% +{% + \expandafter\expandafter\expandafter\XINT@fprod@loop@b #2\Z {#1}% +}% +\def\XINT@fprod@loop@b #1% +{% + \xint@relax #1\XINT@fprod@finished\relax + \XINT@fprod@loop@c #1% +}% +\def\XINT@fprod@loop@c #1\Z #2% +{% + \expandafter\XINT@fprod@loop@a\expandafter{\romannumeral0\xintmul {#1}{#2}}% +}% +\def\XINT@fprod@finished #1\Z #2{ #2}% \def\xintDiv {\romannumeral0\xintdiv }% \def\xintdiv #1% {% @@ -1084,68 +1088,6 @@ \expandafter{#3}{#1}{#2}% }% \def\XINT@fdiv@C #1#2{\XINT@outfrac {#2}{#1}}% -\def\xintAdd {\romannumeral0\xintadd }% -\def\xintadd #1% -{% - \expandafter\xint@fadd\expandafter {\romannumeral0\XINT@infrac {#1}}% -}% -\def\xint@fadd #1#2% -{\expandafter\XINT@fadd@A\romannumeral0\XINT@infrac{#2}#1}% -\def\XINT@fadd@A #1#2#3#4% -{% - \ifnum #4 > #1 - \xint@afterfi {\XINT@fadd@B {#1}}% - \else - \xint@afterfi {\XINT@fadd@B {#4}}% - \fi - {#1}{#4}{#2}{#3}% -}% -\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}}}% - }% - {#1}% -}% -\def\XINT@fadd@C #1#2#3% -{% - \expandafter\XINT@fadd@D\expandafter {#2}{#3}{#1}% -}% -\def\XINT@fadd@D #1#2{\XINT@outfrac {#2}{#1}}% -\def\xintSub {\romannumeral0\xintsub }% -\def\xintsub #1% -{% - \expandafter\xint@fsub\expandafter {\romannumeral0\XINT@infrac {#1}}% -}% -\def\xint@fsub #1#2% - {\expandafter\XINT@fsub@A\romannumeral0\XINT@infrac {#2}#1}% -\def\XINT@fsub@A #1#2#3#4% -{% - \ifnum #4 > #1 - \xint@afterfi {\XINT@fsub@B {#1}}% - \else - \xint@afterfi {\XINT@fsub@B {#4}}% - \fi - {#1}{#4}{#2}{#3}% -}% -\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}}}% - }% - {#1}% -}% -\def\XINT@fsub@C #1#2#3% -{% - \expandafter\XINT@fsub@D\expandafter {#2}{#3}{#1}% -}% -\def\XINT@fsub@D #1#2{\XINT@outfrac {#2}{#1}}% \def\xintCmp {\romannumeral0\xintcmp }% \def\xintcmp #1% {% @@ -1199,9 +1141,12 @@ {% \expandafter\xint@fmin\expandafter {\romannumeral0\XINT@infrac {#1}}% }% -\def\xint@fmin #1#2{\expandafter\XINT@outfrac - \romannumeral0\expandafter\XINT@fmin@A - \romannumeral0\XINT@infrac {#2}#1}% +\def\xint@fmin #1#2% +{% + \expandafter\XINT@outfrac + \romannumeral0\expandafter\XINT@fmin@A + \romannumeral0\XINT@infrac {#2}#1% +}% \def\XINT@fmin@A #1#2#3#4#5#6% {% \ifnum #4 > #1 @@ -1221,28 +1166,95 @@ {% \expandafter\XINT@min@fork #2\Z #1\Z }% +\def\xintAbs {\romannumeral0\xintabs }% +\def\xintabs #1% +{% + \expandafter\xint@fabs\romannumeral0\XINT@infrac {#1}% +}% +\def\xint@fabs #1#2% +{% + \expandafter\XINT@outfrac\expandafter + {\the\numexpr #1\expandafter}\expandafter + {\romannumeral0\XINT@abs #2}% +}% +\def\xintOpp {\romannumeral0\xintopp }% +\def\xintopp #1% +{% + \expandafter\xint@fopp\romannumeral0\XINT@infrac {#1}% +}% +\def\xint@fopp #1#2% +{% + \expandafter\XINT@outfrac\expandafter + {\the\numexpr #1\expandafter}\expandafter + {\romannumeral0\XINT@opp #2}% +}% \def\xintSgn {\romannumeral0\xintsgn }% \def\xintsgn #1% {% \expandafter\xint@fsgn\romannumeral0\XINT@infrac {#1}% }% \def\xint@fsgn #1#2#3{\xintisgn {#2}}% -\def\xintOpp {\romannumeral0\xintopp }% -\def\xintopp #1% +\def\xintGeq {\romannumeral0\xintgeq }% +\def\xintgeq #1% {% - \expandafter\xint@fopp\romannumeral0\XINT@infrac {#1}% + \expandafter\xint@xgeq\expandafter{\romannumeral0\xintnum {#1}}% }% -\def\xint@fopp #1#2{\expandafter\XINT@outfrac\expandafter - {\the\numexpr #1\expandafter}\expandafter - {\romannumeral0\XINT@opp #2}}% -\def\xintAbs {\romannumeral0\xintabs }% -\def\xintabs #1% +\def\xint@xgeq #1#2% {% - \expandafter\xint@fabs\romannumeral0\XINT@infrac {#1}% + \expandafter\XINT@geq@fork\romannumeral0\xintnum {#2}\Z #1\Z +}% +\def\xintDivision {\romannumeral0\xintdivision }% +\def\xintdivision #1% +{% + \expandafter\xint@xdivision\expandafter{\romannumeral0\xintnum {#1}}% +}% +\def\xint@xdivision #1#2% +{% + \expandafter\XINT@div@fork\romannumeral0\xintnum {#2}\Z #1\Z +}% +\def\xintQuo {\romannumeral0\xintquo }% +\def\xintRem {\romannumeral0\xintrem }% +\def\xintquo {\expandafter\xint@firstoftwo@andstop + \romannumeral0\xintdivision }% +\def\xintrem {\expandafter\xint@secondoftwo@andstop + \romannumeral0\xintdivision }% +\def\xintFDg {\romannumeral0\xintfdg }% +\def\xintfdg #1% +{% + \expandafter\XINT@fdg\romannumeral0\xintnum {#1}\W\Z +}% +\def\xintLDg {\romannumeral0\xintldg }% +\def\xintldg #1% +{% + \expandafter\XINT@ldg\expandafter{\romannumeral0\xintnum {#1}}% +}% +\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\xintOdd {\romannumeral0\xintodd }% +\def\xintodd #1% +{% + \ifodd\xintLDg{#1} + \xint@afterfi{ 1}% + \else + \xint@afterfi{ 0}% + \fi }% -\def\xint@fabs #1#2{\expandafter\XINT@outfrac\expandafter - {\the\numexpr #1\expandafter}\expandafter - {\romannumeral0\XINT@abs #2}}% \XINT@frac@restorecatcodes@endinput% \endinput %% diff --git a/Master/texmf-dist/tex/generic/xint/xintgcd.sty b/Master/texmf-dist/tex/generic/xint/xintgcd.sty index 14d36771ab4..1493d23a544 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.04 of April 25, 2013) +%% The xint bundle (version 1.05 of May 1st, 2013) %% xintgcd: Euclidean algorithm with xint package %% Copyright (C) 2013 by Jean-Francois Burnol %%---------------------------------------------------------------- @@ -133,7 +133,7 @@ \endlinechar=\the\endlinechar \catcode13=\the\catcode13 % ^^M \catcode32=\the\catcode32 % - \catcode61=\the\catcode61 % = + \catcode61=\the\catcode61\relax % = \noexpand\endinput }% \XINT@setcatcodes @@ -162,18 +162,15 @@ \fi \expandafter\x\csname ver@xintgcd.sty\endcsname \ProvidesPackage{xintgcd}% - [2013/04/25 v1.04 Euclide algorithm with xint package (jfB)]% + [2013/05/01 v1.05 Euclide algorithm with xint package (jfB)]% \def\xintGCD {\romannumeral0\xintgcd }% \def\xintgcd #1% {% - \expandafter \XINT@gcd \expandafter - {\romannumeral0\xintiabs {#1}}% + \expandafter\XINT@gcd\expandafter{\romannumeral0\xintiabs {#1}}% }% \def\XINT@gcd #1#2% {% - \expandafter - \XINT@gcd@fork - \romannumeral0\xintiabs {#2}\Z #1\Z + \expandafter\XINT@gcd@fork\romannumeral0\xintiabs {#2}\Z #1\Z }% \def\XINT@gcd@fork #1#2\Z #3#4\Z {% @@ -208,8 +205,8 @@ {#1}% }% \def\xint@bezout #1#2% -{\expandafter\expandafter\expandafter - \XINT@bezout@fork #2\Z #1\Z +{% + \expandafter\expandafter\expandafter\XINT@bezout@fork #2\Z #1\Z }% \def\XINT@bezout@fork #1#2\Z #3#4\Z {% @@ -253,14 +250,12 @@ }% \def\XINT@bezout@mm@post #1#2% {% - \expandafter \XINT@bezout@mm@postb \expandafter - {\romannumeral0\xintiopp{#2}}{\romannumeral0\xintiopp{#1}}% + \expandafter\XINT@bezout@mm@postb\expandafter + {\romannumeral0\xintiopp{#2}}{\romannumeral0\xintiopp{#1}}% }% \def\XINT@bezout@mm@postb #1#2% {% - \expandafter - \XINT@bezout@mm@postc - \expandafter {#2}{#1}% + \expandafter\XINT@bezout@mm@postc\expandafter {#2}{#1}% }% \def\XINT@bezout@mm@postc #1#2#3#4#5% {% @@ -273,7 +268,7 @@ }% \def\XINT@bezout@mp@post #1#2% {% - \expandafter \XINT@bezout@mp@postb \expandafter + \expandafter\XINT@bezout@mp@postb\expandafter {\romannumeral0\xintiopp {#2}}{#1}% }% \def\XINT@bezout@mp@postb #1#2#3#4#5% @@ -352,13 +347,11 @@ \def\xintEuclideAlgorithm {\romannumeral0\xinteuclidealgorithm }% \def\xinteuclidealgorithm #1% {% - \expandafter \XINT@euc \expandafter - {\romannumeral0\xintiabs {#1}}% + \expandafter \XINT@euc \expandafter{\romannumeral0\xintiabs {#1}}% }% \def\XINT@euc #1#2% {% - \expandafter - \XINT@euc@fork + \expandafter\XINT@euc@fork \romannumeral0\xintiabs {#2}\Z #1\Z }% \def\XINT@euc@fork #1#2\Z #3#4\Z @@ -374,8 +367,7 @@ \def\XINT@euc@BisZero #1#2#3#4#5#6{ {1}{0}{#3}{#3}{0}{0}}% \def\XINT@euc@a #1#2#3% {% - \expandafter - \XINT@euc@b + \expandafter\XINT@euc@b \expandafter {\the\numexpr #1+1\expandafter }% \romannumeral0\XINT@div@prepare {#2}{#3}{#2}% }% @@ -389,13 +381,13 @@ }% \def\xint@euc@end0\XINT@euc@a #1#2#3#4\Z% {% - \expandafter\xint@euc@end@ - \romannumeral0% - \XINT@rord@main {}#4{{#1}{#3}}% - \xint@UNDEF - \xint@undef\xint@undef\xint@undef\xint@undef - \xint@undef\xint@undef\xint@undef\xint@undef - \xint@UNDEF + \expandafter\xint@euc@end@ + \romannumeral0% + \XINT@rord@main {}#4{{#1}{#3}}% + \xint@UNDEF + \xint@undef\xint@undef\xint@undef\xint@undef + \xint@undef\xint@undef\xint@undef\xint@undef + \xint@UNDEF }% \def\xint@euc@end@ #1#2#3% {% @@ -404,13 +396,11 @@ \def\xintBezoutAlgorithm {\romannumeral0\xintbezoutalgorithm }% \def\xintbezoutalgorithm #1% {% - \expandafter \XINT@bezalg \expandafter - {\romannumeral0\xintiabs {#1}}% + \expandafter \XINT@bezalg \expandafter{\romannumeral0\xintiabs {#1}}% }% \def\XINT@bezalg #1#2% {% - \expandafter - \XINT@bezalg@fork + \expandafter\XINT@bezalg@fork \romannumeral0\xintiabs {#2}\Z #1\Z }% \def\XINT@bezalg@fork #1#2\Z #3#4\Z @@ -426,8 +416,7 @@ \def\XINT@bezalg@BisZero #1#2#3#4\Z{ {1}{0}{0}{1}{#3}{#3}{1}{0}{0}{0}{0}{1}}% \def\XINT@bezalg@a #1#2#3% {% - \expandafter - \XINT@bezalg@b + \expandafter\XINT@bezalg@b \expandafter {\the\numexpr #1+1\expandafter }% \romannumeral0\XINT@div@prepare {#2}{#3}{#2}% }% @@ -440,8 +429,7 @@ }% \def\XINT@bezalg@c #1#2#3#4#5#6% {% - \expandafter\XINT@bezalg@d\expandafter - {#2}{#3}{#4}{#5}{#6}{#1}% + \expandafter\XINT@bezalg@d\expandafter {#2}{#3}{#4}{#5}{#6}{#1}% }% \def\XINT@bezalg@d #1#2#3#4#5#6#7#8% {% @@ -453,13 +441,13 @@ }% \def\xint@bezalg@end0\XINT@bezalg@a #1#2#3#4#5#6#7#8\Z {% - \expandafter\xint@bezalg@end@ - \romannumeral0% - \XINT@rord@main {}#8{{#1}{#3}}% - \xint@UNDEF - \xint@undef\xint@undef\xint@undef\xint@undef - \xint@undef\xint@undef\xint@undef\xint@undef - \xint@UNDEF + \expandafter\xint@bezalg@end@ + \romannumeral0% + \XINT@rord@main {}#8{{#1}{#3}}% + \xint@UNDEF + \xint@undef\xint@undef\xint@undef\xint@undef + \xint@undef\xint@undef\xint@undef\xint@undef + \xint@UNDEF }% \def\xint@bezalg@end@ #1#2#3#4% {% @@ -517,7 +505,7 @@ \edef\U{\BEZ{\the\numexpr 4*\N + 4\relax}}% \edef\V{\BEZ{\the\numexpr 4*\N + 3\relax}}% \edef\D{\BEZ5}% - \ifodd\N\relax + \ifodd\N $\U\times\A - \V\times \B = -\D$% \else $\U\times\A - \V\times\B = \D$% diff --git a/Master/texmf-dist/tex/generic/xint/xintseries.sty b/Master/texmf-dist/tex/generic/xint/xintseries.sty index 0412e9e17ef..600d3c311ac 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.04 of April 25, 2013) +%% The xint bundle (version 1.05 of May 1st, 2013) %% xintseries: Expandable partial sums with xint package %% Copyright (C) 2013 by Jean-Francois Burnol %%---------------------------------------------------------------- @@ -134,7 +134,7 @@ \endlinechar=\the\endlinechar \catcode13=\the\catcode13 % ^^M \catcode32=\the\catcode32 % - \catcode61=\the\catcode61 % = + \catcode61=\the\catcode61\relax % = \noexpand\endinput }% \XINT@setcatcodes @@ -162,7 +162,7 @@ \fi \expandafter\x\csname ver@xintseries.sty\endcsname \ProvidesPackage{xintseries}% - [2013/04/25 v1.04 Expandable partial sums with xint package (jfB)]% + [2013/05/01 v1.05 Expandable partial sums with xint package (jfB)]% \def\xintSeries {\romannumeral0\xintseries }% \def\xintseries #1#2% {% @@ -430,11 +430,13 @@ {\romannumeral0\xintiadd {#4}{\xintiTrunc {#7}{\xintMul {#6{#2}}{#1}}}}% {#1}{#3}{#5}{#6}{#7}% }% -\def\XINT@fppowseries@exit@i\fi \expandafter\XINT@fppowseries@loop@ii - {\fi \expandafter\XINT@fppowseries@exit@ii }% +\def\XINT@fppowseries@exit@i\fi\expandafter\XINT@fppowseries@loop@ii + {\fi \expandafter\XINT@fppowseries@exit@ii }% \def\XINT@fppowseries@exit@ii #1#2#3#4#5#6#7% - {\xinttrunc {#7}% - {\xintiAdd {#4}{\xintiTrunc {#7}{\xintMul {#6{#2}}{#1}}}[-#7]}}% +{% + \xinttrunc {#7} + {\xintiAdd {#4}{\xintiTrunc {#7}{\xintMul {#6{#2}}{#1}}}[-#7]}% +}% \def\xintFxPtPowerSeriesX {\romannumeral0\xintfxptpowerseriesx }% \def\xintfxptpowerseriesx #1#2% {% |