%% %% This is file `xintseries.sty', %% generated with the docstrip utility. %% %% The original source files were: %% %% xint.dtx (with options: `xintseries') %% %% IMPORTANT NOTICE: %% %% For the copyright see the source file. %% %% Any modified versions of this file must be renamed %% with new filenames distinct from xintseries.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 1.2g 2016/03/19 %% Copyright (C) 2013-2016 by Jean-Francois Burnol %% xintseries: Expandable partial sums with xint package %% --------------------------------------------------------------- \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 % : \let\z\endgroup \expandafter\let\expandafter\x\csname ver@xintseries.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{xintseries}{\numexpr not available, aborting input}% \aftergroup\endinput \else \ifx\x\relax % plain-TeX, first loading of xintseries.sty \ifx\w\relax % but xintfrac.sty not yet loaded. \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. \def\z{\endgroup\RequirePackage{xintfrac}}% \fi \else \aftergroup\endinput % xintseries already loaded. \fi \fi \fi \z% \XINTsetupcatcodes% defined in xintkernel.sty \XINT_providespackage \ProvidesPackage{xintseries}% [2016/03/19 1.2g Expandable partial sums with xint package (JFB)]% \def\xintSeries {\romannumeral0\xintseries }% \def\xintseries #1#2% {% \expandafter\XINT_series\expandafter {\the\numexpr #1\expandafter}\expandafter{\the\numexpr #2}% }% \def\XINT_series #1#2#3% {% \ifnum #2<#1 \xint_afterfi { 0/1[0]}% \else \xint_afterfi {\XINT_series_loop {#1}{0}{#2}{#3}}% \fi }% \def\XINT_series_loop #1#2#3#4% {% \ifnum #3>#1 \else \XINT_series_exit \fi \expandafter\XINT_series_loop\expandafter {\the\numexpr #1+1\expandafter }\expandafter {\romannumeral0\xintadd {#2}{#4{#1}}}% {#3}{#4}% }% \def\XINT_series_exit \fi #1#2#3#4#5#6#7#8% {% \fi\xint_gobble_ii #6% }% \def\xintiSeries {\romannumeral0\xintiseries }% \def\xintiseries #1#2% {% \expandafter\XINT_iseries\expandafter {\the\numexpr #1\expandafter}\expandafter{\the\numexpr #2}% }% \def\XINT_iseries #1#2#3% {% \ifnum #2<#1 \xint_afterfi { 0}% \else \xint_afterfi {\XINT_iseries_loop {#1}{0}{#2}{#3}}% \fi }% \def\XINT_iseries_loop #1#2#3#4% {% \ifnum #3>#1 \else \XINT_iseries_exit \fi \expandafter\XINT_iseries_loop\expandafter {\the\numexpr #1+1\expandafter }\expandafter {\romannumeral0\xintiiadd {#2}{#4{#1}}}% {#3}{#4}% }% \def\XINT_iseries_exit \fi #1#2#3#4#5#6#7#8% {% \fi\xint_gobble_ii #6% }% \def\xintPowerSeries {\romannumeral0\xintpowerseries }% \def\xintpowerseries #1#2% {% \expandafter\XINT_powseries\expandafter {\the\numexpr #1\expandafter}\expandafter{\the\numexpr #2}% }% \def\XINT_powseries #1#2#3#4% {% \ifnum #2<#1 \xint_afterfi { 0/1[0]}% \else \xint_afterfi {\XINT_powseries_loop_i {#3{#2}}{#1}{#2}{#3}{#4}}% \fi }% \def\XINT_powseries_loop_i #1#2#3#4#5% {% \ifnum #3>#2 \else\XINT_powseries_exit_i\fi \expandafter\XINT_powseries_loop_ii\expandafter {\the\numexpr #3-1\expandafter}\expandafter {\romannumeral0\xintmul {#1}{#5}}{#2}{#4}{#5}% }% \def\XINT_powseries_loop_ii #1#2#3#4% {% \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_ii #1#2#3#4#5#6% {% \xintmul{\xintPow {#5}{#6}}{#4}% }% \def\xintPowerSeriesX {\romannumeral0\xintpowerseriesx }% \def\xintpowerseriesx #1#2% {% \expandafter\XINT_powseriesx\expandafter {\the\numexpr #1\expandafter}\expandafter{\the\numexpr #2}% }% \def\XINT_powseriesx #1#2#3#4% {% \ifnum #2<#1 \xint_afterfi { 0/1[0]}% \else \xint_afterfi {\expandafter\XINT_powseriesx_pre\expandafter {\romannumeral`&&@#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\XINT_ratseries\expandafter {\the\numexpr #1\expandafter}\expandafter{\the\numexpr #2}% }% \def\XINT_ratseries #1#2#3#4% {% \ifnum #2<#1 \xint_afterfi { 0/1[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\XINT_ratseriesx\expandafter {\the\numexpr #1\expandafter}\expandafter{\the\numexpr #2}% }% \def\XINT_ratseriesx #1#2#3#4#5% {% \ifnum #2<#1 \xint_afterfi { 0/1[0]}% \else \xint_afterfi {\expandafter\XINT_ratseriesx_pre\expandafter {\romannumeral`&&@#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% {% \expandafter\XINT_fppowseries\expandafter {\the\numexpr #1\expandafter}\expandafter{\the\numexpr #2}% }% \def\XINT_fppowseries #1#2#3#4#5% {% \ifnum #2<#1 \xint_afterfi { 0}% \else \xint_afterfi {\expandafter\XINT_fppowseries_loop_pre\expandafter {\romannumeral0\xinttrunc {#5}{\xintPow {#4}{#1}}}% {#1}{#4}{#2}{#3}{#5}% }% \fi }% \def\XINT_fppowseries_loop_pre #1#2#3#4#5#6% {% \ifnum #4>#2 \else\XINT_fppowseries_dont_i \fi \expandafter\XINT_fppowseries_loop_i\expandafter {\the\numexpr #2+\xint_c_i\expandafter}\expandafter {\romannumeral0\xintitrunc {#6}{\xintMul {#5{#2}}{#1}}}% {#1}{#3}{#4}{#5}{#6}% }% \def\XINT_fppowseries_dont_i \fi\expandafter\XINT_fppowseries_loop_i {\fi \expandafter\XINT_fppowseries_dont_ii }% \def\XINT_fppowseries_dont_ii #1#2#3#4#5#6#7{\xinttrunc {#7}{#2[-#7]}}% \def\XINT_fppowseries_loop_i #1#2#3#4#5#6#7% {% \ifnum #5>#1 \else \XINT_fppowseries_exit_i \fi \expandafter\XINT_fppowseries_loop_ii\expandafter {\romannumeral0\xinttrunc {#7}{\xintMul {#3}{#4}}}% {#1}{#4}{#2}{#5}{#6}{#7}% }% \def\XINT_fppowseries_loop_ii #1#2#3#4#5#6#7% {% \expandafter\XINT_fppowseries_loop_i\expandafter {\the\numexpr #2+\xint_c_i\expandafter}\expandafter {\romannumeral0\xintiiadd {#4}{\xintiTrunc {#7}{\xintMul {#6{#2}}{#1}}}}% {#1}{#3}{#5}{#6}{#7}% }% \def\XINT_fppowseries_exit_i\fi\expandafter\XINT_fppowseries_loop_ii {\fi \expandafter\XINT_fppowseries_exit_ii }% \def\XINT_fppowseries_exit_ii #1#2#3#4#5#6#7% {% \xinttrunc {#7} {\xintiiadd {#4}{\xintiTrunc {#7}{\xintMul {#6{#2}}{#1}}}[-#7]}% }% \def\xintFxPtPowerSeriesX {\romannumeral0\xintfxptpowerseriesx }% \def\xintfxptpowerseriesx #1#2% {% \expandafter\XINT_fppowseriesx\expandafter {\the\numexpr #1\expandafter}\expandafter{\the\numexpr #2}% }% \def\XINT_fppowseriesx #1#2#3#4#5% {% \ifnum #2<#1 \xint_afterfi { 0}% \else \xint_afterfi {\expandafter \XINT_fppowseriesx_pre \expandafter {\romannumeral`&&@#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}% }% \def\xintFloatPowerSeries {\romannumeral0\xintfloatpowerseries }% \def\xintfloatpowerseries #1{\XINT_flpowseries_chkopt #1\xint_relax }% \def\XINT_flpowseries_chkopt #1% {% \ifx [#1\expandafter\XINT_flpowseries_opt \else\expandafter\XINT_flpowseries_noopt \fi #1% }% \def\XINT_flpowseries_noopt #1\xint_relax #2% {% \expandafter\XINT_flpowseries\expandafter {\the\numexpr #1\expandafter}\expandafter {\the\numexpr #2}\XINTdigits }% \def\XINT_flpowseries_opt [\xint_relax #1]#2#3% {% \expandafter\XINT_flpowseries\expandafter {\the\numexpr #2\expandafter}\expandafter {\the\numexpr #3\expandafter}{\the\numexpr #1}% }% \def\XINT_flpowseries #1#2#3#4#5% {% \ifnum #2<#1 \xint_afterfi { 0.e0}% \else \xint_afterfi {\expandafter\XINT_flpowseries_loop_pre\expandafter {\romannumeral0\XINTinfloatpow [#3]{#5}{#1}}% {#1}{#5}{#2}{#4}{#3}% }% \fi }% \def\XINT_flpowseries_loop_pre #1#2#3#4#5#6% {% \ifnum #4>#2 \else\XINT_flpowseries_dont_i \fi \expandafter\XINT_flpowseries_loop_i\expandafter {\the\numexpr #2+\xint_c_i\expandafter}\expandafter {\romannumeral0\XINTinfloatmul [#6]{#5{#2}}{#1}}% {#1}{#3}{#4}{#5}{#6}% }% \def\XINT_flpowseries_dont_i \fi\expandafter\XINT_flpowseries_loop_i {\fi \expandafter\XINT_flpowseries_dont_ii }% \def\XINT_flpowseries_dont_ii #1#2#3#4#5#6#7{\xintfloat [#7]{#2}}% \def\XINT_flpowseries_loop_i #1#2#3#4#5#6#7% {% \ifnum #5>#1 \else \XINT_flpowseries_exit_i \fi \expandafter\XINT_flpowseries_loop_ii\expandafter {\romannumeral0\XINTinfloatmul [#7]{#3}{#4}}% {#1}{#4}{#2}{#5}{#6}{#7}% }% \def\XINT_flpowseries_loop_ii #1#2#3#4#5#6#7% {% \expandafter\XINT_flpowseries_loop_i\expandafter {\the\numexpr #2+\xint_c_i\expandafter}\expandafter {\romannumeral0\XINTinfloatadd [#7]{#4}% {\XINTinfloatmul [#7]{#6{#2}}{#1}}}% {#1}{#3}{#5}{#6}{#7}% }% \def\XINT_flpowseries_exit_i\fi\expandafter\XINT_flpowseries_loop_ii {\fi \expandafter\XINT_flpowseries_exit_ii }% \def\XINT_flpowseries_exit_ii #1#2#3#4#5#6#7% {% \xintfloatadd [#7]{#4}{\XINTinfloatmul [#7]{#6{#2}}{#1}}% }% \def\xintFloatPowerSeriesX {\romannumeral0\xintfloatpowerseriesx }% \def\xintfloatpowerseriesx #1{\XINT_flpowseriesx_chkopt #1\xint_relax }% \def\XINT_flpowseriesx_chkopt #1% {% \ifx [#1\expandafter\XINT_flpowseriesx_opt \else\expandafter\XINT_flpowseriesx_noopt \fi #1% }% \def\XINT_flpowseriesx_noopt #1\xint_relax #2% {% \expandafter\XINT_flpowseriesx\expandafter {\the\numexpr #1\expandafter}\expandafter {\the\numexpr #2}\XINTdigits }% \def\XINT_flpowseriesx_opt [\xint_relax #1]#2#3% {% \expandafter\XINT_flpowseriesx\expandafter {\the\numexpr #2\expandafter}\expandafter {\the\numexpr #3\expandafter}{\the\numexpr #1}% }% \def\XINT_flpowseriesx #1#2#3#4#5% {% \ifnum #2<#1 \xint_afterfi { 0.e0}% \else \xint_afterfi {\expandafter \XINT_flpowseriesx_pre \expandafter {\romannumeral`&&@#5}{#1}{#2}{#4}{#3}% }% \fi }% \def\XINT_flpowseriesx_pre #1#2#3#4#5% {% \expandafter\XINT_flpowseries_loop_pre\expandafter {\romannumeral0\XINTinfloatpow [#5]{#1}{#2}}% {#2}{#1}{#3}{#4}{#5}% }% \XINT_restorecatcodes_endinput% \endinput %% %% End of file `xintseries.sty'.