From cfa2367936c9c7cf864687e098482ca255082a90 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 25 Apr 2013 22:33:49 +0000 Subject: xint (25apr13) git-svn-id: svn://tug.org/texlive/trunk@30107 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/generic/xint/xint.sty | 171 ++-- Master/texmf-dist/tex/generic/xint/xintcfrac.sty | 1070 +++++++++++++++++++++ Master/texmf-dist/tex/generic/xint/xintfrac.sty | 288 ++++-- Master/texmf-dist/tex/generic/xint/xintgcd.sty | 4 +- Master/texmf-dist/tex/generic/xint/xintseries.sty | 178 +++- 5 files changed, 1553 insertions(+), 158 deletions(-) create mode 100644 Master/texmf-dist/tex/generic/xint/xintcfrac.sty (limited to 'Master/texmf-dist/tex') diff --git a/Master/texmf-dist/tex/generic/xint/xint.sty b/Master/texmf-dist/tex/generic/xint/xint.sty index e121c9bcffb..279468d168d 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.03 of April 14, 2013) +%% The xint bundle (version 1.04 of April 25, 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/14 v1.03 Expandable operations on long numbers (jfB)]% + [2013/04/25 v1.04 Expandable operations on long numbers (jfB)]% \def\xint@gobble #1{}% \def\xint@gobble@one #1{}% \def\xint@gobble@two #1#2{}% @@ -256,10 +256,9 @@ {% \the\numexpr #1#2#3#4\relax }% -\def\XINT@Rev@andcleanupzeros #1% +\def\XINT@rev@andcuz #1% {% - \romannumeral0\expandafter - \xint@cleanupzeros@andstop + \expandafter\xint@cleanupzeros@andstop \romannumeral0\XINT@rord@main {}#1% \xint@UNDEF \xint@undef\xint@undef\xint@undef\xint@undef @@ -505,6 +504,55 @@ }% }% \let\xintDigitsOf\xintAssignArray +\def\xintApply {\romannumeral0\xintapply }% +\def\xintapply #1#2% +{% + \expandafter\expandafter\expandafter + \XINT@apply + \expandafter\expandafter\expandafter + {#2}{#1}% +}% +\def\XINT@apply #1#2% +{% + \XINT@apply@loop@a {}{#2}#1\Z +}% +\def\XINT@apply@loop@a #1#2#3% +{% + \xint@z #3\XINT@apply@end\Z + \expandafter\expandafter\expandafter + \XINT@apply@loop@b + \expandafter\expandafter\expandafter {#2{#3}}{#1}{#2}% +}% +\def\XINT@apply@loop@b #1#2{\XINT@apply@loop@a {#2{#1}}}% +\def\XINT@apply@end\Z + \expandafter\expandafter\expandafter + \XINT@apply@loop@b + \expandafter\expandafter\expandafter #1#2#3{ #2}% +\def\xintListWithSep {\romannumeral0\xintlistwithsep }% +\long\def\xintlistwithsep #1#2% +{% + \expandafter\expandafter\expandafter + \XINT@lws + \expandafter\expandafter\expandafter + {#2}{#1}% +}% +\long\def\XINT@lws #1#2% +{% + \XINT@lws@start {#2}#1\Z +}% +\long\def\XINT@lws@start #1#2% +{% + \xint@z #2\XINT@lws@dont\Z + \XINT@lws@loop@a {#2}{#1}% +}% +\long\def\XINT@lws@dont\Z\XINT@lws@loop@a #1#2{ #2}% +\long\def\XINT@lws@loop@a #1#2#3% +{% + \xint@z #3\XINT@lws@end\Z + \XINT@lws@loop@b {#1}{#2#3}{#2}% +}% +\long\def\XINT@lws@loop@b #1#2{\XINT@lws@loop@a {#1#2}}% +\long\def\XINT@lws@end\Z\XINT@lws@loop@b #1#2#3{ #1}% \def\xintiSgn {\romannumeral0\xintisgn }% \def\xintisgn #1% {% @@ -752,8 +800,7 @@ }% \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 @@ -1115,7 +1162,7 @@ }% \def\XINT@sub@Eonestep #1#2% {\expandafter - \XINT@sub@backtoE\the\numexpr 110000-#2+#1-1\relax.% + \XINT@sub@backtoE\the\numexpr 109999-#2+#1\relax.% }% \def\XINT@sub@backtoE #1#2#3.#4% {% @@ -1533,18 +1580,22 @@ \def\XINT@sumexpr {\XINT@sum@loop {0000}{0000}}% \def\XINT@sum@loop #1#2#3% {% - \xint@relax #3\XINT@sum@finished\relax \expandafter\expandafter\expandafter \XINT@sum@checksign #3\Z {#1}{#2}% }% \def\XINT@sum@checksign #1% {% + \xint@relax #1\XINT@sum@finished\relax \xint@zero #1\XINT@sum@skipzeroinput0% \xint@UDsignfork #1\dummy \XINT@sum@N -\dummy {\XINT@sum@P #1}% \xint@UDkrof }% +\def\XINT@sum@finished #1\Z #2#3% +{% + \XINT@sub@A 1{}#3\W\X\Y\Z #2\W\X\Y\Z +}% \def\XINT@sum@skipzeroinput #1\xint@UDkrof #2\Z {\XINT@sum@loop }% \def\XINT@sum@P #1\Z #2% {% @@ -1563,10 +1614,6 @@ \W\X\Y\Z #3\W\X\Y\Z }{#2}% }% \def\XINT@sum@NN #1#2{\XINT@sum@loop {#2}{#1}}% -\def\XINT@sum@finished #1\Z #2#3% -{% - \XINT@sub@A 1{}#3\W\X\Y\Z #2\W\X\Y\Z -}% \def\xintiMul {\romannumeral0\xintimul }% \def\xintimul #1% {% @@ -2010,18 +2057,22 @@ }% \let\xintProductExpr\xintiProductExpr \let\xintproductexpr\xintiproductexpr -\def\XINT@productexpr {\XINT@prod@loop {1}}% -\def\XINT@prod@loop #1#2% +\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 +}% +\def\XINT@prod@loop@b #1% {% - \xint@relax #2\XINT@prod@finished\relax - \expandafter\XINT@prod@loop\expandafter - {\romannumeral0\xintimul {#2}{#1}}% + \xint@relax #1\XINT@prod@finished\relax + \XINT@prod@loop@c #1% }% -\def\XINT@prod@finished #1#2#3#4#5% +\def\XINT@prod@loop@c {% - \XINT@prod@finished@ #5% + \expandafter\XINT@prod@loop@a\romannumeral0\XINT@mul@fork }% -\def\XINT@prod@finished@ #1#2#3#4#5{ #5}% +\def\XINT@prod@finished #1\Z #2\Z \Z { #2}% \def\xintFac {\romannumeral0\xintfac }% \def\xintfac #1% {% @@ -2307,10 +2358,9 @@ \expandafter\XINT@div@BisNegative@post \romannumeral0\XINT@div@fork #1\Z #4#2\Z }% -\def\XINT@div@BisNegative@post #1#2% +\def\XINT@div@BisNegative@post #1% {% - \expandafter\space\expandafter - {\romannumeral0\XINT@opp #1}{#2}% + \expandafter\space\expandafter {\romannumeral0\XINT@opp #1}% }% \def\XINT@div@AisNegative #1#2#3#4% {% @@ -2328,13 +2378,12 @@ }% \def\XINT@div@AisNegative@zerorem #1#2#3% {% - \expandafter\space\expandafter - {\romannumeral0\XINT@opp #1}{0}% + \expandafter\space\expandafter {\romannumeral0\XINT@opp #1}{0}% }% \def\XINT@div@AisNegative@posrem #1% {% \expandafter \XINT@div@AisNegative@posrem@b \expandafter - {\romannumeral0\xintiopp {\XINT@Add{#1}{1}}}% + {\romannumeral0\xintiopp{\xintiAdd {#1}{1}}}% }% \def\XINT@div@AisNegative@posrem@b #1#2#3% {% @@ -2463,9 +2512,8 @@ }% \def\XINT@div@finished@c #1#2% {% - \expandafter \space \expandafter - {\romannumeral0\expandafter\xint@cleanupzeros@andstop - \romannumeral0\XINT@rev {#2}}{#1}% + \expandafter\space\expandafter + {\romannumeral0\XINT@rev@andcuz {#2}}{#1}% }% \def\XINT@div@final@a #1% {% @@ -2478,46 +2526,55 @@ }% \def\xint@div@final@c0000\XINT@div@final@c #1{\XINT@div@finished@a }% \def\XINT@div@final@c #1#2#3#4% -{% - \expandafter \XINT@div@final@d \expandafter - {\the\numexpr #1/#4\relax}{#2}% -}% -\def\XINT@div@final@d #1#2#3#4#5% q,A,Q,L,B puis c {% \expandafter \XINT@div@final@da \expandafter - {\romannumeral0\XINT@mul@M {#1}#5\Z\Z\Z\Z }% + {\the\numexpr #1-(#1/#4)*#4\expandafter }\expandafter + {\the\numexpr #1/#4\expandafter }\expandafter {\romannumeral0\xint@cleanupzeros@andstop #2}% - {#1}{#3}{#5}% }% -\def\XINT@div@final@da #1#2% +\def\XINT@div@final@da #1% {% - \expandafter\XINT@div@final@db\expandafter {#2}{#1}% + \ifnum #1>9 + \expandafter\XINT@div@final@dP + \else + \xint@afterfi + {\ifnum #1<0 + \expandafter\XINT@div@final@dN + \else + \expandafter\XINT@div@final@db + \fi }% + \fi }% -\def\XINT@div@final@db #1#2% A,qB, puis q,Q,B,c +\def\XINT@div@final@dN #1% {% - \ifcase\XINT@Geq {#1}{#2} - \expandafter\XINT@div@final@dc % A < qB - \or\expandafter\XINT@div@final@e % A au moins qB - \fi - {#1}{#2}% + \expandafter\XINT@div@final@dP\the\numexpr #1-1\relax }% -\def\XINT@div@final@e #1#2#3#4#5% A,qB,q,Q,B,puis c +\def\XINT@div@final@dP #1#2#3#4#5% q,A,Q,L,B (puis c) {% - \expandafter\XINT@div@final@f - \expandafter{\romannumeral0\xintisub {#1}{#2}}% - {\romannumeral0\xintiadd {\XINT@Rev@andcleanupzeros{#4}}{#3}}% + \expandafter \XINT@div@final@f \expandafter + {\romannumeral0\xintisub {#2}% + {\romannumeral0\XINT@mul@M {#1}#5\Z\Z\Z\Z }}% + {\romannumeral0\XINT@add@A 0{}#1000\W\X\Y\Z #3\W\X\Y\Z }% }% -\def\XINT@div@final@dc #1#2#3% A sans leading zeros,trash,q,Q,B,c +\def\XINT@div@final@db #1#2#3#4#5% q,A,Q,L,B (puis c) {% - \expandafter\XINT@div@final@dd - \expandafter{\the\numexpr #3-1\relax}{#1}% + \expandafter\XINT@div@final@dc\expandafter + {\romannumeral0\xintisub {#2}% + {\romannumeral0\XINT@mul@M {#1}#5\Z\Z\Z\Z }}% + {#1}{#2}{#3}{#4}{#5}% +}% +\def\XINT@div@final@dc #1#2% +{% + \ifnum\XINT@Sgn{#1}<0 + \xint@afterfi {\expandafter\XINT@div@final@dP + \the\numexpr #2-1\relax }% + \else \xint@afterfi {\XINT@div@final@e {#1}#2}% + \fi }% -\def\XINT@div@final@dd #1#2#3#4% q,A,Q,B puis c +\def\XINT@div@final@e #1#2#3#4#5#6% A final, q, trash, Q, L, B {% - \expandafter\XINT@div@final@f - \expandafter{\romannumeral0\xintisub - {#2}{\romannumeral0\XINT@mul@M {#1}#4\Z\Z\Z\Z }}% - {\romannumeral0\xintiadd {\XINT@Rev@andcleanupzeros{#3}}{#1}}% + \XINT@div@final@f {#1}% + {\romannumeral0\XINT@add@A 0{}#2000\W\X\Y\Z #4\W\X\Y\Z }% }% \def\XINT@div@final@f #1#2#3% R,Q à développer,c {% diff --git a/Master/texmf-dist/tex/generic/xint/xintcfrac.sty b/Master/texmf-dist/tex/generic/xint/xintcfrac.sty new file mode 100644 index 00000000000..8600e32fff7 --- /dev/null +++ b/Master/texmf-dist/tex/generic/xint/xintcfrac.sty @@ -0,0 +1,1070 @@ +%% +%% This is file `xintcfrac.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% xint.dtx (with options: `xintcfrac') +%% +%% IMPORTANT NOTICE: +%% +%% For the copyright see the source file. +%% +%% Any modified versions of this file must be renamed +%% with new filenames distinct from xintcfrac.sty. +%% +%% For distribution of the original source see the terms +%% for copying and modification in the file xint.dtx. +%% +%% This generated file may be distributed as long as the +%% original source files, as listed above, are part of the +%% same distribution. (The sources need not necessarily be +%% in the same archive or directory.) +%% +%%---------------------------------------------------------------- +%% The xint bundle (version 1.04 of April 25, 2013) +%% xintcfrac: Expandable continued fractions with xint package +%% Copyright (C) 2013 by Jean-Francois Burnol +%%---------------------------------------------------------------- +%% +\begingroup\catcode61\catcode48\catcode32=10\relax% + \catcode13=5 % ^^M + \endlinechar=13 % + \catcode123=1 % { + \catcode125=2 % } + \catcode64=11 % @ + \catcode35=6 % # + \catcode44=12 % , + \catcode45=12 % - + \catcode46=12 % . + \catcode58=12 % : + \def\space { }% + \let\z\endgroup + \expandafter\let\expandafter\x\csname ver@xintcfrac.sty\endcsname + \expandafter\let\expandafter\w\csname ver@xintfrac.sty\endcsname + \expandafter + \ifx\csname PackageInfo\endcsname\relax + \def\y#1#2{\immediate\write-1{Package #1 Info: #2.}}% + \else + \def\y#1#2{\PackageInfo{#1}{#2}}% + \fi + \expandafter + \ifx\csname numexpr\endcsname\relax + \y{xintcfrac}{\numexpr not available, aborting input}% + \aftergroup\endinput + \else + \ifx\x\relax % plain-TeX, first loading of xintcfrac.sty + \ifx\w\relax % but xintfrac.sty not yet loaded. + \y{xintcfrac}{Package xintfrac is required}% + \y{xintcfrac}{Will try \string\input\space xintfrac.sty}% + \def\z{\endgroup\input xintfrac.sty\relax}% + \fi + \else + \def\empty {}% + \ifx\x\empty % LaTeX, first loading, + % variable is initialized, but \ProvidesPackage not yet seen + \ifx\w\relax % xintfrac.sty not yet loaded. + \y{xintcfrac}{Package xintfrac is required}% + \y{xintcfrac}{Will try \string\RequirePackage{xintfrac}}% + \def\z{\endgroup\RequirePackage{xintfrac}}% + \fi + \else + \y{xintcfrac}{I was already loaded, aborting input}% + \aftergroup\endinput + \fi + \fi + \fi +\z% +\begingroup\catcode61\catcode48\catcode32=10\relax% + \catcode13=5 % ^^M + \endlinechar=13 % + \catcode123=1 % { + \catcode125=2 % } + \catcode64=11 % @ + \catcode35=6 % # + \catcode44=12 % , + \catcode45=12 % - + \catcode46=12 % . + \catcode58=12 % : + \expandafter + \ifx\csname PackageInfo\endcsname\relax + \def\y#1#2{\immediate\write-1{Package #1 Info: #2.}}% + \else + \def\y#1#2{\PackageInfo{#1}{#2}}% + \fi + \def\empty {}% + \expandafter\let\expandafter\w\csname ver@xintfrac.sty\endcsname + \ifx\w\relax % Plain TeX, user gave a file name at the prompt + \y{xintcfrac}{Loading of package xintfrac failed, aborting input}% + \aftergroup\endinput + \fi + \ifx\w\empty % LaTeX, user gave a file name at the prompt + \y{xintcfrac}{Loading of package xintfrac failed, aborting input}% + \aftergroup\endinput + \fi +\endgroup% +\begingroup\catcode61\catcode48\catcode32=10\relax% + \catcode13=5 % ^^M + \endlinechar=13 % + \catcode123=1 % { + \catcode125=2 % } + \catcode64=11 % @ + \def\x + {% + \endgroup + \edef\XINT@cfrac@restorecatcodes@endinput + {% + \catcode93=\the\catcode93 % ] + \catcode91=\the\catcode91 % [ + \catcode47=\the\catcode47 % / + \catcode41=\the\catcode41 % ) + \catcode40=\the\catcode40 % ( + \catcode42=\the\catcode42 % * + \catcode43=\the\catcode43 % + + \catcode62=\the\catcode62 % > + \catcode60=\the\catcode60 % < + \catcode58=\the\catcode58 % : + \catcode46=\the\catcode46 % . + \catcode45=\the\catcode45 % - + \catcode44=\the\catcode44 % , + \catcode35=\the\catcode35 % # + \catcode64=\the\catcode64 % @ + \catcode125=\the\catcode125 % } + \catcode123=\the\catcode123 % { + \endlinechar=\the\endlinechar + \catcode13=\the\catcode13 % ^^M + \catcode32=\the\catcode32 % + \catcode61=\the\catcode61 % = + \noexpand\endinput + }% + \XINT@setcatcodes + \catcode91=12 % [ + \catcode93=12 % ] + }% +\x +\begingroup + \catcode58=12 % : + \expandafter\ifx\csname ProvidesPackage\endcsname\relax + \def\x#1#2#3[#4]{\endgroup + \immediate\write-1{Package: #3 #4}% + \xdef#1{#4}% + }% + \else + \def\x#1#2[#3]{\endgroup + #2[{#3}]% + \ifx#1\@undefined + \xdef#1{#3}% + \fi + \ifx#1\relax + \xdef#1{#3}% + \fi + }% + \fi +\expandafter\x\csname ver@xintcfrac.sty\endcsname +\ProvidesPackage{xintcfrac}% + [2013/04/25 v1.04 Expandable continued fractions with xint package (jfB)]% +\def\xintCFrac {\romannumeral0\xintcfrac }% +\def\xintcfrac #1% +{% + \XINT@cfrac@opt@a #1\Z +}% +\def\XINT@cfrac@opt@a #1% +{% + \ifx#1[\XINT@cfrac@opt@b\fi \XINT@cfrac@noopt #1% +}% +\def\XINT@cfrac@noopt #1\Z +{% + \expandafter\XINT@cfrac@A\romannumeral0\xintraw {#1}\Z + \relax\relax +}% +\def\XINT@cfrac@opt@b\fi\XINT@cfrac@noopt [\Z #1]% +{% + \fi\csname XINT@cfrac@opt#1\endcsname +}% +\def\XINT@cfrac@optl #1% +{% + \expandafter\XINT@cfrac@A\romannumeral0\xintraw {#1}\Z + \relax\hfill +}% +\def\XINT@cfrac@optc #1% +{% + \expandafter\XINT@cfrac@A\romannumeral0\xintraw {#1}\Z + \relax\relax +}% +\def\XINT@cfrac@optr #1% +{% + \expandafter\XINT@cfrac@A\romannumeral0\xintraw {#1}\Z + \hfill\relax +}% +\def\XINT@cfrac@A #1/#2\Z +{% + \expandafter\XINT@cfrac@B\romannumeral0\xintdivision {#1}{#2}{#2}% +}% +\def\XINT@cfrac@B #1#2% +{% + \XINT@cfrac@C #2\Z {#1}% +}% +\def\XINT@cfrac@C #1% +{% + \xint@zero #1\XINT@cfrac@integer 0\XINT@cfrac@D #1% +}% +\def\XINT@cfrac@integer 0\XINT@cfrac@D 0#1\Z #2#3#4#5{ #2}% +\def\XINT@cfrac@D #1\Z #2#3{\XINT@cfrac@loop@a {#1}{#3}{#1}{{#2}}}% +\def\XINT@cfrac@loop@a +{% + \expandafter\XINT@cfrac@loop@d\romannumeral0\XINT@div@prepare +}% +\def\XINT@cfrac@loop@d #1#2% +{% + \XINT@cfrac@loop@e #2.{#1}% +}% +\def\XINT@cfrac@loop@e #1% +{% + \xint@zero #1\xint@cfrac@loop@exit0\XINT@cfrac@loop@f #1% +}% +\def\XINT@cfrac@loop@f #1.#2#3#4% +{% + \XINT@cfrac@loop@a {#1}{#3}{#1}{{#2}#4}% +}% +\def\xint@cfrac@loop@exit0\XINT@cfrac@loop@f #1.#2#3#4#5#6% + {\XINT@cfrac@T #5#6{#2}#4\Z }% +\def\XINT@cfrac@T #1#2#3#4% +{% + \xint@z #4\XINT@cfrac@end\Z\XINT@cfrac@T #1#2{#4+\cfrac{#11#2}{#3}}% +}% +\def\XINT@cfrac@end\Z\XINT@cfrac@T #1#2#3% +{% + \XINT@cfrac@@end #3% +}% +\def\XINT@cfrac@@end \Z+\cfrac#1#2{ #2}% +\def\xintGCFrac {\romannumeral0\xintgcfrac }% +\def\xintgcfrac #1% +{% + \XINT@gcfrac@opt@a #1\Z +}% +\def\XINT@gcfrac@opt@a #1% +{% + \ifx#1[\XINT@gcfrac@opt@b\fi \XINT@gcfrac@noopt #1% +}% +\def\XINT@gcfrac@noopt #1\Z +{% + \XINT@gcfrac #1+\W/\relax\relax +}% +\def\XINT@gcfrac@opt@b\fi\XINT@gcfrac@noopt [\Z #1]% +{% + \fi\csname XINT@gcfrac@opt#1\endcsname +}% +\def\XINT@gcfrac@optl #1% +{% + \XINT@gcfrac #1+\W/\relax\hfill +}% +\def\XINT@gcfrac@optc #1% +{% + \XINT@gcfrac #1+\W/\relax\relax +}% +\def\XINT@gcfrac@optr #1% +{% + \XINT@gcfrac #1+\W/\hfill\relax +}% +\def\XINT@gcfrac +{% + \expandafter\expandafter\expandafter\XINT@gcfrac@enter +}% +\def\XINT@gcfrac@enter {\XINT@gcfrac@loop {}}% +\def\XINT@gcfrac@loop #1#2+#3/% +{% + \xint@w #3\XINT@gcfrac@endloop\W\XINT@gcfrac@loop {{#3}{#2}#1}% +}% +\def\XINT@gcfrac@endloop\W\XINT@gcfrac@loop #1#2#3% +{% + \XINT@gcfrac@T #2#3#1\Z\Z +}% +\def\XINT@gcfrac@T #1#2#3#4{\XINT@gcfrac@U #1#2{\xintFrac{#4}}}% +\def\XINT@gcfrac@U #1#2#3#4#5% +{% + \xint@z #5\XINT@gcfrac@end\Z\XINT@gcfrac@U + #1#2{\xintFrac{#5}% + \ifcase\xintSgn{#4} + +\or+\else-\fi + \cfrac{#1\xintFrac{\xintAbs{#4}}#2}{#3}}% +}% +\def\XINT@gcfrac@end\Z\XINT@gcfrac@U #1#2#3% +{% + \XINT@gcfrac@@end #3% +}% +\def\XINT@gcfrac@@end #1\cfrac#2#3{ #3}% +\def\xintFtoCs {\romannumeral0\xintftocs }% +\def\xintftocs #1% +{% + \expandafter\XINT@ftc@A\romannumeral0\xintraw {#1}\Z +}% +\def\XINT@ftc@A #1/#2\Z +{% + \expandafter\XINT@ftc@B\romannumeral0\xintdivision {#1}{#2}{#2}% +}% +\def\XINT@ftc@B #1#2% +{% + \XINT@ftc@C #2.{#1}% +}% +\def\XINT@ftc@C #1% +{% + \xint@zero #1\XINT@ftc@integer 0\XINT@ftc@D #1% +}% +\def\XINT@ftc@integer 0\XINT@ftc@D 0#1.#2#3{ #2}% +\def\XINT@ftc@D #1.#2#3{\XINT@ftc@loop@a {#1}{#3}{#1}{#2,}}% +\def\XINT@ftc@loop@a +{% + \expandafter\XINT@ftc@loop@d\romannumeral0\XINT@div@prepare +}% +\def\XINT@ftc@loop@d #1#2% +{% + \XINT@ftc@loop@e #2.{#1}% +}% +\def\XINT@ftc@loop@e #1% +{% + \xint@zero #1\xint@ftc@loop@exit0\XINT@ftc@loop@f #1% +}% +\def\XINT@ftc@loop@f #1.#2#3#4% +{% + \XINT@ftc@loop@a {#1}{#3}{#1}{#4#2,}% +}% +\def\xint@ftc@loop@exit0\XINT@ftc@loop@f #1.#2#3#4{ #4#2}% +\def\xintFtoCx {\romannumeral0\xintftocx }% +\def\xintftocx #1#2% +{% + \expandafter\XINT@ftcx@A\romannumeral0\xintraw {#2}\Z {#1}% +}% +\def\XINT@ftcx@A #1/#2\Z +{% + \expandafter\XINT@ftcx@B\romannumeral0\xintdivision {#1}{#2}{#2}% +}% +\def\XINT@ftcx@B #1#2% +{% + \XINT@ftcx@C #2.{#1}% +}% +\def\XINT@ftcx@C #1% +{% + \xint@zero #1\XINT@ftcx@integer 0\XINT@ftcx@D #1% +}% +\def\XINT@ftcx@integer 0\XINT@ftcx@D 0#1.#2#3#4{ #2}% +\def\XINT@ftcx@D #1.#2#3#4{\XINT@ftcx@loop@a {#1}{#3}{#1}{#2#4}{#4}}% +\def\XINT@ftcx@loop@a +{% + \expandafter\XINT@ftcx@loop@d\romannumeral0\XINT@div@prepare +}% +\def\XINT@ftcx@loop@d #1#2% +{% + \XINT@ftcx@loop@e #2.{#1}% +}% +\def\XINT@ftcx@loop@e #1% +{% + \xint@zero #1\xint@ftcx@loop@exit0\XINT@ftcx@loop@f #1% +}% +\def\XINT@ftcx@loop@f #1.#2#3#4#5% +{% + \XINT@ftcx@loop@a {#1}{#3}{#1}{#4{#2}#5}{#5}% +}% +\def\xint@ftcx@loop@exit0\XINT@ftcx@loop@f #1.#2#3#4#5{ #4{#2}}% +\def\xintFtoGC {\romannumeral0\xintftogc }% +\def\xintftogc {\xintftocx {+1/}}% +\def\xintFtoCC {\romannumeral0\xintftocc }% +\def\xintftocc #1% +{% + \expandafter\XINT@ftcc@A\expandafter {\romannumeral0\xintraw {#1}}% +}% +\def\XINT@ftcc@A #1% +{% + \expandafter\XINT@ftcc@B + \romannumeral0\xintraw {\xintAdd {1/2[0]}{#1[0]}}\Z {#1[0]}% +}% +\def\XINT@ftcc@B #1/#2\Z +{% + \expandafter\XINT@ftcc@C\expandafter {\romannumeral0\xintquo {#1}{#2}}% +}% +\def\XINT@ftcc@C #1#2% +{% + \expandafter\XINT@ftcc@D\romannumeral0\xintsub {#2}{#1}\Z {#1}% +}% +\def\XINT@ftcc@D #1% +{% + \xint@UDzerominusfork + #1-\dummy \XINT@ftcc@integer + 0#1\dummy \XINT@ftcc@En + 0-\dummy {\XINT@ftcc@Ep #1}% + \xint@UDkrof +}% +\def\XINT@ftcc@Ep #1\Z #2% +{% + \expandafter\XINT@ftcc@loop@a\expandafter + {\romannumeral0\xintdiv {1[0]}{#1}}{#2+1/}% +}% +\def\XINT@ftcc@En #1\Z #2% +{% + \expandafter\XINT@ftcc@loop@a\expandafter + {\romannumeral0\xintdiv {1[0]}{#1}}{#2+-1/}% +}% +\def\XINT@ftcc@integer #1\Z #2{ #2}% +\def\XINT@ftcc@loop@a #1% +{% + \expandafter\XINT@ftcc@loop@b + \romannumeral0\xintraw {\xintAdd {1/2[0]}{#1}}\Z {#1}% +}% +\def\XINT@ftcc@loop@b #1/#2\Z +{% + \expandafter\XINT@ftcc@loop@c\expandafter + {\romannumeral0\xintquo {#1}{#2}}% +}% +\def\XINT@ftcc@loop@c #1#2% +{% + \expandafter\XINT@ftcc@loop@d + \romannumeral0\xintsub {#2}{#1[0]}\Z {#1}% +}% +\def\XINT@ftcc@loop@d #1% +{% + \xint@UDzerominusfork + #1-\dummy \XINT@ftcc@end + 0#1\dummy \XINT@ftcc@loop@N + 0-\dummy {\XINT@ftcc@loop@P #1}% + \xint@UDkrof +}% +\def\XINT@ftcc@end #1\Z #2#3{ #3#2}% +\def\XINT@ftcc@loop@P #1\Z #2#3% +{% + \expandafter\XINT@ftcc@loop@a\expandafter + {\romannumeral0\xintdiv {1[0]}{#1}}{#3#2+1/}% +}% +\def\XINT@ftcc@loop@N #1\Z #2#3% +{% + \expandafter\XINT@ftcc@loop@a\expandafter + {\romannumeral0\xintdiv {1[0]}{#1}}{#3#2+-1/}% +}% +\def\xintFtoCv {\romannumeral0\xintftocv }% +\def\xintftocv #1% +{% + \xinticstocv {\xintFtoCs {#1}}% +}% +\def\xintFtoCCv {\romannumeral0\xintftoccv }% +\def\xintftoccv #1% +{% + \xintigctocv {\xintFtoCC {#1}}% +}% +\def\xintCstoF {\romannumeral0\xintcstof }% +\def\xintcstof #1% +{% + \expandafter\expandafter\expandafter + \XINT@cstf@prep #1,\W,% +}% +\def\XINT@cstf@prep +{% + \XINT@cstf@loop@a 1001% +}% +\def\XINT@cstf@loop@a #1#2#3#4#5,% +{% + \xint@w #5\XINT@cstf@end\W\expandafter\XINT@cstf@loop@b + \romannumeral0\xintraw {#5}.{#1}{#2}{#3}{#4}% +}% +\def\XINT@cstf@loop@b #1/#2.#3#4#5#6% +{% + \expandafter\XINT@cstf@loop@c\expandafter + {\romannumeral0\XINT@mul@fork #2\Z #4\Z }% + {\romannumeral0\XINT@mul@fork #2\Z #3\Z }% + {\romannumeral0\xintiadd {\XINT@Mul {#2}{#6}}{\XINT@Mul {#1}{#4}}}% + {\romannumeral0\xintiadd {\XINT@Mul {#2}{#5}}{\XINT@Mul {#1}{#3}}}% +}% +\def\XINT@cstf@loop@c #1#2% +{% + \expandafter\XINT@cstf@loop@d\expandafter {\expandafter{#2}{#1}}% +}% +\def\XINT@cstf@loop@d #1#2% +{% + \expandafter\XINT@cstf@loop@e\expandafter {\expandafter{#2}#1}% +}% +\def\XINT@cstf@loop@e #1#2% +{% + \expandafter\XINT@cstf@loop@a\expandafter{#2}#1% +}% +\def\XINT@cstf@end #1.#2#3#4#5{\xintraw {#2/#3}[0]}% +\def\xintiCstoF {\romannumeral0\xinticstof }% +\def\xinticstof #1% +{% + \expandafter\expandafter\expandafter + \XINT@icstf@prep #1,\W,% +}% +\def\XINT@icstf@prep +{% + \XINT@icstf@loop@a 1001% +}% +\def\XINT@icstf@loop@a #1#2#3#4#5,% +{% + \xint@w #5\XINT@icstf@end\W + \expandafter\expandafter\expandafter + \XINT@icstf@loop@b #5.{#1}{#2}{#3}{#4}% +}% +\def\XINT@icstf@loop@b #1.#2#3#4#5% +{% + \expandafter\XINT@icstf@loop@c\expandafter + {\romannumeral0\xintiadd {#5}{\XINT@Mul {#1}{#3}}}% + {\romannumeral0\xintiadd {#4}{\XINT@Mul {#1}{#2}}}% + {#2}{#3}% +}% +\def\XINT@icstf@loop@c #1#2% +{% + \expandafter\XINT@icstf@loop@a\expandafter {#2}{#1}% +}% +\def\XINT@icstf@end#1.#2#3#4#5{\xintraw {#2/#3}[0]}% +\def\xintGCtoF {\romannumeral0\xintgctof }% +\def\xintgctof #1% +{% + \expandafter\expandafter\expandafter + \XINT@gctf@prep #1+\W/% +}% +\def\XINT@gctf@prep +{% + \XINT@gctf@loop@a 1001% +}% +\def\XINT@gctf@loop@a #1#2#3#4#5+% +{% + \expandafter\XINT@gctf@loop@b + \romannumeral0\xintraw {#5}.{#1}{#2}{#3}{#4}% +}% +\def\XINT@gctf@loop@b #1/#2.#3#4#5#6% +{% + \expandafter\XINT@gctf@loop@c\expandafter + {\romannumeral0\XINT@mul@fork #2\Z #4\Z }% + {\romannumeral0\XINT@mul@fork #2\Z #3\Z }% + {\romannumeral0\xintiadd {\XINT@Mul {#2}{#6}}{\XINT@Mul {#1}{#4}}}% + {\romannumeral0\xintiadd {\XINT@Mul {#2}{#5}}{\XINT@Mul {#1}{#3}}}% +}% +\def\XINT@gctf@loop@c #1#2% +{% + \expandafter\XINT@gctf@loop@d\expandafter {\expandafter{#2}{#1}}% +}% +\def\XINT@gctf@loop@d #1#2% +{% + \expandafter\XINT@gctf@loop@e\expandafter {\expandafter{#2}#1}% +}% +\def\XINT@gctf@loop@e #1#2% +{% + \expandafter\XINT@gctf@loop@f\expandafter {\expandafter{#2}#1}% +}% +\def\XINT@gctf@loop@f #1#2/% +{% + \xint@w #2\XINT@gctf@end\W\expandafter\XINT@gctf@loop@g + \romannumeral0\xintraw {#2}.#1% +}% +\def\XINT@gctf@loop@g #1/#2.#3#4#5#6% +{% + \expandafter\XINT@gctf@loop@h\expandafter + {\romannumeral0\XINT@mul@fork #1\Z #6\Z }% + {\romannumeral0\XINT@mul@fork #1\Z #5\Z }% + {\romannumeral0\XINT@mul@fork #2\Z #4\Z }% + {\romannumeral0\XINT@mul@fork #2\Z #3\Z }% +}% +\def\XINT@gctf@loop@h #1#2% +{% + \expandafter\XINT@gctf@loop@i\expandafter {\expandafter{#2}{#1}}% +}% +\def\XINT@gctf@loop@i #1#2% +{% + \expandafter\XINT@gctf@loop@j\expandafter {\expandafter{#2}#1}% +}% +\def\XINT@gctf@loop@j #1#2% +{% + \expandafter\XINT@gctf@loop@a\expandafter {#2}#1% +}% +\def\XINT@gctf@end #1.#2#3#4#5{\xintraw {#2/#3}[0]}% +\def\xintiGCtoF {\romannumeral0\xintigctof }% +\def\xintigctof #1% +{% + \expandafter\expandafter\expandafter + \XINT@igctf@prep #1+\W/% +}% +\def\XINT@igctf@prep +{% + \XINT@igctf@loop@a 1001% +}% +\def\XINT@igctf@loop@a #1#2#3#4#5+% +{% + \expandafter\expandafter\expandafter\XINT@igctf@loop@b + #5.{#1}{#2}{#3}{#4}% +}% +\def\XINT@igctf@loop@b #1.#2#3#4#5% +{% + \expandafter\XINT@igctf@loop@c\expandafter + {\romannumeral0\xintiadd {#5}{\XINT@Mul {#1}{#3}}}% + {\romannumeral0\xintiadd {#4}{\XINT@Mul {#1}{#2}}}% + {#2}{#3}% +}% +\def\XINT@igctf@loop@c #1#2% +{% + \expandafter\XINT@igctf@loop@f\expandafter {\expandafter{#2}{#1}}% +}% +\def\XINT@igctf@loop@f #1#2#3#4/% +{% + \xint@w #4\XINT@igctf@end\W + \expandafter\expandafter\expandafter\XINT@igctf@loop@g + #4.{#2}{#3}#1% +}% +\def\XINT@igctf@loop@g #1.#2#3% +{% + \expandafter\XINT@igctf@loop@h\expandafter + {\romannumeral0\XINT@mul@fork #1\Z #3\Z }% + {\romannumeral0\XINT@mul@fork #1\Z #2\Z }% +}% +\def\XINT@igctf@loop@h #1#2% +{% + \expandafter\XINT@igctf@loop@i\expandafter {#2}{#1}% +}% +\def\XINT@igctf@loop@i #1#2#3#4% +{% + \XINT@igctf@loop@a {#3}{#4}{#1}{#2}% +}% +\def\XINT@igctf@end #1.#2#3#4#5{\xintraw {#4/#5}[0]}% +\def\xintCstoCv {\romannumeral0\xintcstocv }% +\def\xintcstocv #1% +{% + \expandafter\expandafter\expandafter + \XINT@cstcv@prep #1,\W,% +}% +\def\XINT@cstcv@prep +{% + \XINT@cstcv@loop@a {}1001% +}% +\def\XINT@cstcv@loop@a #1#2#3#4#5#6,% +{% + \xint@w #6\XINT@cstcv@end\W + \expandafter\XINT@cstcv@loop@b + \romannumeral0\xintraw {#6}.{#2}{#3}{#4}{#5}{#1}% +}% +\def\XINT@cstcv@loop@b #1/#2.#3#4#5#6% +{% + \expandafter\XINT@cstcv@loop@c\expandafter + {\romannumeral0\XINT@mul@fork #2\Z #4\Z }% + {\romannumeral0\XINT@mul@fork #2\Z #3\Z }% + {\romannumeral0\xintiadd {\XINT@Mul {#2}{#6}}{\XINT@Mul {#1}{#4}}}% + {\romannumeral0\xintiadd {\XINT@Mul {#2}{#5}}{\XINT@Mul {#1}{#3}}}% +}% +\def\XINT@cstcv@loop@c #1#2% +{% + \expandafter\XINT@cstcv@loop@d\expandafter {\expandafter{#2}{#1}}% +}% +\def\XINT@cstcv@loop@d #1#2% +{% + \expandafter\XINT@cstcv@loop@e\expandafter {\expandafter{#2}#1}% +}% +\def\XINT@cstcv@loop@e #1#2% +{% + \expandafter\XINT@cstcv@loop@f\expandafter{#2}#1% +}% +\def\XINT@cstcv@loop@f #1#2#3#4#5% +{% + \expandafter\XINT@cstcv@loop@g\expandafter + {\romannumeral0\xintraw {#1/#2}}{#5}{#1}{#2}{#3}{#4}% +}% +\def\XINT@cstcv@loop@g #1#2{\XINT@cstcv@loop@a {#2{#1[0]}}}% +\def\XINT@cstcv@end #1.#2#3#4#5#6{ #6}% +\def\xintiCstoCv {\romannumeral0\xinticstocv }% +\def\xinticstocv #1% +{% + \expandafter\expandafter\expandafter + \XINT@icstcv@prep #1,\W,% +}% +\def\XINT@icstcv@prep +{% + \XINT@icstcv@loop@a {}1001% +}% +\def\XINT@icstcv@loop@a #1#2#3#4#5#6,% +{% + \xint@w #6\XINT@icstcv@end\W + \expandafter\expandafter\expandafter + \XINT@icstcv@loop@b #6.{#2}{#3}{#4}{#5}{#1}% +}% +\def\XINT@icstcv@loop@b #1.#2#3#4#5% +{% + \expandafter\XINT@icstcv@loop@c\expandafter + {\romannumeral0\xintiadd {#5}{\XINT@Mul {#1}{#3}}}% + {\romannumeral0\xintiadd {#4}{\XINT@Mul {#1}{#2}}}% + {{#2}{#3}}% +}% +\def\XINT@icstcv@loop@c #1#2% +{% + \expandafter\XINT@icstcv@loop@d\expandafter {#2}{#1}% +}% +\def\XINT@icstcv@loop@d #1#2% +{% + \expandafter\XINT@icstcv@loop@e\expandafter + {\romannumeral0\xintraw {#1/#2}}{{#1}{#2}}% +}% +\def\XINT@icstcv@loop@e #1#2#3#4{\XINT@icstcv@loop@a {#4{#1[0]}}#2#3}% +\def\XINT@icstcv@end #1.#2#3#4#5#6{ #6}% +\def\xintGCtoCv {\romannumeral0\xintgctocv }% +\def\xintgctocv #1% +{% + \expandafter\expandafter\expandafter + \XINT@gctcv@prep #1+\W/% +}% +\def\XINT@gctcv@prep +{% + \XINT@gctcv@loop@a {}1001% +}% +\def\XINT@gctcv@loop@a #1#2#3#4#5#6+% +{% + \expandafter\XINT@gctcv@loop@b + \romannumeral0\xintraw {#6}.{#2}{#3}{#4}{#5}{#1}% +}% +\def\XINT@gctcv@loop@b #1/#2.#3#4#5#6% +{% + \expandafter\XINT@gctcv@loop@c\expandafter + {\romannumeral0\XINT@mul@fork #2\Z #4\Z }% + {\romannumeral0\XINT@mul@fork #2\Z #3\Z }% + {\romannumeral0\xintiadd {\XINT@Mul {#2}{#6}}{\XINT@Mul {#1}{#4}}}% + {\romannumeral0\xintiadd {\XINT@Mul {#2}{#5}}{\XINT@Mul {#1}{#3}}}% +}% +\def\XINT@gctcv@loop@c #1#2% +{% + \expandafter\XINT@gctcv@loop@d\expandafter {\expandafter{#2}{#1}}% +}% +\def\XINT@gctcv@loop@d #1#2% +{% + \expandafter\XINT@gctcv@loop@e\expandafter {\expandafter{#2}{#1}}% +}% +\def\XINT@gctcv@loop@e #1#2% +{% + \expandafter\XINT@gctcv@loop@f\expandafter {#2}#1% +}% +\def\XINT@gctcv@loop@f #1#2% +{% + \expandafter\XINT@gctcv@loop@g\expandafter + {\romannumeral0\xintraw {#1/#2}}{{#1}{#2}}% +}% +\def\XINT@gctcv@loop@g #1#2#3#4% +{% + \XINT@gctcv@loop@h {#4{#1[0]}}{#2#3}% +}% +\def\XINT@gctcv@loop@h #1#2#3/% +{% + \xint@w #3\XINT@gctcv@end\W\expandafter\XINT@gctcv@loop@i + \romannumeral0\xintraw {#3}.#2{#1}% +}% +\def\XINT@gctcv@loop@i #1/#2.#3#4#5#6% +{% + \expandafter\XINT@gctcv@loop@j\expandafter + {\romannumeral0\XINT@mul@fork #1\Z #6\Z }% + {\romannumeral0\XINT@mul@fork #1\Z #5\Z }% + {\romannumeral0\XINT@mul@fork #2\Z #4\Z }% + {\romannumeral0\XINT@mul@fork #2\Z #3\Z }% +}% +\def\XINT@gctcv@loop@j #1#2% +{% + \expandafter\XINT@gctcv@loop@k\expandafter {\expandafter{#2}{#1}}% +}% +\def\XINT@gctcv@loop@k #1#2% +{% + \expandafter\XINT@gctcv@loop@l\expandafter {\expandafter{#2}#1}% +}% +\def\XINT@gctcv@loop@l #1#2% +{% + \expandafter\XINT@gctcv@loop@m\expandafter {\expandafter{#2}#1}% +}% +\def\XINT@gctcv@loop@m #1#2{\XINT@gctcv@loop@a {#2}#1}% +\def\XINT@gctcv@end #1.#2#3#4#5#6{ #6}% +\def\xintiGCtoCv {\romannumeral0\xintigctocv }% +\def\xintigctocv #1% +{% + \expandafter\expandafter\expandafter + \XINT@igctcv@prep #1+\W/% +}% +\def\XINT@igctcv@prep +{% + \XINT@igctcv@loop@a {}1001% +}% +\def\XINT@igctcv@loop@a #1#2#3#4#5#6+% +{% + \expandafter\expandafter\expandafter\XINT@igctcv@loop@b + #6.{#2}{#3}{#4}{#5}{#1}% +}% +\def\XINT@igctcv@loop@b #1.#2#3#4#5% +{% + \expandafter\XINT@igctcv@loop@c\expandafter + {\romannumeral0\xintiadd {#5}{\XINT@Mul {#1}{#3}}}% + {\romannumeral0\xintiadd {#4}{\XINT@Mul {#1}{#2}}}% + {{#2}{#3}}% +}% +\def\XINT@igctcv@loop@c #1#2% +{% + \expandafter\XINT@igctcv@loop@f\expandafter {\expandafter{#2}{#1}}% +}% +\def\XINT@igctcv@loop@f #1#2#3#4/% +{% + \xint@w #4\XINT@igctcv@end@a\W + \expandafter\expandafter\expandafter\XINT@igctcv@loop@g + #4.#1#2{#3}% +}% +\def\XINT@igctcv@loop@g #1.#2#3#4#5% +{% + \expandafter\XINT@igctcv@loop@h\expandafter + {\romannumeral0\XINT@mul@fork #1\Z #5\Z }% + {\romannumeral0\XINT@mul@fork #1\Z #4\Z }% + {{#2}{#3}}% +}% +\def\XINT@igctcv@loop@h #1#2% +{% + \expandafter\XINT@igctcv@loop@i\expandafter {\expandafter{#2}{#1}}% +}% +\def\XINT@igctcv@loop@i #1#2{\XINT@igctcv@loop@k #2{#2#1}}% +\def\XINT@igctcv@loop@k #1#2% +{% + \expandafter\XINT@igctcv@loop@l\expandafter + {\romannumeral0\xintraw {#1/#2}}% +}% +\def\XINT@igctcv@loop@l #1#2#3{\XINT@igctcv@loop@a {#3{#1[0]}}#2}% +\def\XINT@igctcv@end@a #1.#2#3#4#5% +{% + \expandafter\XINT@igctcv@end@b\expandafter + {\romannumeral0\xintraw {#2/#3}}% +}% +\def\XINT@igctcv@end@b #1#2{ #2{#1[0]}}% +\def\xintCntoF {\romannumeral0\xintcntof }% +\def\xintcntof #1% +{% + \expandafter\expandafter\expandafter + \XINT@cntf + \expandafter\expandafter\expandafter + {#1}% +}% +\def\XINT@cntf #1#2% +{% + \ifnum #1>0 + \xint@afterfi {\expandafter\XINT@cntf@loop\expandafter + {\the\numexpr + #1-1\expandafter\expandafter\expandafter}% + \expandafter\expandafter\expandafter + {#2{#1}}{#2}}% + \else + \xint@afterfi + {\ifnum #1=0 + \xint@afterfi {\expandafter\expandafter\expandafter + \space #2{0}}% + \else \xint@afterfi { 0[0]}% + \fi}% + \fi +}% +\def\XINT@cntf@loop #1#2#3% +{% + \ifnum #1>0 \else \XINT@cntf@exit \fi + \expandafter\XINT@cntf@loop\expandafter + {\the\numexpr #1-1\expandafter }\expandafter + {\romannumeral0\xintadd {\xintDiv {1[0]}{#2}}{#3{#1}}}% + {#3}% +}% +\def\XINT@cntf@exit \fi + \expandafter\XINT@cntf@loop\expandafter + #1\expandafter #2#3% +{% + \fi\xint@gobble@two #2% +}% +\def\xintGCntoF {\romannumeral0\xintgcntof }% +\def\xintgcntof #1% +{% + \expandafter\expandafter\expandafter + \XINT@gcntf + \expandafter\expandafter\expandafter + {#1}% +}% +\def\XINT@gcntf #1#2#3% +{% + \ifnum #1>0 + \xint@afterfi {\expandafter\XINT@gcntf@loop\expandafter + {\the\numexpr + #1-1\expandafter\expandafter\expandafter}% + \expandafter\expandafter\expandafter + {#2{#1}}{#2}{#3}}% + \else + \xint@afterfi + {\ifnum #1=0 + \xint@afterfi {\expandafter\expandafter\expandafter + \space #2{0}}% + \else \xint@afterfi { 0[0]}% + \fi}% + \fi +}% +\def\XINT@gcntf@loop #1#2#3#4% +{% + \ifnum #1>0 \else \XINT@gcntf@exit \fi + \expandafter\XINT@gcntf@loop\expandafter + {\the\numexpr #1-1\expandafter }\expandafter + {\romannumeral0\xintadd {\xintDiv {#4{#1}}{#2}}{#3{#1}}}% + {#3}{#4}% +}% +\def\XINT@gcntf@exit \fi + \expandafter\XINT@gcntf@loop\expandafter + #1\expandafter #2#3#4% +{% + \fi\xint@gobble@two #2% +}% +\def\xintCntoCs {\romannumeral0\xintcntocs }% +\def\xintcntocs #1% +{% + \expandafter\expandafter\expandafter + \XINT@cntcs + \expandafter\expandafter\expandafter + {#1}% +}% +\def\XINT@cntcs #1#2% +{% + \ifnum #1<0 + \xint@afterfi { 0[0]}% + \else + \xint@afterfi {\expandafter\XINT@cntcs@loop\expandafter + {\the\numexpr + #1-1\expandafter\expandafter\expandafter}% + \expandafter\expandafter\expandafter + {\expandafter\expandafter\expandafter + {#2{#1}}}{#2}}% + \fi +}% +\def\XINT@cntcs@loop #1#2#3% +{% + \ifnum #1>-1 \else \XINT@cntcs@exit \fi + \expandafter\XINT@cntcs@loop\expandafter + {\the\numexpr #1-1\expandafter\expandafter\expandafter }% + \expandafter\expandafter\expandafter + {\expandafter\expandafter\expandafter{#3{#1}},#2}{#3}% +}% +\def\XINT@cntcs@exit \fi + \expandafter\XINT@cntcs@loop\expandafter + #1\expandafter\expandafter\expandafter #2#3% +{% + \fi\XINT@cntcs@@exit #2% +}% +\def\XINT@cntcs@@exit #1,{ }% +\def\xintCntoGC {\romannumeral0\xintcntogc }% +\def\xintcntogc #1% +{% + \expandafter\expandafter\expandafter + \XINT@cntgc + \expandafter\expandafter\expandafter + {#1}% +}% +\def\XINT@cntgc #1#2% +{% + \ifnum #1<0 + \xint@afterfi { 0[0]}% + \else + \xint@afterfi {\expandafter\XINT@cntgc@loop\expandafter + {\the\numexpr + #1-1\expandafter\expandafter\expandafter}% + \expandafter\expandafter\expandafter + {\expandafter\expandafter\expandafter + {#2{#1}}}{#2}}% + \fi +}% +\def\XINT@cntgc@loop #1#2#3% +{% + \ifnum #1>-1 \else \XINT@cntgc@exit \fi + \expandafter\XINT@cntgc@loop\expandafter + {\the\numexpr #1-1\expandafter\expandafter\expandafter }% + \expandafter\expandafter\expandafter + {\expandafter\expandafter\expandafter{#3{#1}}+1/#2}{#3}% +}% +\def\XINT@cntgc@exit \fi + \expandafter\XINT@cntgc@loop\expandafter + #1\expandafter\expandafter\expandafter #2#3% +{% + \fi\XINT@cntgc@@exit #2% +}% +\def\XINT@cntgc@@exit #1+1/{ }% +\def\xintGCntoGC {\romannumeral0\xintgcntogc }% +\def\xintgcntogc #1% +{% + \expandafter\expandafter\expandafter + \XINT@gcntgc + \expandafter\expandafter\expandafter + {#1}% +}% +\def\XINT@gcntgc #1#2#3% +{% + \ifnum #1<0 + \xint@afterfi { {0[0]}}% + \else + \xint@afterfi {\expandafter\XINT@gcntgc@loop\expandafter + {\the\numexpr + #1-1\expandafter\expandafter\expandafter}% + \expandafter\expandafter\expandafter + {\expandafter\expandafter\expandafter + {#2{#1}}}{#2}{#3}}% + \fi +}% +\def\XINT@gcntgc@loop #1#2#3#4% +{% + \ifnum #1>-1 \else \XINT@gcntgc@exit \fi + \expandafter\expandafter\expandafter + \XINT@gcntgc@loop@b + \expandafter\expandafter\expandafter + {\expandafter\expandafter\expandafter + {#4{#1}}/#2}{#3{#1}}{#1}{#3}{#4}% +}% +\def\XINT@gcntgc@loop@b #1#2#3% +{% + \expandafter\XINT@gcntgc@loop\expandafter + {\the\numexpr #3-1\expandafter\expandafter\expandafter}% + \expandafter\expandafter\expandafter + {\expandafter\expandafter\expandafter{#2}+#1}% +}% +\def\XINT@gcntgc@exit \fi + \expandafter\expandafter\expandafter + \XINT@gcntgc@loop@b + \expandafter\expandafter\expandafter #1#2#3#4#5% +{% + \fi\XINT@gcntgc@@exit #1% +}% +\def\XINT@gcntgc@@exit #1/{ }% +\def\xintCstoGC {\romannumeral0\xintcstogc }% +\def\xintcstogc #1% +{% + \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,% +{% + \xint@w #2\XINT@cstc@end\W\XINT@cstc@loop@b {#1}{#2}% +}% +\def\XINT@cstc@loop@b #1#2{\XINT@cstc@loop@a {#1+1/{#2}}}% +\def\XINT@cstc@end\W\XINT@cstc@loop@b #1#2{ #1}% +\def\xintGCtoGC {\romannumeral0\xintgctogc }% +\def\xintgctogc #1% +{% + \expandafter\expandafter\expandafter + \XINT@gctgc@start #1+\W/% +}% +\def\XINT@gctgc@start {\XINT@gctgc@loop@a {}}% +\def\XINT@gctgc@loop@a #1#2+#3/% +{% + \xint@w #3\XINT@gctgc@end\W + \expandafter\expandafter\expandafter + \XINT@gctgc@loop@b + \expandafter\expandafter\expandafter + {#2}{#3}{#1}% +}% +\def\XINT@gctgc@loop@b #1#2% +{% + \expandafter\expandafter\expandafter + \XINT@gctgc@loop@c + \expandafter\expandafter\expandafter + {#2}{#1}% +}% +\def\XINT@gctgc@loop@c #1#2#3% +{% + \XINT@gctgc@loop@a {#3{#2}+{#1}/}% +}% +\def\XINT@gctgc@end\W + \expandafter\expandafter\expandafter\XINT@gctgc@loop@b +{% + \expandafter\expandafter\expandafter\XINT@gctgc@@end +}% +\def\XINT@gctgc@@end #1#2#3{ #3{#1}}% +\XINT@cfrac@restorecatcodes@endinput% +\endinput +%% +%% End of file `xintcfrac.sty'. diff --git a/Master/texmf-dist/tex/generic/xint/xintfrac.sty b/Master/texmf-dist/tex/generic/xint/xintfrac.sty index 895d408430b..c4d8d8aaae5 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.03 of April 14, 2013) +%% The xint bundle (version 1.04 of April 25, 2013) %% xintfrac: Expandable operations on fractions %% Copyright (C) 2013 by Jean-Francois Burnol %%---------------------------------------------------------------- @@ -164,7 +164,7 @@ \fi \expandafter\x\csname ver@xintfrac.sty\endcsname \ProvidesPackage{xintfrac}% - [2013/04/14 v1.03 Expandable operations on fractions (jfB)]% + [2013/04/25 v1.04 Expandable operations on fractions (jfB)]% \def\xintLen {\romannumeral0\xintlen }% \def\xintlen #1% {% @@ -205,6 +205,26 @@ {% \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 {% @@ -268,6 +288,30 @@ \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% {% @@ -283,7 +327,7 @@ \ifcase\XINT@isOne {#5} \xint@afterfi { {#4\over #5}}% \or - \xint@afterfi { #4\cdot }% + \xint@afterfi { #4}% \fi }% \def\XINT@fwover@D #1#2#3% @@ -295,38 +339,72 @@ \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 {0}}% -\def\XINT@fsum@loop #1#2% +\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 #2\XINT@fsum@finished\relax - \expandafter\XINT@fsum@loop\expandafter - {\romannumeral0\xintadd {#1}{#2}}% + \xint@relax #1\XINT@fsum@finished\relax + \XINT@fsum@loop@c #1% }% -\def\XINT@fsum@finished #1#2#3#4#5% +\def\XINT@fsum@loop@c #1\Z #2% {% - \XINT@fsum@finished@ #5% + \expandafter\XINT@fsum@loop@a\expandafter + {\romannumeral0\xintadd {#2}{#1}}% }% -\def\XINT@fsum@finished@ #1#2#3#4#5{ #4}% +\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 {1}}% -\def\XINT@fprod@loop #1#2% +\def\XINT@fproductexpr {\XINT@fprod@loop@a {1[0]}}% +\def\XINT@fprod@loop@a #1#2% {% - \xint@relax #2\XINT@fprod@finished\relax - \expandafter\XINT@fprod@loop\expandafter - {\romannumeral0\xintmul {#2}{#1}}% + \expandafter\expandafter\expandafter + \XINT@fprod@loop@b #2\Z {#1}% }% -\def\XINT@fprod@finished #1#2#3#4#5% +\def\XINT@fprod@loop@b #1% {% - \XINT@fprod@finished@ #5% + \xint@relax #1\XINT@fprod@finished\relax + \XINT@fprod@loop@c #1% }% -\def\XINT@fprod@finished@ #1#2#3#4#5{ #5}% +\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% {% @@ -556,7 +634,14 @@ {\the\numexpr #3+#4-#2}{#1}{#5}% }% \def\XINT@rez@E #1#2#3{ #3/#2[#1]}% -\def\XINT@@bts #1#2#3% +\def\xintIrr {\romannumeral0\xintirr }% +\def\xintirr +{% + \expandafter\XINT@irr@putsign + \romannumeral0\expandafter\XINT@irr + \romannumeral0\XINT@infrac +}% +\def\XINT@irr@putsign #1#2#3% {% \ifcase\XINT@isOne {#2} \xint@afterfi {#3#1/#2}% @@ -564,13 +649,6 @@ \xint@afterfi {#3#1}% \fi }% -\def\xintIrr {\romannumeral0\xintirr }% -\def\xintirr -{% - \expandafter\XINT@@bts - \romannumeral0\expandafter\XINT@irr - \romannumeral0\XINT@infrac -}% \def\XINT@irr #1% {% \ifcase\XINT@Sgn {#1} @@ -584,28 +662,25 @@ }% \def\XINT@irr@A #1#2% {% - \expandafter \XINT@irr@AC \expandafter - {\romannumeral0\xint@dsh {#2}{-#1}}% + \expandafter \XINT@irr@C + \romannumeral0\xint@dsh {#2}{-#1}\Z }% -\def\XINT@irr@AC #1#2{\XINT@irr@C #2\Z #1\Z }% \def\XINT@irr@B #1#2#3% {% - \expandafter \XINT@irr@C \romannumeral0\xint@dsh {#3}{#1}\Z #2\Z + \expandafter \XINT@irr@BC \expandafter + {\romannumeral0\xint@dsh {#3}{#1}}{#2}% }% -\def\XINT@irr@C #1#2\Z #3#4\Z +\def\XINT@irr@BC #1#2{\XINT@irr@C #2\Z {#1}}% +\def\XINT@irr@C #1#2\Z {% - \xint@UDsignsfork - #1#3\dummy \XINT@irr@minusminus - #1-\dummy \XINT@irr@minusplus - #3-\dummy \XINT@irr@plusminus - --\dummy \XINT@irr@plusplus + \xint@UDsignfork + #1\dummy \XINT@irr@negative + -\dummy {\XINT@irr@nonneg #1}% \xint@UDkrof - {#4}{#2}#3#1% + #2\Z }% -\def\XINT@irr@minusminus #1#2#3#4{\XINT@irr@D #1\Z #2\Z \space}% -\def\XINT@irr@minusplus #1#2#3#4{\XINT@irr@D #3#1\Z #2\Z \XINT@opp}% -\def\XINT@irr@plusminus #1#2#3#4{\XINT@irr@D #1\Z #4#2\Z \XINT@opp}% -\def\XINT@irr@plusplus #1#2#3#4{\XINT@irr@D #3#1\Z #4#2\Z \space}% +\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 @@ -620,7 +695,7 @@ \space 00}% \def\XINT@irr@divisionbyzero #1#2#3#4{\expandafter\xintError:DivisionByZero \space {#2}0}% -\def\XINT@irr@zero #1#2#3#4{ 0/1}% +\def\XINT@irr@zero #1#2#3#4{ 01}% \def\XINT@irr@nonzero@checkifone #1% {% \ifcase\XINT@isOne {#1} @@ -635,9 +710,9 @@ \expandafter\XINT@irr@loop@d \romannumeral0\XINT@div@prepare {#1}{#2}{#1}% }% -\def\XINT@irr@loop@d #1#2#3% +\def\XINT@irr@loop@d #1#2% {% - \XINT@irr@loop@e #2\Z {#3}% + \XINT@irr@loop@e #2\Z }% \def\XINT@irr@loop@e #1#2\Z {% @@ -656,45 +731,42 @@ \def\xintJrr {\romannumeral0\xintjrr }% \def\xintjrr {% - \expandafter\XINT@@bts - \romannumeral0\expandafter\XINT@jrr@start - \romannumeral0\xintrez + \expandafter\XINT@irr@putsign + \romannumeral0\expandafter\XINT@jrr + \romannumeral0\XINT@infrac }% -\def\XINT@jrr@start #1/#2[#3]% +\def\XINT@jrr #1% {% - \ifcase\XINT@Sgn {#3} + \ifcase\XINT@Sgn {#1} \expandafter\XINT@jrr@B \or \expandafter\XINT@jrr@A \else \expandafter\XINT@jrr@B \fi - {#3}{#1}{#2}% + {#1}% }% \def\XINT@jrr@A #1#2% {% - \expandafter \XINT@jrr@AC \expandafter - {\romannumeral0\xint@dsh {#2}{-#1}}% + \expandafter \XINT@jrr@C + \romannumeral0\xint@dsh {#2}{-#1}\Z }% -\def\XINT@jrr@AC #1#2{\XINT@jrr@C #2\Z #1\Z }% \def\XINT@jrr@B #1#2#3% {% - \expandafter \XINT@jrr@C \romannumeral0\xint@dsh {#3}{#1}\Z #2\Z + \expandafter \XINT@jrr@BC \expandafter + {\romannumeral0\xint@dsh {#3}{#1}}{#2}% }% -\def\XINT@jrr@C #1#2\Z #3#4\Z +\def\XINT@jrr@BC #1#2{\XINT@jrr@C #2\Z {#1}}% +\def\XINT@jrr@C #1#2\Z {% - \xint@UDsignsfork - #1#3\dummy \XINT@jrr@minusminus - #1-\dummy \XINT@jrr@minusplus - #3-\dummy \XINT@jrr@plusminus - --\dummy \XINT@jrr@plusplus + \xint@UDsignfork + #1\dummy \XINT@jrr@negative + -\dummy {\XINT@jrr@nonneg #1}% \xint@UDkrof - {#4}{#2}#3#1% + #2\Z }% -\def\XINT@jrr@minusminus #1#2#3#4{\XINT@jrr@D #1\Z #2\Z \space }% -\def\XINT@jrr@minusplus #1#2#3#4{\XINT@jrr@D #3#1\Z #2\Z \XINT@opp }% -\def\XINT@jrr@plusminus #1#2#3#4{\XINT@jrr@D #1\Z #4#2\Z \XINT@opp }% -\def\XINT@jrr@plusplus #1#2#3#4{\XINT@jrr@D #3#1\Z #4#2\Z \space }% +\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 @@ -709,7 +781,7 @@ \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{ 0/1}% +\def\XINT@jrr@zero #1#2#3#4#5#6{ 01}% \def\XINT@jrr@nonzero@checkifone #1% {% \ifcase\XINT@isOne {#1} @@ -753,11 +825,11 @@ \def\xinttrunc #1% {% \expandafter\expandafter\expandafter - \xint@trunc + \XINT@trunc \expandafter\expandafter\expandafter {#1}% }% -\def\xint@trunc #1#2% +\def\XINT@trunc #1#2% {% \expandafter\XINT@trunc@G \romannumeral0\expandafter\XINT@trunc@A @@ -766,11 +838,11 @@ \def\xintitrunc #1% {% \expandafter\expandafter\expandafter - \xint@itrunc + \XINT@itrunc \expandafter\expandafter\expandafter {#1}% }% -\def\xint@itrunc #1#2% +\def\XINT@itrunc #1#2% {% \expandafter\XINT@itrunc@G \romannumeral0\expandafter\XINT@trunc@A @@ -822,9 +894,9 @@ \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@itrunc@G #1\Z #2#3% +\def\XINT@itrunc@G #1#2\Z #3#4% {% - \xint@zero #2\XINT@trunc@zero 0\xint@firstoftwo {#2#1}0% + \xint@zero #1\XINT@trunc@zero 0\xint@firstoftwo {#3#1#2}0% }% \def\XINT@trunc@G #1\Z #2#3% {% @@ -854,6 +926,76 @@ \expandafter #3\expandafter0\expandafter.% \romannumeral0\XINT@dsx@zeroloop {#1}\Z {}#2% }% +\def\xintRound {\romannumeral0\xintround }% +\def\xintiRound {\romannumeral0\xintiround }% +\def\xintround #1% +{% + \expandafter\expandafter\expandafter + \XINT@round + \expandafter\expandafter\expandafter + {#1}% +}% +\def\XINT@round +{% + \expandafter\XINT@trunc@G\romannumeral0\XINT@round@A +}% +\def\xintiround #1% +{% + \expandafter\expandafter\expandafter + \XINT@iround + \expandafter\expandafter\expandafter + {#1}% +}% +\def\XINT@iround +{% + \expandafter\XINT@itrunc@G\romannumeral0\XINT@round@A +}% +\def\XINT@round@A #1#2% +{% + \expandafter\XINT@round@B + \romannumeral0\expandafter\XINT@trunc@A + \romannumeral0\XINT@infrac {#2}{\the\numexpr #1+1\relax}{#1}% +}% +\def\XINT@round@B #1\Z +{% + \expandafter\XINT@round@C + \romannumeral0\XINT@rord@main {}#1% + \xint@UNDEF + \xint@undef\xint@undef\xint@undef\xint@undef + \xint@undef\xint@undef\xint@undef\xint@undef + \xint@UNDEF + \Z +}% +\def\XINT@round@C #1% +{% + \ifnum #1<5 + \expandafter\XINT@round@Daa + \else + \expandafter\XINT@round@Dba + \fi +}% +\def\XINT@round@Daa #1% +{% + \xint@z #1\XINT@round@Daz\Z \XINT@round@Da #1% +}% +\def\XINT@round@Daz\Z \XINT@round@Da \Z { 0\Z }% +\def\XINT@round@Da #1\Z +{% + \XINT@rord@main {}#1% + \xint@UNDEF + \xint@undef\xint@undef\xint@undef\xint@undef + \xint@undef\xint@undef\xint@undef\xint@undef + \xint@UNDEF \Z +}% +\def\XINT@round@Dba #1% +{% + \xint@z #1\XINT@round@Dbz\Z \XINT@round@Db #1% +}% +\def\XINT@round@Dbz\Z \XINT@round@Db \Z { 1\Z }% +\def\XINT@round@Db #1\Z +{% + \XINT@addm@A 0{}1000\W\X\Y\Z #1000\W\X\Y\Z \Z +}% \def\xintMul {\romannumeral0\xintmul }% \def\xintmul #1% {% diff --git a/Master/texmf-dist/tex/generic/xint/xintgcd.sty b/Master/texmf-dist/tex/generic/xint/xintgcd.sty index 24bd6ef2109..14d36771ab4 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.03 of April 14, 2013) +%% The xint bundle (version 1.04 of April 25, 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/14 v1.03 Euclide algorithm with xint package (jfB)]% + [2013/04/25 v1.04 Euclide algorithm with xint package (jfB)]% \def\xintGCD {\romannumeral0\xintgcd }% \def\xintgcd #1% {% diff --git a/Master/texmf-dist/tex/generic/xint/xintseries.sty b/Master/texmf-dist/tex/generic/xint/xintseries.sty index 6cde51e7928..0412e9e17ef 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.03 of April 14, 2013) +%% The xint bundle (version 1.04 of April 25, 2013) %% xintseries: Expandable partial sums with xint package %% Copyright (C) 2013 by Jean-Francois Burnol %%---------------------------------------------------------------- @@ -162,7 +162,7 @@ \fi \expandafter\x\csname ver@xintseries.sty\endcsname \ProvidesPackage{xintseries}% - [2013/04/14 v1.03 Expandable partial sums with xint package (jfB)]% + [2013/04/25 v1.04 Expandable partial sums with xint package (jfB)]% \def\xintSeries {\romannumeral0\xintseries }% \def\xintseries #1#2% {% @@ -254,38 +254,130 @@ \xint@afterfi { 0[0]}% \else \xint@afterfi - {\expandafter\XINT@powseries@loop@pre\expandafter - {\romannumeral0\xintpow {#4}{#1}}{#1}{#4}{#2}{#3}% - }% + {\XINT@powseries@loop@i {#3{#2}}{#1}{#2}{#3}{#4}}% \fi }% -\def\XINT@powseries@loop@pre #1#2#3#4#5% -{% - \ifnum #4>#2 \else\XINT@powseries@dont@i \fi - \expandafter\XINT@powseries@loop@i\expandafter - {\the\numexpr #2+1\expandafter}\expandafter - {\romannumeral0\xintmul {#5{#2}}{#1}}{#1}{#3}{#4}{#5}% -}% -\def\XINT@powseries@dont@i \fi\expandafter\XINT@powseries@loop@i - {\fi \expandafter\XINT@powseries@dont@ii }% -\def\XINT@powseries@dont@ii #1#2#3#4#5#6{ #2}% \def\XINT@powseries@loop@i #1#2#3#4#5% {% - \ifnum #5>#1 \else \XINT@powseries@exit@i \fi + \ifnum #3>#2 \else\XINT@powseries@exit@i\fi \expandafter\XINT@powseries@loop@ii\expandafter - {\romannumeral0\xintmul {#3}{#4}}{#1}{#4}{#2}{#5}% + {\the\numexpr #3-1\expandafter}\expandafter + {\romannumeral0\xintmul {#1}{#5}}{#2}{#4}{#5}% }% -\def\XINT@powseries@loop@ii #1#2#3#4#5#6% +\def\XINT@powseries@loop@ii #1#2#3#4% {% - \expandafter\XINT@powseries@loop@i\expandafter - {\the\numexpr #2+1\expandafter}\expandafter - {\romannumeral0\xintadd {#4}{\xintMul {#6{#2}}{#1}}}% - {#1}{#3}{#5}{#6}% + \expandafter\XINT@powseries@loop@i\expandafter + {\romannumeral0\xintadd {#4{#1}}{#2}}{#3}{#1}{#4}% +}% +\def\XINT@powseries@exit@i\fi #1#2#3#4#5#6#7#8#9% +{% + \fi \XINT@powseries@exit@ii #6{#7}% }% -\def\XINT@powseries@exit@i\fi \expandafter\XINT@powseries@loop@ii - {\fi \expandafter\XINT@powseries@exit@ii }% \def\XINT@powseries@exit@ii #1#2#3#4#5#6% - {\xintadd {#4}{\xintMul {#6{#2}}{#1}}}% +{% + \xintmul{\xintPow {#5}{#6}}{#4}% +}% +\def\xintPowerSeriesX {\romannumeral0\xintpowerseriesx }% +\def\xintpowerseriesx #1#2% +{% + \expandafter\expandafter\expandafter + \XINT@powseriesx@i + \expandafter\expandafter\expandafter + {#2}{#1}% +}% +\def\XINT@powseriesx@i #1#2% +{% + \expandafter\expandafter\expandafter + \XINT@powseriesx@ii + \expandafter\expandafter\expandafter + {#2}{#1}% +}% +\def\XINT@powseriesx@ii #1#2#3#4% +{% + \ifnum #2<#1 + \xint@afterfi { 0[0]}% + \else + \xint@afterfi + {\expandafter\expandafter\expandafter\XINT@powseriesx@pre + \expandafter\expandafter\expandafter {#4}{#1}{#2}{#3}}% + \fi +}% +\def\XINT@powseriesx@pre #1#2#3#4% +{% + \XINT@powseries@loop@i {#4{#3}}{#2}{#3}{#4}{#1}% +}% +\def\xintRationalSeries {\romannumeral0\xintratseries }% +\def\xintratseries #1#2% +{% + \expandafter\expandafter\expandafter + \XINT@ratseries@i + \expandafter\expandafter\expandafter + {#2}{#1}% +}% +\def\XINT@ratseries@i #1#2% +{% + \expandafter\expandafter\expandafter + \XINT@ratseries@ii + \expandafter\expandafter\expandafter + {#2}{#1}% +}% +\def\XINT@ratseries@ii #1#2#3#4% +{% + \ifnum #2<#1 + \xint@afterfi { 0[0]}% + \else + \xint@afterfi + {\XINT@ratseries@loop {#2}{1}{#1}{#4}{#3}}% + \fi +}% +\def\XINT@ratseries@loop #1#2#3#4% +{% + \ifnum #1>#3 \else\XINT@ratseries@exit@i\fi + \expandafter\XINT@ratseries@loop\expandafter + {\the\numexpr #1-1\expandafter}\expandafter + {\romannumeral0\xintadd {1}{\xintMul {#2}{#4{#1}}}}{#3}{#4}% +}% +\def\XINT@ratseries@exit@i\fi #1#2#3#4#5#6#7#8% +{% + \fi \XINT@ratseries@exit@ii #6% +}% +\def\XINT@ratseries@exit@ii #1#2#3#4#5% +{% + \XINT@ratseries@exit@iii #5% +}% +\def\XINT@ratseries@exit@iii #1#2#3#4% +{% + \xintmul{#2}{#4}% +}% +\def\xintRationalSeriesX {\romannumeral0\xintratseriesx }% +\def\xintratseriesx #1#2% +{% + \expandafter\expandafter\expandafter + \XINT@ratseriesx@i + \expandafter\expandafter\expandafter + {#2}{#1}% +}% +\def\XINT@ratseriesx@i #1#2% +{% + \expandafter\expandafter\expandafter + \XINT@ratseriesx@ii + \expandafter\expandafter\expandafter + {#2}{#1}% +}% +\def\XINT@ratseriesx@ii #1#2#3#4#5% +{% + \ifnum #2<#1 + \xint@afterfi { 0[0]}% + \else + \xint@afterfi + {\expandafter\expandafter\expandafter\XINT@ratseriesx@pre + \expandafter\expandafter\expandafter {#5}{#2}{#1}{#4}{#3}}% + \fi +}% +\def\XINT@ratseriesx@pre #1#2#3#4#5% +{% + \XINT@ratseries@loop {#2}{1}{#3}{#4{#1}}{#5{#1}}% +}% \def\xintFxPtPowerSeries {\romannumeral0\xintfxptpowerseries }% \def\xintfxptpowerseries #1#2% {% @@ -304,7 +396,7 @@ \def\XINT@fppowseries@ii #1#2#3#4#5% {% \ifnum #2<#1 - \xint@afterfi {\xinttrunc {#5}{0[0]}}% + \xint@afterfi { 0}% \else \xint@afterfi {\expandafter\XINT@fppowseries@loop@pre\expandafter @@ -343,6 +435,40 @@ \def\XINT@fppowseries@exit@ii #1#2#3#4#5#6#7% {\xinttrunc {#7}% {\xintiAdd {#4}{\xintiTrunc {#7}{\xintMul {#6{#2}}{#1}}}[-#7]}}% +\def\xintFxPtPowerSeriesX {\romannumeral0\xintfxptpowerseriesx }% +\def\xintfxptpowerseriesx #1#2% +{% + \expandafter\expandafter\expandafter + \XINT@fppowseriesx@i + \expandafter\expandafter\expandafter + {#2}{#1}% +}% +\def\XINT@fppowseriesx@i #1#2% +{% + \expandafter\expandafter\expandafter + \XINT@fppowseriesx@ii + \expandafter\expandafter\expandafter + {#2}{#1}% +}% +\def\XINT@fppowseriesx@ii #1#2#3#4#5% +{% + \ifnum #2<#1 + \xint@afterfi { 0}% + \else + \xint@afterfi + {\expandafter\expandafter\expandafter + \XINT@fppowseriesx@pre + \expandafter\expandafter\expandafter + {#4}{#1}{#2}{#3}{#5}% + }% + \fi +}% +\def\XINT@fppowseriesx@pre #1#2#3#4#5% +{% + \expandafter\XINT@fppowseries@loop@pre\expandafter + {\romannumeral0\xinttrunc {#5}{\xintPow {#1}{#2}}}% + {#2}{#1}{#3}{#4}{#5}% +}% \XINT@series@restorecatcodes@endinput% \endinput %% -- cgit v1.2.3