diff options
author | Karl Berry <karl@freefriends.org> | 2013-04-09 16:53:37 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-04-09 16:53:37 +0000 |
commit | 0bfe4454a9f89f6756bf6f5166c38d8340c6c116 (patch) | |
tree | d6b3f9bcd6d0df8f7de5aac223e0116987bc6b43 /Master/texmf-dist/tex/generic/xint | |
parent | 964fe8bfda14525be1aff1468c6a487a899b343b (diff) |
xint (8apr13)
git-svn-id: svn://tug.org/texlive/trunk@29793 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 | 624 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/xint/xintgcd.sty | 4 |
2 files changed, 360 insertions, 268 deletions
diff --git a/Master/texmf-dist/tex/generic/xint/xint.sty b/Master/texmf-dist/tex/generic/xint/xint.sty index 44e71fb4383..b8489389530 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.) %% %%---------------------------------------------------------------- -%% Part of the xint bundle (version 1.01 of 2013/04/04) +%% The xint bundle (version 1.02 of April 5, 2013) %% xint: Expandable operations on long numbers %% Copyright (C) 2013 by Jean-Francois Burnol %%---------------------------------------------------------------- @@ -134,7 +134,7 @@ \fi \expandafter\x\csname ver@xint.sty\endcsname \ProvidesPackage{xint}% - [2013/04/04 v1.01 Expandable operations on long numbers (jfB)]% + [2013/04/05 v1.02 Expandable operations on long numbers (jfB)]% \def\xint@gobble #1{}% \def\xint@gobble@one #1{}% \def\xint@gobble@two #1#2{}% @@ -1716,13 +1716,12 @@ \def\XINT@pprod@checkifempty #1% {% \xint@relax #1\XINT@pprod@emptyproduct\relax - \XINT@pprod@RQfirst #1% + \XINT@pprod@first #1% }% \def\XINT@pprod@emptyproduct #1\Z { 1}% -\def\XINT@pprod@RQfirst #1\Z +\def\XINT@pprod@first #1\Z {% - \expandafter\XINT@pprod@getnext\expandafter - {\romannumeral0\XINT@RQ {}#1\R\R\R\R\R\R\R\R\Z}% + \XINT@pprod@getnext {#1}% }% \def\XINT@pprod@getnext #1#2% {% @@ -1731,21 +1730,22 @@ \def\XINT@pprod@checkiffinished #1% {% \xint@relax #1\XINT@pprod@end\relax - \XINT@pprod@compute #1% + \XINT@pprod@RQnew #1% }% -\def\XINT@pprod@compute #1\Z #2% +\def\XINT@pprod@RQnew #1\Z {% + \expandafter\XINT@pprod@compute \expandafter - \XINT@pprod@getnext - \expandafter - {\romannumeral0\XINT@prod@mul@enter #2\W\X\Y\Z #1\W\X\Y\Z}% + {\romannumeral0\XINT@RQ {}#1\R\R\R\R\R\R\R\R\Z }% }% -\def\XINT@pprod@end\relax\XINT@pprod@compute #1\Z #2% +\def\XINT@pprod@compute #1#2% {% \expandafter - \xint@cleanupzeros@andstop - \romannumeral0\XINT@rev {#2}% + \XINT@pprod@getnext + \expandafter + {\romannumeral0\XINT@mul@enter #1\W\X\Y\Z #2\W\X\Y\Z }% }% +\def\XINT@pprod@end\relax\XINT@pprod@RQnew #1\Z #2{ #2}% \def\xintProductExpr {\romannumeral0\xintproductexpr }% \def\xintPrd {\romannumeral0\xintprd }% \def\xintprd #1% @@ -1776,13 +1776,11 @@ \def\XINT@prod@returnzero #1\relax { 0}% \def\XINT@prod@firstisneg #1#2\Z {% - \expandafter\XINT@prod@xpxpnext\expandafter - 0\expandafter{\romannumeral0\XINT@RQ {}#2\R\R\R\R\R\R\R\R\Z}% + \XINT@prod@xpxpnext 0{#2}% }% \def\XINT@prod@firstispos #1\Z {% - \expandafter\XINT@prod@xpxpnext\expandafter - 1\expandafter{\romannumeral0\XINT@RQ {}#1\R\R\R\R\R\R\R\R\Z }% + \XINT@prod@xpxpnext 1{#1}% }% \def\XINT@prod@xpxpnext #1#2#3% {% @@ -1798,262 +1796,51 @@ {% \xint@zero #1\XINT@prod@returnzero0% \xint@UDsignfork - #1\dummy \XINT@prod@neg - -\dummy \XINT@prod@pos + #1\dummy \XINT@prod@neg@RQnew + -\dummy \XINT@prod@pos@RQnew \xint@UDkrof #1% }% -\def\XINT@prod@pos #1\Z #2#3% +\def\XINT@prod@pos@RQnew #1\Z +{% + \expandafter + \XINT@prod@pos + \expandafter + {\romannumeral0\XINT@RQ {}#1\R\R\R\R\R\R\R\R\Z }% +}% +\def\XINT@prod@pos #1#2#3% {% \expandafter \XINT@prod@xpxpnext \expandafter #3% \expandafter - {\romannumeral0\XINT@prod@mul@enter #2\W\X\Y\Z #1\W\X\Y\Z }% + {\romannumeral0\XINT@mul@enter #1\W\X\Y\Z #2\W\X\Y\Z }% +}% +\def\XINT@prod@neg@RQnew #1#2\Z +{% + \expandafter + \XINT@prod@neg + \expandafter + {\romannumeral0\XINT@RQ {}#2\R\R\R\R\R\R\R\R\Z }% }% -\def\XINT@prod@neg #1#2\Z #3#4% +\def\XINT@prod@neg #1#2#3% {% \expandafter \XINT@prod@xpxpnext \expandafter - {\the\numexpr 1-#4\expandafter}% + {\the\numexpr 1-#3\expandafter}% \expandafter - {\romannumeral0\XINT@prod@mul@enter #3\W\X\Y\Z #2\W\X\Y\Z }% + {\romannumeral0\XINT@mul@enter #1\W\X\Y\Z #2\W\X\Y\Z }% }% \def\XINT@prod@end\relax\XINT@prod@checksign #1\Z #2#3% {% - \expandafter - \xint@prod@cleanupzeros - \romannumeral0\XINT@rev {#2#3}% + \xint@prod@cleanupzeros #3#2% }% \def\xint@prod@cleanupzeros #1#2#3#4#5% {% \expandafter\space\the\numexpr (2*#1-1)*#2#3#4#5\relax }% -\def\XINT@prod@add@A #1#2#3#4#5#6% -{% - \xint@w - #3\xint@prod@add@az - \W\XINT@prod@add@AB #1{#3#4#5#6}{#2}% -}% -\def\xint@prod@add@az\W\XINT@prod@add@AB #1#2% -{% - \XINT@prod@add@AC@checkcarry #1% -}% -\def\XINT@prod@add@AC@checkcarry #1% -{% - \xint@zero #1\xint@prod@add@AC@nocarry 0\XINT@prod@add@C -}% -\def\xint@prod@add@AC@nocarry 0\XINT@prod@add@C -{% - \XINT@prod@add@F -}% -\def\XINT@prod@add@AB #1#2#3#4\W\X\Y\Z #5#6#7#8% -{% - \XINT@prod@add@ABE #1#2{#8#7#6#5}{#3}#4\W\X\Y\Z -}% -\def\XINT@prod@add@ABE #1#2#3#4#5#6% -{\expandafter - \XINT@prod@add@ABEA\the\numexpr #1+10#5#4#3#2+#6\relax -}% -\def\XINT@prod@add@ABEA #1#2#3#4#5#6#7% -{% - \XINT@prod@add@A #2{#7#6#5#4#3}%<-- attention on met donc \`a droite -}% -\def\XINT@prod@add@C #1#2#3#4#5% -{% - \xint@w - #5\xint@prod@add@cw - #4\xint@prod@add@cx - #3\xint@prod@add@cy - #2\xint@prod@add@cz - \W\XINT@prod@add@CD {#5#4#3#2}{#1}% -}% -\def\XINT@prod@add@CD #1% -{\expandafter - \XINT@prod@add@CC\the\numexpr 1+10#1\relax -}% -\def\XINT@prod@add@CC #1#2#3#4#5#6#7% -{% - \XINT@prod@add@AC@checkcarry #2{#7#6#5#4#3}% -}% -\def\xint@prod@add@cw - #1\xint@prod@add@cx - #2\xint@prod@add@cy - #3\xint@prod@add@cz - \W\XINT@prod@add@CD -{\expandafter - \XINT@prod@add@CDw\the\numexpr 1+10#1#2#3\relax -}% -\def\XINT@prod@add@CDw #1#2#3#4#5#6% -{% - \xint@quatrezeros #2#3#4#5\XINT@prod@add@endDw@zeros - 0000\XINT@prod@add@endDw #2#3#4#5% -}% -\def\XINT@prod@add@endDw@zeros 0000\XINT@prod@add@endDw 0000#1\X\Y\Z{ #1}% -\def\XINT@prod@add@endDw #1#2#3#4#5\X\Y\Z{ #5#4#3#2#1}% -\def\xint@prod@add@cx - #1\xint@prod@add@cy - #2\xint@prod@add@cz - \W\XINT@prod@add@CD -{\expandafter - \XINT@prod@add@CDx\the\numexpr 1+100#1#2\relax -}% -\def\XINT@prod@add@CDx #1#2#3#4#5#6% -{% - \xint@quatrezeros #2#3#4#5\XINT@prod@add@endDx@zeros - 0000\XINT@prod@add@endDx #2#3#4#5% -}% -\def\XINT@prod@add@endDx@zeros 0000\XINT@prod@add@endDx 0000#1\Y\Z{ #1}% -\def\XINT@prod@add@endDx #1#2#3#4#5\Y\Z{ #5#4#3#2#1}% -\def\xint@prod@add@cy - #1\xint@prod@add@cz - \W\XINT@prod@add@CD -{\expandafter - \XINT@prod@add@CDy\the\numexpr 1+1000#1\relax -}% -\def\XINT@prod@add@CDy #1#2#3#4#5#6% -{% - \xint@quatrezeros #2#3#4#5\XINT@prod@add@endDy@zeros - 0000\XINT@prod@add@endDy #2#3#4#5% -}% -\def\XINT@prod@add@endDy@zeros 0000\XINT@prod@add@endDy 0000#1\Z{ #1}% -\def\XINT@prod@add@endDy #1#2#3#4#5\Z{ #5#4#3#2#1}% -\def\xint@prod@add@cz\W\XINT@prod@add@CD #1#2{ #21000}% -\def\XINT@prod@add@F #1#2#3#4#5% -{% - \xint@w - #5\xint@prod@add@Gw - #4\xint@prod@add@Gx - #3\xint@prod@add@Gy - #2\xint@prod@add@Gz - \W\XINT@prod@add@G {#2#3#4#5}{#1}% -}% -\def\XINT@prod@add@G #1#2% -{% - \XINT@prod@add@F {#2#1}% -}% -\def\xint@prod@add@Gw - #1\xint@prod@add@Gx - #2\xint@prod@add@Gy - #3\xint@prod@add@Gz - \W\XINT@prod@add@G #4% -{% - \xint@quatrezeros #3#2#10\XINT@prod@add@endGw@zeros - 0000\XINT@prod@add@endGw #3#2#10% -}% -\def\XINT@prod@add@endGw@zeros 0000\XINT@prod@add@endGw 0000#1\X\Y\Z{ #1}% -\def\XINT@prod@add@endGw #1#2#3#4#5\X\Y\Z{ #5#1#2#3#4}% -\def\xint@prod@add@Gx - #1\xint@prod@add@Gy - #2\xint@prod@add@Gz - \W\XINT@prod@add@G #3% -{% - \xint@quatrezeros #2#100\XINT@prod@add@endGx@zeros - 0000\XINT@prod@add@endGx #2#100% -}% -\def\XINT@prod@add@endGx@zeros 0000\XINT@prod@add@endGx 0000#1\Y\Z{ #1}% -\def\XINT@prod@add@endGx #1#2#3#4#5\Y\Z{ #5#1#2#3#4}% -\def\xint@prod@add@Gy - #1\xint@prod@add@Gz - \W\XINT@prod@add@G #2% -{% - \xint@quatrezeros #1000\XINT@prod@add@endGy@zeros - 0000\XINT@prod@add@endGy #1000% -}% -\def\XINT@prod@add@endGy@zeros 0000\XINT@prod@add@endGy 0000#1\Z{ #1}% -\def\XINT@prod@add@endGy #1#2#3#4#5\Z{ #5#1#2#3#4}% -\def\xint@prod@add@Gz\W\XINT@prod@add@G #1#2{ #2}% -\def\XINT@prod@mul@enter #1\W\X\Y\Z #2#3#4#5% -{% - \xint@w - #5\xint@prod@mul@enterw - #4\xint@prod@mul@enterx - #3\xint@prod@mul@entery - #2\xint@prod@mul@enterz - \W\XINT@prod@mul@start {#2#3#4#5}#1\W\X\Y\Z -}% -\def\xint@prod@mul@enterw - #1\xint@prod@mul@enterx - #2\xint@prod@mul@entery - #3\xint@prod@mul@enterz - \W\XINT@prod@mul@start #4#5\W\X\Y\Z \X\Y\Z -{% - \XINT@mul@Mr {#3#2#1}#5\Z\Z\Z\Z -}% -\def\xint@prod@mul@enterx - #1\xint@prod@mul@entery - #2\xint@prod@mul@enterz - \W\XINT@prod@mul@start #3#4\W\X\Y\Z \Y\Z -{% - \XINT@mul@Mr {#2#1}#4\Z\Z\Z\Z -}% -\def\xint@prod@mul@entery - #1\xint@prod@mul@enterz - \W\XINT@prod@mul@start #2#3\W\X\Y\Z \Z -{% - \XINT@mul@Mr {#1}#3\Z\Z\Z\Z -}% -\def\XINT@prod@mul@start #1#2\W\X\Y\Z -{\expandafter - \XINT@prod@mul@main \expandafter - {\romannumeral0% - \XINT@mul@Mr {#1}#2\Z\Z\Z\Z - }#2\W\X\Y\Z -}% -\def\XINT@prod@mul@main #1#2\W\X\Y\Z #3#4#5#6% -{% - \xint@w - #6\xint@prod@mul@mainw - #5\xint@prod@mul@mainx - #4\xint@prod@mul@mainy - #3\xint@prod@mul@mainz - \W\XINT@prod@mul@compute {#1}{#3#4#5#6}#2\W\X\Y\Z -}% -\def\XINT@prod@mul@compute #1#2#3\W\X\Y\Z -{\expandafter - \XINT@prod@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@prod@mul@mainw - #1\xint@prod@mul@mainx - #2\xint@prod@mul@mainy - #3\xint@prod@mul@mainz - \W\XINT@prod@mul@compute #4#5#6\W\X\Y\Z \X\Y\Z -{% - \expandafter - \XINT@prod@add@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 -}% -\def\xint@prod@mul@mainx - #1\xint@prod@mul@mainy - #2\xint@prod@mul@mainz - \W\XINT@prod@mul@compute #3#4#5\W\X\Y\Z \Y\Z -{% - \expandafter - \XINT@prod@add@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 -}% -\def\xint@prod@mul@mainy - #1\xint@prod@mul@mainz - \W\XINT@prod@mul@compute #2#3#4\W\X\Y\Z \Z -{% - \expandafter - \XINT@prod@add@A \expandafter0\expandafter{\expandafter}% - \romannumeral0% - \XINT@mul@Mr {#1}#4\Z\Z\Z\Z - \W\X\Y\Z 0#2\W\X\Y\Z -}% -\def\xint@prod@mul@mainz\W\XINT@prod@mul@compute #1#2#3\W\X\Y\Z -{ #1}% \def\xintFac {\romannumeral0\xintfac }% \def\xintfac #1% {% @@ -2077,19 +1864,44 @@ }% \def\XINT@fac@checklength #1% {% - \ifnum\xintLen {#1} > 9 - \xint@afterfi{\xintError:FactorialOfTooBigNumber - \expandafter\space\expandafter 1\xint@gobble@three }% + \ifnum \XINT@Length {#1}> 9 + \xint@afterfi{\xintError:FactorialOfTooBigNumber + \expandafter\space\expandafter 1\xint@gobble }% \else - \expandafter\XINT@fac@loop + \xint@afterfi{\ifnum #1>9999 + \expandafter\XINT@fac@big@loop + \else + \expandafter\XINT@fac@loop + \fi }% \fi - {1}{#1}{}% + {#1}% }% -\def\XINT@fac@loop #1#2#3% +\def\XINT@fac@big@loop #1{\XINT@fac@big@loop@main {10000}{#1}{}}% +\def\XINT@fac@big@loop@main #1#2#3% {% \ifnum #1<#2 \expandafter - \XINT@fac@loop + \XINT@fac@big@loop@main + \expandafter + {\the\numexpr #1+1\expandafter }% + \else + \expandafter\XINT@fac@big@docomputation + \fi + {#2}{#3{#1}}% +}% +\def\XINT@fac@big@docomputation #1#2% +{% + \expandafter + \XINT@pprod@getnext + \expandafter + {\romannumeral0\XINT@fac@loop {9999}}#2\relax +}% +\def\XINT@fac@loop #1{\XINT@fac@loop@main 1{#1}{}}% +\def\XINT@fac@loop@main #1#2#3% +{% + \ifnum #1<#2 + \expandafter + \XINT@fac@loop@main \expandafter {\the\numexpr #1+1\expandafter }% \else @@ -2099,7 +1911,29 @@ }% \def\XINT@fac@docomputation #1#2% {% - \XINT@posprod #2\relax + \XINT@fprod@getnext {1000}#2\relax +}% +\def\XINT@fprod@getnext #1#2% +{% + \XINT@fprod@checkiffinished #2\Z {#1}% +}% +\def\XINT@fprod@checkiffinished #1% +{% + \xint@relax #1\XINT@fprod@end\relax + \XINT@fprod@compute #1% +}% +\def\XINT@fprod@compute #1\Z #2% +{% + \expandafter + \XINT@fprod@getnext + \expandafter + {\romannumeral0\XINT@mul@Mr {#1}#2\Z\Z\Z\Z }% +}% +\def\XINT@fprod@end\relax\XINT@fprod@compute #1\Z #2% +{% + \expandafter + \xint@cleanupzeros@andstop + \romannumeral0\XINT@rev {#2}% }% \def\xintPow {\romannumeral0\xintpow }% \def\xintpow #1% @@ -2183,7 +2017,7 @@ \else \expandafter\XINT@pow@loop \fi - {#1}{#2}\XINT@posprod + {#1}{#2}\XINT@pow@posprod \xint@UNDEF \xint@undef\xint@undef\xint@undef\xint@undef \xint@undef\xint@undef\xint@undef\xint@undef @@ -2197,10 +2031,8 @@ \expandafter\XINT@pow@loop@end \else \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{\the\numexpr 2*(#1/2)-#1\expandafter }% b mod 2 + \expandafter{\the\numexpr #1-#1/2\expandafter }% [b/2] \expandafter{\romannumeral0\xintsqr{#2}}}% \fi {{#2}}% @@ -2218,6 +2050,266 @@ {% \XINT@pow@loop {#1}{#2}% }% +\def\XINT@pow@posprod #1% +{% + \XINT@pow@pprod@checkifempty #1\Z +}% +\def\XINT@pow@pprod@checkifempty #1% +{% + \xint@relax #1\XINT@pow@pprod@emptyproduct\relax + \XINT@pow@pprod@RQfirst #1% +}% +\def\XINT@pow@pprod@emptyproduct #1\Z { 1}% +\def\XINT@pow@pprod@RQfirst #1\Z +{% + \expandafter\XINT@pow@pprod@getnext\expandafter + {\romannumeral0\XINT@RQ {}#1\R\R\R\R\R\R\R\R\Z}% +}% +\def\XINT@pow@pprod@getnext #1#2% +{% + \XINT@pow@pprod@checkiffinished #2\Z {#1}% +}% +\def\XINT@pow@pprod@checkiffinished #1% +{% + \xint@relax #1\XINT@pow@pprod@end\relax + \XINT@pow@pprod@compute #1% +}% +\def\XINT@pow@pprod@compute #1\Z #2% +{% + \expandafter + \XINT@pow@pprod@getnext + \expandafter + {\romannumeral0\XINT@pow@mul@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 + \romannumeral0\XINT@rev {#2}% +}% +\def\XINT@pow@mul@enter #1\W\X\Y\Z #2#3#4#5% +{% + \xint@w + #5\xint@pow@mul@enterw + #4\xint@pow@mul@enterx + #3\xint@pow@mul@entery + #2\xint@pow@mul@enterz + \W\XINT@pow@mul@start {#2#3#4#5}#1\W\X\Y\Z +}% +\def\xint@pow@mul@enterw + #1\xint@pow@mul@enterx + #2\xint@pow@mul@entery + #3\xint@pow@mul@enterz + \W\XINT@pow@mul@start #4#5\W\X\Y\Z \X\Y\Z +{% + \XINT@mul@Mr {#3#2#1}#5\Z\Z\Z\Z +}% +\def\xint@pow@mul@enterx + #1\xint@pow@mul@entery + #2\xint@pow@mul@enterz + \W\XINT@pow@mul@start #3#4\W\X\Y\Z \Y\Z +{% + \XINT@mul@Mr {#2#1}#4\Z\Z\Z\Z +}% +\def\xint@pow@mul@entery + #1\xint@pow@mul@enterz + \W\XINT@pow@mul@start #2#3\W\X\Y\Z \Z +{% + \XINT@mul@Mr {#1}#3\Z\Z\Z\Z +}% +\def\XINT@pow@mul@start #1#2\W\X\Y\Z +{\expandafter + \XINT@pow@mul@main \expandafter + {\romannumeral0% + \XINT@mul@Mr {#1}#2\Z\Z\Z\Z + }#2\W\X\Y\Z +}% +\def\XINT@pow@mul@main #1#2\W\X\Y\Z #3#4#5#6% +{% + \xint@w + #6\xint@pow@mul@mainw + #5\xint@pow@mul@mainx + #4\xint@pow@mul@mainy + #3\xint@pow@mul@mainz + \W\XINT@pow@mul@compute {#1}{#3#4#5#6}#2\W\X\Y\Z +}% +\def\XINT@pow@mul@compute #1#2#3\W\X\Y\Z +{\expandafter + \XINT@pow@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@pow@mul@mainw + #1\xint@pow@mul@mainx + #2\xint@pow@mul@mainy + #3\xint@pow@mul@mainz + \W\XINT@pow@mul@compute #4#5#6\W\X\Y\Z \X\Y\Z +{% + \expandafter + \XINT@pow@add@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 +}% +\def\xint@pow@mul@mainx + #1\xint@pow@mul@mainy + #2\xint@pow@mul@mainz + \W\XINT@pow@mul@compute #3#4#5\W\X\Y\Z \Y\Z +{% + \expandafter + \XINT@pow@add@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 +}% +\def\xint@pow@mul@mainy + #1\xint@pow@mul@mainz + \W\XINT@pow@mul@compute #2#3#4\W\X\Y\Z \Z +{% + \expandafter + \XINT@pow@add@A \expandafter0\expandafter{\expandafter}% + \romannumeral0% + \XINT@mul@Mr {#1}#4\Z\Z\Z\Z + \W\X\Y\Z 0#2\W\X\Y\Z +}% +\def\xint@pow@mul@mainz\W\XINT@pow@mul@compute #1#2#3\W\X\Y\Z +{ #1}% +\def\XINT@pow@add@A #1#2#3#4#5#6% +{% + \xint@w + #3\xint@pow@add@az + \W\XINT@pow@add@AB #1{#3#4#5#6}{#2}% +}% +\def\xint@pow@add@az\W\XINT@pow@add@AB #1#2% +{% + \XINT@pow@add@AC@checkcarry #1% +}% +\def\XINT@pow@add@AC@checkcarry #1% +{% + \xint@zero #1\xint@pow@add@AC@nocarry 0\XINT@pow@add@C +}% +\def\xint@pow@add@AC@nocarry 0\XINT@pow@add@C +{% + \XINT@pow@add@F +}% +\def\XINT@pow@add@AB #1#2#3#4\W\X\Y\Z #5#6#7#8% +{% + \XINT@pow@add@ABE #1#2{#8#7#6#5}{#3}#4\W\X\Y\Z +}% +\def\XINT@pow@add@ABE #1#2#3#4#5#6% +{\expandafter + \XINT@pow@add@ABEA\the\numexpr #1+10#5#4#3#2+#6\relax +}% +\def\XINT@pow@add@ABEA #1#2#3#4#5#6#7% +{% + \XINT@pow@add@A #2{#7#6#5#4#3}%<-- attention on met donc \`a droite +}% +\def\XINT@pow@add@C #1#2#3#4#5% +{% + \xint@w + #5\xint@pow@add@cw + #4\xint@pow@add@cx + #3\xint@pow@add@cy + #2\xint@pow@add@cz + \W\XINT@pow@add@CD {#5#4#3#2}{#1}% +}% +\def\XINT@pow@add@CD #1% +{\expandafter + \XINT@pow@add@CC\the\numexpr 1+10#1\relax +}% +\def\XINT@pow@add@CC #1#2#3#4#5#6#7% +{% + \XINT@pow@add@AC@checkcarry #2{#7#6#5#4#3}% +}% +\def\xint@pow@add@cw + #1\xint@pow@add@cx + #2\xint@pow@add@cy + #3\xint@pow@add@cz + \W\XINT@pow@add@CD +{\expandafter + \XINT@pow@add@CDw\the\numexpr 1+10#1#2#3\relax +}% +\def\XINT@pow@add@CDw #1#2#3#4#5#6% +{% + \xint@quatrezeros #2#3#4#5\XINT@pow@add@endDw@zeros + 0000\XINT@pow@add@endDw #2#3#4#5% +}% +\def\XINT@pow@add@endDw@zeros 0000\XINT@pow@add@endDw 0000#1\X\Y\Z{ #1}% +\def\XINT@pow@add@endDw #1#2#3#4#5\X\Y\Z{ #5#4#3#2#1}% +\def\xint@pow@add@cx + #1\xint@pow@add@cy + #2\xint@pow@add@cz + \W\XINT@pow@add@CD +{\expandafter + \XINT@pow@add@CDx\the\numexpr 1+100#1#2\relax +}% +\def\XINT@pow@add@CDx #1#2#3#4#5#6% +{% + \xint@quatrezeros #2#3#4#5\XINT@pow@add@endDx@zeros + 0000\XINT@pow@add@endDx #2#3#4#5% +}% +\def\XINT@pow@add@endDx@zeros 0000\XINT@pow@add@endDx 0000#1\Y\Z{ #1}% +\def\XINT@pow@add@endDx #1#2#3#4#5\Y\Z{ #5#4#3#2#1}% +\def\xint@pow@add@cy + #1\xint@pow@add@cz + \W\XINT@pow@add@CD +{\expandafter + \XINT@pow@add@CDy\the\numexpr 1+1000#1\relax +}% +\def\XINT@pow@add@CDy #1#2#3#4#5#6% +{% + \xint@quatrezeros #2#3#4#5\XINT@pow@add@endDy@zeros + 0000\XINT@pow@add@endDy #2#3#4#5% +}% +\def\XINT@pow@add@endDy@zeros 0000\XINT@pow@add@endDy 0000#1\Z{ #1}% +\def\XINT@pow@add@endDy #1#2#3#4#5\Z{ #5#4#3#2#1}% +\def\xint@pow@add@cz\W\XINT@pow@add@CD #1#2{ #21000}% +\def\XINT@pow@add@F #1#2#3#4#5% +{% + \xint@w + #5\xint@pow@add@Gw + #4\xint@pow@add@Gx + #3\xint@pow@add@Gy + #2\xint@pow@add@Gz + \W\XINT@pow@add@G {#2#3#4#5}{#1}% +}% +\def\XINT@pow@add@G #1#2% +{% + \XINT@pow@add@F {#2#1}% +}% +\def\xint@pow@add@Gw + #1\xint@pow@add@Gx + #2\xint@pow@add@Gy + #3\xint@pow@add@Gz + \W\XINT@pow@add@G #4% +{% + \xint@quatrezeros #3#2#10\XINT@pow@add@endGw@zeros + 0000\XINT@pow@add@endGw #3#2#10% +}% +\def\XINT@pow@add@endGw@zeros 0000\XINT@pow@add@endGw 0000#1\X\Y\Z{ #1}% +\def\XINT@pow@add@endGw #1#2#3#4#5\X\Y\Z{ #5#1#2#3#4}% +\def\xint@pow@add@Gx + #1\xint@pow@add@Gy + #2\xint@pow@add@Gz + \W\XINT@pow@add@G #3% +{% + \xint@quatrezeros #2#100\XINT@pow@add@endGx@zeros + 0000\XINT@pow@add@endGx #2#100% +}% +\def\XINT@pow@add@endGx@zeros 0000\XINT@pow@add@endGx 0000#1\Y\Z{ #1}% +\def\XINT@pow@add@endGx #1#2#3#4#5\Y\Z{ #5#1#2#3#4}% +\def\xint@pow@add@Gy + #1\xint@pow@add@Gz + \W\XINT@pow@add@G #2% +{% + \xint@quatrezeros #1000\XINT@pow@add@endGy@zeros + 0000\XINT@pow@add@endGy #1000% +}% +\def\XINT@pow@add@endGy@zeros 0000\XINT@pow@add@endGy 0000#1\Z{ #1}% +\def\XINT@pow@add@endGy #1#2#3#4#5\Z{ #5#1#2#3#4}% +\def\xint@pow@add@Gz\W\XINT@pow@add@G #1#2{ #2}% \def\xintQuo {\romannumeral0\xintquo }% \def\xintRem {\romannumeral0\xintrem }% \def\xintquo {\expandafter @@ -2537,7 +2629,7 @@ \expandafter \XINT@div@body@h \romannumeral0\XINT@div@sub@xpxp - {\romannumeral0\XINT@prod@mul@enter #3\W\X\Y\Z #1\W\X\Y\Z }% + {\romannumeral0\XINT@pow@mul@enter #3\W\X\Y\Z #1\W\X\Y\Z }% {#2}\Z {#3}{#1}% }% @@ -2561,7 +2653,7 @@ \expandafter \XINT@div@body@l \expandafter{\romannumeral0\XINT@div@sub@xpxp - {\romannumeral0\XINT@prod@mul@enter #3\W\X\Y\Z #1\W\X\Y\Z }% + {\romannumeral0\XINT@pow@mul@enter #3\W\X\Y\Z #1\W\X\Y\Z }% {\XINT@Rev{#2}}}% {#4+#1}% }% diff --git a/Master/texmf-dist/tex/generic/xint/xintgcd.sty b/Master/texmf-dist/tex/generic/xint/xintgcd.sty index 08993b3a5fc..a270186f4ed 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.) %% %%---------------------------------------------------------------- -%% Part of the xint bundle (version 1.01 of 2013/04/04) +%% The xint bundle (version 1.02 of April 5, 2013) %% xintgcd: Euclidean algorithm with xint package %% Copyright (C) 2013 by Jean-Francois Burnol %%---------------------------------------------------------------- @@ -162,7 +162,7 @@ \fi \expandafter\x\csname ver@xintgcd.sty\endcsname \ProvidesPackage{xintgcd}% - [2013/04/04 v1.01 Euclide algorithm with xint package (jfB)]% + [2013/04/05 v1.02 Euclide algorithm with xint package (jfB)]% \def\xintGCD {\romannumeral0\xintgcd }% \def\xintgcd #1% {% |