From 04fd1776023ee2133a059a5a7c0974705552be89 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 27 May 2013 05:00:41 +0000 Subject: xint update (5/27) git-svn-id: svn://tug.org/texlive/trunk@30723 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/generic/xint/xint.sty | 51 +- Master/texmf-dist/tex/generic/xint/xintcfrac.sty | 57 +- Master/texmf-dist/tex/generic/xint/xintexpr.sty | 769 ++++++++++++++++++++++ Master/texmf-dist/tex/generic/xint/xintfrac.sty | 743 ++++++++++++++++++++- Master/texmf-dist/tex/generic/xint/xintgcd.sty | 4 +- Master/texmf-dist/tex/generic/xint/xintseries.sty | 4 +- 6 files changed, 1549 insertions(+), 79 deletions(-) create mode 100644 Master/texmf-dist/tex/generic/xint/xintexpr.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 c296158f940..b740ecda4a6 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.06b of May 14, 2013) +%% The xint bundle (version 1.07a of May 26, 2013) %% xint: Expandable operations on long numbers %% Copyright (C) 2013 by Jean-Francois Burnol %%---------------------------------------------------------------- @@ -138,7 +138,7 @@ \fi \expandafter\x\csname ver@xint.sty\endcsname \ProvidesPackage{xint}% - [2013/05/14 v1.06b Expandable operations on long numbers (jfB)]% + [2013/05/26 v1.07a Expandable operations on long numbers (jfB)]% \def\xint_gobble_ {}% \def\xint_gobble_i #1{}% \def\xint_gobble_ii #1#2{}% @@ -153,6 +153,9 @@ \def\xint_firstoftwo_andstop #1#2{ #1}% \def\xint_secondoftwo_andstop #1#2{ #2}% \def\xint_exchangetwo_keepbraces_andstop #1#2{ {#2}{#1}}% +\def\xint_firstofthree #1#2#3{#1}% +\def\xint_secondofthree #1#2#3{#2}% +\def\xint_thirdofthree #1#2#3{#3}% \def\xint_minus_andstop { -}% \def\xint_gob_til_r #1\R {}% \def\xint_gob_til_w #1\W {}% @@ -213,13 +216,13 @@ \def\xintRevWithBracesNoExpand {\romannumeral0\xintrevwithbracesnoexpand }% \def\xintrevwithbraces #1% {% - \expandafter\XINT_revwbr_loop % #1 empty ok + \expandafter\XINT_revwbr_loop\expandafter{\expandafter}% \romannumeral-`0#1\xint_relax\xint_relax\xint_relax\xint_relax \xint_relax\xint_relax\xint_relax\xint_relax\Z }% \def\xintrevwithbracesnoexpand #1% {% - \romannumeral0\XINT_revwbr_loop + \romannumeral0\XINT_revwbr_loop\expandafter{\expandafter}% #1\xint_relax\xint_relax\xint_relax\xint_relax \xint_relax\xint_relax\xint_relax\xint_relax\Z }% @@ -305,6 +308,7 @@ \def\XINT_length_finish_c #1#2\Z #3% {\expandafter\space\the\numexpr #3-#1\relax}% \def\xintCSVtoList {\romannumeral0\xintcsvtolist }% +\def\xintCSVtoListNoExpand {\romannumeral0\xintcsvtolistnoexpand }% \def\xintcsvtolist #1% {% \expandafter\XINT_csvtol_loop_a\expandafter @@ -312,6 +316,12 @@ ,\xint_undef,\xint_undef,\xint_undef,\xint_undef ,\xint_undef,\xint_undef,\xint_undef,\xint_undef,\Z }% +\def\xintcsvtolistnoexpand #1% +{% + \romannumeral0\XINT_csvtol_loop_a + {}#1,\xint_undef,\xint_undef,\xint_undef,\xint_undef + ,\xint_undef,\xint_undef,\xint_undef,\xint_undef,\Z +}% \def\XINT_csvtol_loop_a #1#2,#3,#4,#5,#6,#7,#8,#9,% {% \xint_gob_til_xint_undef #9\XINT_csvtol_finish_a\xint_undef @@ -348,9 +358,12 @@ \def\XINT_csvtol_finish_di #1#2#3#4#5#6#7#8#9% { #9{#1}{#2}{#3}{#4}{#5}{#6}{#7}}% \def\xintListWithSep {\romannumeral0\xintlistwithsep }% +\def\xintListWithSepNoExpand {\romannumeral0\xintlistwithsepnoexpand }% \long\def\xintlistwithsep #1#2% {\expandafter\XINT_lws\expandafter {\romannumeral-`0#2}{#1}}% \long\def\XINT_lws #1#2{\XINT_lws_start {#2}#1\Z }% +\long\def\xintlistwithsepnoexpand #1#2% + {\romannumeral0\XINT_lws_start {#1}#2\Z }% \long\def\XINT_lws_start #1#2% {% \xint_gob_til_z #2\XINT_lws_dont\Z @@ -365,11 +378,16 @@ \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\xintNthElt {\romannumeral0\xintnthelt }% +\def\xintNthEltNoExpand {\romannumeral0\xintntheltnoexpand }% \def\xintnthelt #1#2% {% \expandafter\XINT_nthelt\expandafter {\romannumeral-`0#2}% {\numexpr #1\relax }% }% +\def\xintntheltnoexpand #1#2% +{% + \romannumeral0\XINT_nthelt {#2}{\numexpr #1\relax}% +}% \def\XINT_nthelt #1#2% {% \ifnum #2>0 @@ -407,12 +425,14 @@ \krof }% \def\xintApply {\romannumeral0\xintapply }% +\def\xintApplyNoExpand {\romannumeral0\xintapplynoexpand }% \def\xintapply #1#2% {% \expandafter\XINT_apply\expandafter {\romannumeral-`0#2}% {#1}% }% \def\XINT_apply #1#2{\XINT_apply_loop_a {}{#2}#1\Z }% +\def\xintapplynoexpand #1#2{\romannumeral0\XINT_apply_loop_a {}{#1}#2\Z }% \def\XINT_apply_loop_a #1#2#3% {% \xint_gob_til_z #3\XINT_apply_end\Z @@ -423,12 +443,15 @@ \def\XINT_apply_loop_b #1#2{\XINT_apply_loop_a {#2{#1}}}% \def\XINT_apply_end\Z\expandafter\XINT_apply_loop_b\expandafter #1#2#3{ #2}% \def\xintApplyUnbraced {\romannumeral0\xintapplyunbraced }% +\def\xintApplyUnbracedNoExpand {\romannumeral0\xintapplyunbracednoexpand }% \def\xintapplyunbraced #1#2% {% \expandafter\XINT_applyunbr\expandafter {\romannumeral-`0#2}% {#1}% }% \def\XINT_applyunbr #1#2{\XINT_applyunbr_loop_a {}{#2}#1\Z }% +\def\xintapplyunbracednoexpand #1#2% + {\romannumeral0\XINT_applyunbr_loop_a {}{#1}#2\Z }% \def\XINT_applyunbr_loop_a #1#2#3% {% \xint_gob_til_z #3\XINT_applyunbr_end\Z @@ -680,6 +703,14 @@ 0-\dummy { 1}% \krof }% +\def\xintSgnFork {\romannumeral0\xintsgnfork }% +\def\xintsgnfork #1% +{% + \ifcase #1 \xint_afterfi{\expandafter\space\xint_secondofthree}% + \or\xint_afterfi{\expandafter\space\xint_thirdofthree}% + \else\xint_afterfi{\expandafter\space\xint_firstofthree}% + \fi +}% \def\xintiOpp {\romannumeral0\xintiopp }% \def\xintiopp #1% {% @@ -2953,7 +2984,7 @@ \def\XINT_dsx_xisNeg_checkA_ #1#2\Z #3% {% \xint_gob_til_zero #1\XINT_dsx_xisNeg_Azero 0% - \XINT_dsx_xisNeg_checkx {#3}{#3}\Z {#1#2}% + \XINT_dsx_xisNeg_checkx {#3}{#3}{}\Z {#1#2}% }% \def\XINT_dsx_xisNeg_Azero #1\Z #2{ 0}% \def\XINT_dsx_xisNeg_checkx #1% @@ -2961,25 +2992,25 @@ \ifnum #1>999999999 \xint_afterfi {\xintError:TooBigDecimalShift - \expandafter\space\expandafter 0\xint_gobble_iii }% + \expandafter\space\expandafter 0\xint_gobble_iv }% \else \expandafter \XINT_dsx_zeroloop \fi }% -\def\XINT_dsx_zeroloop #1% +\def\XINT_dsx_zeroloop #1#2% {% \ifnum #1<9 \XINT_dsx_exita\fi \expandafter\XINT_dsx_zeroloop\expandafter - {\the\numexpr #1-8}00000000% + {\the\numexpr #1-8}{#200000000}% }% \def\XINT_dsx_exita\fi\expandafter\XINT_dsx_zeroloop {% \fi\expandafter\XINT_dsx_exitb }% -\def\XINT_dsx_exitb #1% +\def\XINT_dsx_exitb #1#2% {% \expandafter\expandafter\expandafter - \XINT_dsx_addzeros\csname xint_gobble_\romannumeral -#1\endcsname + \XINT_dsx_addzeros\csname xint_gobble_\romannumeral -#1\endcsname #2% }% \def\XINT_dsx_addzeros #1\Z #2{ #2#1}% \def\XINT_dsx_xisPos #1\Z #2% diff --git a/Master/texmf-dist/tex/generic/xint/xintcfrac.sty b/Master/texmf-dist/tex/generic/xint/xintcfrac.sty index 7cbe6299ef0..561738a7b02 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.06b of May 14, 2013) +%% The xint bundle (version 1.07a of May 26, 2013) %% xintcfrac: Expandable continued fractions with xint package %% Copyright (C) 2013 by Jean-Francois Burnol %%---------------------------------------------------------------- @@ -164,7 +164,7 @@ \fi \expandafter\x\csname ver@xintcfrac.sty\endcsname \ProvidesPackage{xintcfrac}% - [2013/05/14 v1.06b Expandable continued fractions with xint package (jfB)]% + [2013/05/26 v1.07a Expandable continued fractions with xint package (jfB)]% \def\xintCFrac {\romannumeral0\xintcfrac }% \def\xintcfrac #1% {% @@ -176,7 +176,7 @@ }% \def\XINT_cfrac_noopt #1\Z {% - \expandafter\XINT_cfrac_A\romannumeral0\xintraw {#1}\Z + \expandafter\XINT_cfrac_A\romannumeral0\xintrawwithzeros {#1}\Z \relax\relax }% \def\XINT_cfrac_opt_b\fi\XINT_cfrac_noopt [\Z #1]% @@ -185,17 +185,17 @@ }% \def\XINT_cfrac_optl #1% {% - \expandafter\XINT_cfrac_A\romannumeral0\xintraw {#1}\Z + \expandafter\XINT_cfrac_A\romannumeral0\xintrawwithzeros {#1}\Z \relax\hfill }% \def\XINT_cfrac_optc #1% {% - \expandafter\XINT_cfrac_A\romannumeral0\xintraw {#1}\Z + \expandafter\XINT_cfrac_A\romannumeral0\xintrawwithzeros {#1}\Z \relax\relax }% \def\XINT_cfrac_optr #1% {% - \expandafter\XINT_cfrac_A\romannumeral0\xintraw {#1}\Z + \expandafter\XINT_cfrac_A\romannumeral0\xintrawwithzeros {#1}\Z \hfill\relax }% \def\XINT_cfrac_A #1/#2\Z @@ -240,10 +240,7 @@ }% \def\XINT_cfrac__end \Z+\cfrac#1#2{ #2}% \def\xintGCFrac {\romannumeral0\xintgcfrac }% -\def\xintgcfrac #1% -{% - \XINT_gcfrac_opt_a #1\Z -}% +\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% @@ -315,7 +312,7 @@ \def\xintFtoCs {\romannumeral0\xintftocs }% \def\xintftocs #1% {% - \expandafter\XINT_ftc_A\romannumeral0\xintraw {#1}\Z + \expandafter\XINT_ftc_A\romannumeral0\xintrawwithzeros {#1}\Z }% \def\XINT_ftc_A #1/#2\Z {% @@ -351,7 +348,7 @@ \def\xintFtoCx {\romannumeral0\xintftocx }% \def\xintftocx #1#2% {% - \expandafter\XINT_ftcx_A\romannumeral0\xintraw {#2}\Z {#1}% + \expandafter\XINT_ftcx_A\romannumeral0\xintrawwithzeros {#2}\Z {#1}% }% \def\XINT_ftcx_A #1/#2\Z {% @@ -389,12 +386,12 @@ \def\xintFtoCC {\romannumeral0\xintftocc }% \def\xintftocc #1% {% - \expandafter\XINT_ftcc_A\expandafter {\romannumeral0\xintraw {#1}}% + \expandafter\XINT_ftcc_A\expandafter {\romannumeral0\xintrawwithzeros {#1}}% }% \def\XINT_ftcc_A #1% {% \expandafter\XINT_ftcc_B - \romannumeral0\xintraw {\xintAdd {1/2[0]}{#1[0]}}\Z {#1[0]}% + \romannumeral0\xintrawwithzeros {\xintAdd {1/2[0]}{#1[0]}}\Z {#1[0]}% }% \def\XINT_ftcc_B #1/#2\Z {% @@ -426,7 +423,7 @@ \def\XINT_ftcc_loop_a #1% {% \expandafter\XINT_ftcc_loop_b - \romannumeral0\xintraw {\xintAdd {1/2[0]}{#1}}\Z {#1}% + \romannumeral0\xintrawwithzeros {\xintAdd {1/2[0]}{#1}}\Z {#1}% }% \def\XINT_ftcc_loop_b #1/#2\Z {% @@ -480,7 +477,7 @@ {% \xint_gob_til_w #5\XINT_cstf_end\W \expandafter\XINT_cstf_loop_b - \romannumeral0\xintraw {#5}.{#1}{#2}{#3}{#4}% + \romannumeral0\xintrawwithzeros {#5}.{#1}{#2}{#3}{#4}% }% \def\XINT_cstf_loop_b #1/#2.#3#4#5#6% {% @@ -502,7 +499,7 @@ {% \expandafter\XINT_cstf_loop_a\expandafter{#2}#1% }% -\def\XINT_cstf_end #1.#2#3#4#5{\xintraw {#2/#3}[0]}% +\def\XINT_cstf_end #1.#2#3#4#5{\xintrawwithzeros {#2/#3}[0]}% \def\xintiCstoF {\romannumeral0\xinticstof }% \def\xinticstof #1% {% @@ -529,7 +526,7 @@ {% \expandafter\XINT_icstf_loop_a\expandafter {#2}{#1}% }% -\def\XINT_icstf_end#1.#2#3#4#5{\xintraw {#2/#3}[0]}% +\def\XINT_icstf_end#1.#2#3#4#5{\xintrawwithzeros {#2/#3}[0]}% \def\xintGCtoF {\romannumeral0\xintgctof }% \def\xintgctof #1% {% @@ -542,7 +539,7 @@ \def\XINT_gctf_loop_a #1#2#3#4#5+% {% \expandafter\XINT_gctf_loop_b - \romannumeral0\xintraw {#5}.{#1}{#2}{#3}{#4}% + \romannumeral0\xintrawwithzeros {#5}.{#1}{#2}{#3}{#4}% }% \def\XINT_gctf_loop_b #1/#2.#3#4#5#6% {% @@ -568,7 +565,7 @@ {% \xint_gob_til_w #2\XINT_gctf_end\W \expandafter\XINT_gctf_loop_g - \romannumeral0\xintraw {#2}.#1% + \romannumeral0\xintrawwithzeros {#2}.#1% }% \def\XINT_gctf_loop_g #1/#2.#3#4#5#6% {% @@ -590,7 +587,7 @@ {% \expandafter\XINT_gctf_loop_a\expandafter {#2}#1% }% -\def\XINT_gctf_end #1.#2#3#4#5{\xintraw {#2/#3}[0]}% +\def\XINT_gctf_end #1.#2#3#4#5{\xintrawwithzeros {#2/#3}[0]}% \def\xintiGCtoF {\romannumeral0\xintigctof }% \def\xintigctof #1% {% @@ -636,7 +633,7 @@ {% \XINT_igctf_loop_a {#3}{#4}{#1}{#2}% }% -\def\XINT_igctf_end #1.#2#3#4#5{\xintraw {#4/#5}[0]}% +\def\XINT_igctf_end #1.#2#3#4#5{\xintrawwithzeros {#4/#5}[0]}% \def\xintCstoCv {\romannumeral0\xintcstocv }% \def\xintcstocv #1% {% @@ -650,7 +647,7 @@ {% \xint_gob_til_w #6\XINT_cstcv_end\W \expandafter\XINT_cstcv_loop_b - \romannumeral0\xintraw {#6}.{#2}{#3}{#4}{#5}{#1}% + \romannumeral0\xintrawwithzeros {#6}.{#2}{#3}{#4}{#5}{#1}% }% \def\XINT_cstcv_loop_b #1/#2.#3#4#5#6% {% @@ -675,7 +672,7 @@ \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}% + {\romannumeral0\xintrawwithzeros {#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}% @@ -708,7 +705,7 @@ \def\XINT_icstcv_loop_d #1#2% {% \expandafter\XINT_icstcv_loop_e\expandafter - {\romannumeral0\xintraw {#1/#2}}{{#1}{#2}}% + {\romannumeral0\xintrawwithzeros {#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}% @@ -724,7 +721,7 @@ \def\XINT_gctcv_loop_a #1#2#3#4#5#6+% {% \expandafter\XINT_gctcv_loop_b - \romannumeral0\xintraw {#6}.{#2}{#3}{#4}{#5}{#1}% + \romannumeral0\xintrawwithzeros {#6}.{#2}{#3}{#4}{#5}{#1}% }% \def\XINT_gctcv_loop_b #1/#2.#3#4#5#6% {% @@ -749,7 +746,7 @@ \def\XINT_gctcv_loop_f #1#2% {% \expandafter\XINT_gctcv_loop_g\expandafter - {\romannumeral0\xintraw {#1/#2}}{{#1}{#2}}% + {\romannumeral0\xintrawwithzeros {#1/#2}}{{#1}{#2}}% }% \def\XINT_gctcv_loop_g #1#2#3#4% {% @@ -759,7 +756,7 @@ {% \xint_gob_til_w #3\XINT_gctcv_end\W \expandafter\XINT_gctcv_loop_i - \romannumeral0\xintraw {#3}.#2{#1}% + \romannumeral0\xintrawwithzeros {#3}.#2{#1}% }% \def\XINT_gctcv_loop_i #1/#2.#3#4#5#6% {% @@ -829,13 +826,13 @@ \def\XINT_igctcv_loop_k #1#2% {% \expandafter\XINT_igctcv_loop_l\expandafter - {\romannumeral0\xintraw {#1/#2}}% + {\romannumeral0\xintrawwithzeros {#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}}% + {\romannumeral0\xintrawwithzeros {#2/#3}}% }% \def\XINT_igctcv_end_b #1#2{ #2{#1[0]}}% \def\xintCntoF {\romannumeral0\xintcntof }% diff --git a/Master/texmf-dist/tex/generic/xint/xintexpr.sty b/Master/texmf-dist/tex/generic/xint/xintexpr.sty new file mode 100644 index 00000000000..14fc53b418c --- /dev/null +++ b/Master/texmf-dist/tex/generic/xint/xintexpr.sty @@ -0,0 +1,769 @@ +%% +%% This is file `xintexpr.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% xint.dtx (with options: `xintexpr') +%% +%% IMPORTANT NOTICE: +%% +%% For the copyright see the source file. +%% +%% Any modified versions of this file must be renamed +%% with new filenames distinct from xintexpr.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.07a of May 26, 2013) +%% xintexpr: Expandable expression parser +%% 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@xintexpr.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{xintexpr}{\numexpr not available, aborting input}% + \aftergroup\endinput + \else + \ifx\x\relax % plain-TeX, first loading of xintexpr.sty + \ifx\w\relax % but xintfrac.sty not yet loaded. + \y{xintexpr}{Package xintfrac is required}% + \y{xintexpr}{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{xintexpr}{Package xintfrac is required}% + \y{xintexpr}{Will try \string\RequirePackage{xintfrac}}% + \def\z{\endgroup\RequirePackage{xintfrac}}% + \fi + \else + \y{xintexpr}{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{xintexpr}{Loading of package xintfrac failed, aborting input}% + \aftergroup\endinput + \fi + \ifx\w\empty % LaTeX, user gave a file name at the prompt + \y{xintexpr}{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 % } + \catcode95=11 % _ + \def\x + {% + \endgroup + \edef\XINT_expr_restorecatcodes_endinput + {% + \catcode94=\the\catcode94 % ^ + \catcode33=\the\catcode33 % ! + \catcode93=\the\catcode93 % ] + \catcode91=\the\catcode91 % [ + \catcode96=\the\catcode96 % ` + \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 % # + \catcode95=\the\catcode95 % _ + \catcode125=\the\catcode125 % } + \catcode123=\the\catcode123 % { + \endlinechar=\the\endlinechar + \catcode13=\the\catcode13 % ^^M + \catcode32=\the\catcode32 % + \catcode61=\the\catcode61\relax % = + \noexpand\endinput + }% + \XINT_setcatcodes + \catcode91=12 % [ + \catcode93=12 % ] + \catcode33=11 % ! + \catcode94=12 % ^ + }% +\x +\begingroup + \catcode64=11 % @ + \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@xintexpr.sty\endcsname +\ProvidesPackage{xintexpr}% + [2013/05/26 v1.07a Expandable expression parser (jfB)]% +\chardef\xint_c_ 0 +\chardef\xint_c_i 1 +\chardef\xint_c_ii 2 +\chardef\xint_c_iii 3 +\chardef\xint_c_iv 4 +\chardef\xint_c_v 5 +\chardef\xint_c_ix 9 +\def\xint_gob_til_dot #1.{}% +\def\xint_gob_til_dot_andstop #1.{ }% +\def\xint_gob_til_! #1!{}% ! of catcode 11 +\def\XINT_expr_string {\expandafter\xint_gob_til_dot\string }% +\def\XINT_expr_unexpectedtoken {\xintError:ignored }% +\def\xintexpr {\romannumeral0\xinteval }% +\def\xinteval +{% + \expandafter\XINT_expr_until_end\romannumeral-`0% + \expandafter\XINT_expr_checkifprefix_ii\romannumeral-`0% + \XINT_expr_getnext +}% +\def\xinttheexpr {\romannumeral0\xinttheeval }% +\def\xinttheeval {\expandafter\XINT_expr_the\romannumeral0\xinteval }% +\def\XINT_expr_the #1#2#3{\xintraw{\XINT_expr_string #3}}% +\def\xintthe #1{\ifx#1\xintexpr \expandafter\xinttheexpr + \else\expandafter\xintthefloatexpr\fi}% +\def\XINT_expr_until_end #1% +{% + \ifcase#1% + \expandafter\xint_gobble_vi + \or + \expandafter\XINT_expr_extra_closing_paren + \fi + \expandafter\XINT_expr_until_end\romannumeral-`0% +}% +\def\XINT_expr_extra_closing_paren {\xintError:removed }% +\def\XINT_expr_endofexpr {!\XINT_illegaluse }% +\def\XINT_illegaluse + {Illegal_here_use_xintthe\xintError:use_xintthe!\xint_gobble_i }% +\def\XINT_expr_oparen +{% + \expandafter\XINT_expr_until_cparen\romannumeral-`0% + \expandafter\XINT_expr_checkifprefix_ii\romannumeral-`0% + \XINT_expr_getnext +}% +\def\XINT_expr_until_cparen #1% +{% + \ifcase#1% + \expandafter\XINT_expr_missing_cparen + \or + \else \xint_afterfi{\expandafter\XINT_expr_until_cparen\romannumeral-`0}% + \fi +}% +\def\XINT_expr_missing_cparen #1% +{% + \xintError:inserted \xint_c_ \XINT_expr_endofexpr +}% +\def\xint_tmp_def #1#2#3% +{% + \expandafter\xint_tmp_do_defs + \csname XINT_expr_op_#1\expandafter\endcsname + \csname XINT_expr_until_#1\expandafter\endcsname + \csname XINT_expr_checkifprefix_#2\expandafter\endcsname + \csname XINT_expr_precedence_#1\expandafter\endcsname + \csname xint_c_#2\expandafter\endcsname + \csname xint#3\endcsname +}% +\def\xint_tmp_do_defs #1#2#3#4#5#6% +{% + \def #1##1% \XINT_expr_op_? + {% + \expandafter #2\expandafter ##1\romannumeral-`0\expandafter + #3\romannumeral-`0\XINT_expr_getnext + }% + \def #2##1##2##3##4% \XINT_expr_until_? + {% + \ifnum ##2>#5% + \xint_afterfi {\expandafter #2\expandafter ##1\romannumeral-`0##3##4}% + \else + \xint_afterfi + {\expandafter ##2\expandafter ##3% + \csname .#6{\XINT_expr_string ##1}{\XINT_expr_string ##4}\endcsname }% + \fi + }% + \global\let #4#5% +}% +\xint_tmp_def +{ii}{Add}% +\xint_tmp_def -{ii}{Sub}% +\xint_tmp_def *{iii}{Mul}% +\xint_tmp_def /{iii}{Div}% +\xint_tmp_def ^{iv}{fPow}% +\xint_tmp_def e{v}{fE}% +\xint_tmp_def E{v}{fE}% +\def\xint_tmp_def #1% +{% + \expandafter\xint_tmp_do_defs + \csname XINT_expr_checkifprefix_#1\expandafter\endcsname + \csname XINT_expr_op_-#1\endcsname +}% +\def\xint_tmp_do_defs #1#2% +{% + \def #1##1% + {\xint_UDsignfork + ##1\dummy #2% + -\dummy ##1% + \krof }% +}% +\xint_tmp_def {ii}% +\xint_tmp_def {iii}% +\xint_tmp_def {iv}% +\xint_tmp_def {v}% +\def\xint_tmp_def #1% +{% + \expandafter\xint_tmp_do_defs + \csname XINT_expr_op_-#1\expandafter\endcsname + \csname XINT_expr_until_-#1\expandafter\endcsname + \csname XINT_expr_checkifprefix_#1\expandafter\endcsname + \csname xint_c_#1\endcsname +}% +\def\xint_tmp_do_defs #1#2#3#4% +{% + \def #1% \XINT_expr_op_-ii,iii,iv,v + {% + \expandafter #2\romannumeral-`0\expandafter + #3\romannumeral-`0\XINT_expr_getnext + }% + \def #2##1##2##3% \XINT_expr_until_-ii,iii,iv,v + {% + \ifnum ##1>#4% + \xint_afterfi {\expandafter #2\romannumeral-`0##2##3}% + \else + \xint_afterfi {\expandafter ##1\expandafter ##2% + \csname .\xintOpp{\XINT_expr_string ##3}\endcsname }% + \fi + }% +}% +\xint_tmp_def {ii}% +\xint_tmp_def {iii}% +\xint_tmp_def {iv}% +\xint_tmp_def {v}% +\def\XINT_expr_getop #1% +{% + \expandafter\XINT_expr_getop_a\expandafter #1\romannumeral-`0% +}% +\def\XINT_expr_getop_a #1#2% +{% + \ifcat #2\relax + \ifx #2\relax + \expandafter\expandafter\expandafter + \XINT_expr_foundendofexpr + \else + \XINT_expr_unexpectedtoken + \expandafter\expandafter\expandafter + \XINT_expr_getop + \fi + \else + \expandafter\XINT_expr_op_found\expandafter #2% + \fi + #1% +}% +\def\XINT_expr_foundendofexpr {\xint_c_ \XINT_expr_endofexpr }% +\def\XINT_expr_op_found #1% +{% + \ifcsname XINT_expr_precedence_\string #1\endcsname + \expandafter\xint_afterfi\expandafter + {\csname XINT_expr_precedence_\string #1\expandafter\endcsname + \csname XINT_expr_op_\string #1\endcsname }% + \else + \XINT_expr_unexpectedtoken + \expandafter\XINT_expr_getop + \fi +}% +\expandafter\let\csname XINT_expr_precedence_)\endcsname \xint_c_i +\expandafter\let\csname XINT_expr_op_)\endcsname\XINT_expr_getop +\def\xint_tmp_def +{% + \expandafter\xint_tmp_do_defs + \csname XINT_expr_precedence_!\expandafter\endcsname + \csname XINT_expr_op_!\endcsname +}% +\def\xint_tmp_do_defs #1#2% +{% + \def #1##1##2% + {\ifx ##1#2% + \expandafter\xint_firstoftwo + \else\expandafter\xint_secondoftwo + \fi{\expandafter\XINT_expr_getop}{\expandafter\XINT_flexpr_getop}% + \csname .\xintfFac{\XINT_expr_string ##2}/1[0]\endcsname }% + \let#2\empty +}% +\xint_tmp_def +\def\XINT_expr_getnext +{% + \expandafter\XINT_expr_getnext_checkforbraced_a\romannumeral-`0% +}% +\def\XINT_expr_getnext_checkforbraced_a #1% +{% + \XINT_expr_getnext_checkforbraced_b #1\W\Z {#1}% +}% +\def\XINT_expr_getnext_checkforbraced_b #1#2% +{% + \xint_UDwfork + #1\dummy \XINT_expr_getnext_emptybracepair + #2\dummy \XINT_expr_getnext_onetoken_perhaps + \W\dummy \XINT_expr_getnext_gotbracedstuff + \krof +}% +\def\XINT_expr_getnext_onetoken_perhaps\Z #1% +{% + \expandafter\XINT_expr_getnext_checkforbraced_c\expandafter + {\romannumeral-`0#1}% +}% +\def\XINT_expr_getnext_checkforbraced_c #1% +{% + \XINT_expr_getnext_checkforbraced_d #1\W\Z {#1}% +}% +\def\XINT_expr_getnext_checkforbraced_d #1#2% +{% + \xint_UDwfork + #1\dummy \XINT_expr_getnext_emptybracepair + #2\dummy \XINT_expr_getnext_onetoken_wehope + \W\dummy \XINT_expr_getnext_gotbracedstuff + \krof +}% +\def\XINT_expr_getnext_emptybracepair #1{\XINT_expr_getnext }% +\def\XINT_expr_getnext_gotbracedstuff #1\W\Z #2% +{% + \expandafter\XINT_expr_getop\csname .#2\endcsname +}% +\def\XINT_expr_getnext_onetoken_wehope\Z #1% +{% + \xint_gob_til_! #1\XINT_expr_subexpr !% + \expandafter\XINT_expr_getnext_onetoken_fork\string #1% +}% +\def\XINT_expr_subexpr !#1!{\expandafter\XINT_expr_getop\xint_gobble_i }% +\begingroup +\lccode`*=`_ +\lowercase{\endgroup +\def\XINT_expr_sixwayfork #1(-.+*\dummy #2#3\krof {#2}% +\def\XINT_expr_getnext_onetoken_fork #1% +{% + \XINT_expr_sixwayfork + #1-.+*\dummy \XINT_expr_oparen + (#1.+*\dummy -% + (-#1+*\dummy {\XINT_expr_scannum_start\XINT_expr_scannum_decpart_b.}% + (-.#1*\dummy \XINT_expr_getnext% + (-.+#1\dummy {\XINT_expr_scannum_start\XINT_expr_scannum_decpart_b*}% + (-.+*\dummy {\XINT_expr_scannum_check #1}% + \krof +}}% +\def\XINT_expr_scannum_check #1% +{% + \ifnum \xint_c_ix<1#1 + \expandafter\XINT_expr_scannum_start + \else + \xint_afterfi{\XINT_expr_unexpectedtoken + \expandafter\XINT_expr_getnext\xint_gobble_ii}% + \fi \XINT_expr_scannum_intpart_b #1% +}% +\def\XINT_expr_scannum_stopscan {!}% ! catcode 11 +\def\XINT_expr_gathernum #1!% ! with catcode 11 +{% + \expandafter\space\csname .#1\endcsname +}% +\def\XINT_expr_scannum_start #1% +{% + \expandafter\XINT_expr_getop + \romannumeral-`0\expandafter\XINT_expr_gathernum + \romannumeral-`0#1% +}% +\def\XINT_expr_scannum_intpart_a #1% +{% + \ifnum \xint_c_ix<1\string#1 + \expandafter\expandafter\expandafter + \XINT_expr_scannum_intpart_b + \expandafter\string + \else + \if #1.% + \expandafter\expandafter\expandafter + \XINT_expr_scannum_transition + \else + \expandafter\expandafter\expandafter + \XINT_expr_scannum_stopscan + \fi + \fi + #1% +}% +\def\XINT_expr_scannum_intpart_b #1% +{% + \expandafter #1\romannumeral-`0\expandafter + \XINT_expr_scannum_intpart_a\romannumeral-`0% +}% +\def\XINT_expr_scannum_transition #1% +{% + \expandafter.\romannumeral-`0\expandafter + \XINT_expr_scannum_decpart_a\romannumeral-`0% +}% +\def\XINT_expr_scannum_decpart_a #1% +{% + \ifnum \xint_c_ix<1\string#1 + \expandafter\expandafter\expandafter + \XINT_expr_scannum_decpart_b\expandafter\string + \else + \expandafter \XINT_expr_scannum_stopscan + \fi + #1% +}% +\def\XINT_expr_scannum_decpart_b #1% +{% + \expandafter #1\romannumeral-`0\expandafter + \XINT_expr_scannum_decpart_a\romannumeral-`0% +}% +\def\xintfloatexpr {\romannumeral0\xintfloateval }% +\def\xintfloateval +{% + \expandafter\XINT_expr_until_end\romannumeral-`0% + \expandafter\XINT_flexpr_checkifprefix_ii\romannumeral-`0% + \XINT_flexpr_getnext +}% +\def\xintthefloatexpr {\romannumeral0\xintthefloateval }% +\def\xintthefloateval + {\expandafter\XINT_flexpr_the\romannumeral0\xintfloateval }% +\def\XINT_flexpr_the #1#2#3{\xintfloat{\XINT_expr_string #3}}% +\def\XINT_flexpr_oparen +{% + \expandafter\XINT_expr_until_cparen\romannumeral-`0% + \expandafter\XINT_flexpr_checkifprefix_ii\romannumeral-`0% + \XINT_flexpr_getnext +}% +\def\xint_tmp_def #1#2#3% +{% + \expandafter\xint_tmp_do_defs + \csname XINT_flexpr_op_#1\expandafter\endcsname + \csname XINT_flexpr_until_#1\expandafter\endcsname + \csname XINT_flexpr_checkifprefix_#2\expandafter\endcsname + \csname XINT_expr_precedence_#1\expandafter\endcsname + \csname xint_c_#2\expandafter\endcsname + \csname XINTinFloat#3\endcsname +}% +\def\xint_tmp_do_defs #1#2#3#4#5#6% +{% + \def #1##1% \XINT_flexpr_op_? + {% + \expandafter #2\expandafter ##1\romannumeral-`0\expandafter + #3\romannumeral-`0\XINT_flexpr_getnext + }% + \def #2##1##2##3##4% \XINT_flexpr_until_? + {% + \ifnum ##2>#5% + \xint_afterfi {\expandafter #2\expandafter ##1\romannumeral-`0##3##4}% + \else + \xint_afterfi + {\expandafter ##2\expandafter ##3% + \csname .#6{\XINT_expr_string ##1}% + {\XINT_expr_string ##4}\endcsname }% + \fi + }% +}% +\xint_tmp_def +{ii}{Add}% +\xint_tmp_def -{ii}{Sub}% +\xint_tmp_def *{iii}{Mul}% +\xint_tmp_def /{iii}{Div}% +\xint_tmp_def ^{iv}{Power}% +\xint_tmp_def e{v}{fE}% +\xint_tmp_def E{v}{fE}% +\def\xint_tmp_def #1% +{% + \expandafter\xint_tmp_do_defs + \csname XINT_flexpr_checkifprefix_#1\expandafter\endcsname + \csname XINT_flexpr_op_-#1\endcsname +}% +\def\xint_tmp_do_defs #1#2% +{% + \def #1##1% + {\xint_UDsignfork + ##1\dummy #2% + -\dummy ##1% + \krof }% +}% +\xint_tmp_def {ii}% +\xint_tmp_def {iii}% +\xint_tmp_def {iv}% +\xint_tmp_def {v}% +\def\xint_tmp_def #1% +{% + \expandafter\xint_tmp_do_defs + \csname XINT_flexpr_op_-#1\expandafter\endcsname + \csname XINT_expr_until_-#1\expandafter\endcsname + \csname XINT_flexpr_checkifprefix_#1\expandafter\endcsname + \csname xint_c_#1\endcsname +}% +\def\xint_tmp_do_defs #1#2#3#4% +{% + \def #1% \XINT_flexpr_op_-ii,iii,iv,v + {% + \expandafter #2\romannumeral-`0\expandafter + #3\romannumeral-`0\XINT_flexpr_getnext + }% +}% +\xint_tmp_def {ii}% +\xint_tmp_def {iii}% +\xint_tmp_def {iv}% +\xint_tmp_def {v}% +\let\xint_tmp_def\empty +\let\xint_tmp_do_defs\empty +\def\XINT_flexpr_getop #1% +{% + \expandafter\XINT_flexpr_getop_a\expandafter #1\romannumeral-`0% +}% +\def\XINT_flexpr_getop_a #1#2% +{% + \ifcat #2\relax + \ifx #2\relax + \expandafter\expandafter\expandafter + \XINT_expr_foundendofexpr + \else + \XINT_expr_unexpectedtoken + \expandafter\expandafter\expandafter + \XINT_flexpr_getop + \fi + \else + \expandafter\XINT_flexpr_op_found\expandafter #2% + \fi + #1% +}% +\def\XINT_flexpr_op_found #1% +{% + \ifcsname XINT_expr_precedence_\string #1\endcsname + \expandafter\xint_afterfi\expandafter + {\csname XINT_expr_precedence_\string #1\expandafter\endcsname + \csname XINT_flexpr_op_\string #1\endcsname }% + \else + \XINT_expr_unexpectedtoken + \expandafter\XINT_flexpr_getop + \fi +}% +\expandafter\let\csname XINT_flexpr_op_)\endcsname\XINT_flexpr_getop +\def\XINT_flexpr_getnext +{% + \expandafter\XINT_flexpr_getnext_checkforbraced_a\romannumeral-`0% +}% +\def\XINT_flexpr_getnext_checkforbraced_a #1% +{% + \XINT_flexpr_getnext_checkforbraced_b #1\W\Z {#1}% +}% +\def\XINT_flexpr_getnext_checkforbraced_b #1#2% +{% + \xint_UDwfork + #1\dummy \XINT_flexpr_getnext_emptybracepair + #2\dummy \XINT_flexpr_getnext_onetoken_perhaps + \W\dummy \XINT_flexpr_getnext_gotbracedstuff + \krof +}% +\def\XINT_flexpr_getnext_onetoken_perhaps\Z #1% +{% + \expandafter\XINT_flexpr_getnext_checkforbraced_c\expandafter + {\romannumeral-`0#1}% +}% +\def\XINT_flexpr_getnext_checkforbraced_c #1% +{% + \XINT_flexpr_getnext_checkforbraced_d #1\W\Z {#1}% +}% +\def\XINT_flexpr_getnext_checkforbraced_d #1#2% +{% + \xint_UDwfork + #1\dummy \XINT_flexpr_getnext_emptybracepair + #2\dummy \XINT_flexpr_getnext_onetoken_wehope + \W\dummy \XINT_flexpr_getnext_gotbracedstuff + \krof +}% +\def\XINT_flexpr_getnext_emptybracepair #1{\XINT_flexpr_getnext }% +\def\XINT_flexpr_getnext_gotbracedstuff #1\W\Z #2% +{% + \expandafter\XINT_flexpr_getop\csname .#2\endcsname +}% +\def\XINT_flexpr_getnext_onetoken_wehope\Z #1% +{% + \xint_gob_til_! #1\XINT_flexpr_subexpr !% + \expandafter\XINT_flexpr_getnext_onetoken_fork\string #1% +}% +\def\XINT_flexpr_subexpr !#1!{\expandafter\XINT_flexpr_getop\xint_gobble_i }% +\begingroup +\lccode`*=`_ +\lowercase{\endgroup +\def\XINT_flexpr_getnext_onetoken_fork #1% +{% + \XINT_expr_sixwayfork + #1-.+*\dummy \XINT_flexpr_oparen + (#1.+*\dummy -% + (-#1+*\dummy {\XINT_flexpr_scannum_start\XINT_expr_scannum_decpart_b.}% + (-.#1*\dummy \XINT_flexpr_getnext% + (-.+#1\dummy {\XINT_flexpr_scannum_start\XINT_expr_scannum_decpart_b*}% + (-.+*\dummy {\XINT_flexpr_scannum_check #1}% + \krof +}}% +\def\XINT_flexpr_scannum_check #1% +{% + \ifnum \xint_c_ix<1#1 + \expandafter\XINT_flexpr_scannum_start + \else + \xint_afterfi + {\XINT_expr_unexpectedtoken + \expandafter\XINT_flexpr_getnext\xint_gobble_ii}% + \fi \XINT_expr_scannum_intpart_b #1% +}% +\def\XINT_flexpr_scannum_start #1% +{% + \expandafter\XINT_flexpr_getop + \romannumeral-`0\expandafter\XINT_expr_gathernum + \romannumeral-`0#1% +}% +\catcode`* 13 +\def\xintNewExpr #1[#2]#3% +{% + \begingroup + \ifcase #2\relax + \toks0 {\xdef #1}% + \or \toks0 {\xdef #1##1}% + \or \toks0 {\xdef #1##1##2}% + \or \toks0 {\xdef #1##1##2##3}% + \or \toks0 {\xdef #1##1##2##3##4}% + \or \toks0 {\xdef #1##1##2##3##4##5}% + \or \toks0 {\xdef #1##1##2##3##4##5##6}% + \or \toks0 {\xdef #1##1##2##3##4##5##6##7}% + \or \toks0 {\xdef #1##1##2##3##4##5##6##7##8}% + \or \toks0 {\xdef #1##1##2##3##4##5##6##7##8##9}% + \else + \immediate\write-1{Package xintexpr Error! illegal number of macro + parameters.}% + \fi + \def\xintAdd {:xintAdd}% + \def\xintSub {:xintSub}% + \def\xintMul {:xintMul}% + \def\xintDiv {:xintDiv}% + \def\xintfPow {:xintfPow}% + \def\xintfFac {:xintfFac}% + \def\xintOpp {:xintOpp}% + \def\xintfE {:xintfE}% + \def\xintraw { :romannumeral0:xintraw}% + \def\XINT_expr_the ##1##2##3% + {\expandafter\xintraw + \expandafter{\romannumeral-`0\XINT_expr_string ##3}}% + \lccode`\*=`: \lowercase {\def*}{!noexpand!}% + \catcode`: 13 + \endlinechar -1 + \everyeof {\noexpand }% + \edef\xintNewExprtmp + {\expandafter\scantokens + \expandafter{\romannumeral0\xinttheeval #3\relax}}% + \lccode`\*=`_ \lowercase {\def*}{####}% + \catcode`_ 13 \catcode`! 0 \catcode`: 11 + \the\toks0 {\expandafter\scantokens\expandafter{\xintNewExprtmp }}% +\endgroup +}% +\def\xintNewFloatExpr #1[#2]#3% +{% + \begingroup + \ifcase #2\relax + \toks0 {\xdef #1}% + \or \toks0 {\xdef #1##1}% + \or \toks0 {\xdef #1##1##2}% + \or \toks0 {\xdef #1##1##2##3}% + \or \toks0 {\xdef #1##1##2##3##4}% + \or \toks0 {\xdef #1##1##2##3##4##5}% + \or \toks0 {\xdef #1##1##2##3##4##5##6}% + \or \toks0 {\xdef #1##1##2##3##4##5##6##7}% + \or \toks0 {\xdef #1##1##2##3##4##5##6##7##8}% + \or \toks0 {\xdef #1##1##2##3##4##5##6##7##8##9}% + \else + \immediate\write-1{Package xintexpr Error! illegal number of macro + parameters.}% + \fi + \def\XINTinFloatAdd {:XINTinFloatAdd}% + \def\XINTinFloatSub {:XINTinFloatSub}% + \def\XINTinFloatMul {:XINTinFloatMul}% + \def\XINTinFloatDiv {:XINTinFloatDiv}% + \def\XINTinFloatPower {:XINTinFloatPower}% + \def\xintfFac {:xintfFac}% + \def\xintOpp {:xintOpp}% + \def\XINTinFloatfE {:XINTinFloatfE}% + \def\xintfloat { :romannumeral0:xintfloat}% + \def\XINT_flexpr_the ##1##2##3% + {\expandafter\xintfloat + \expandafter{\romannumeral-`0\XINT_expr_string ##3}}% + \lccode`\*=`: \lowercase {\def*}{!noexpand!}% + \catcode`: 13 + \endlinechar -1 + \everyeof {\noexpand }% + \edef\xintNewExprtmp + {\expandafter\scantokens + \expandafter{\romannumeral0\xintthefloateval #3\relax}}% + \lccode`\*=`_ \lowercase {\def*}{####}% + \catcode`_ 13 \catcode`! 0 \catcode`: 11 + \the\toks0 {\expandafter\scantokens\expandafter{\xintNewExprtmp }}% +\endgroup +}% +\XINT_expr_restorecatcodes_endinput% +\endinput +%% +%% End of file `xintexpr.sty'. diff --git a/Master/texmf-dist/tex/generic/xint/xintfrac.sty b/Master/texmf-dist/tex/generic/xint/xintfrac.sty index a63770ad592..a6678ac73c6 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.06b of May 14, 2013) +%% The xint bundle (version 1.07a of May 26, 2013) %% xintfrac: Expandable operations on fractions %% Copyright (C) 2013 by Jean-Francois Burnol %%---------------------------------------------------------------- @@ -166,7 +166,7 @@ \fi \expandafter\x\csname ver@xintfrac.sty\endcsname \ProvidesPackage{xintfrac}% - [2013/05/14 v1.06b Expandable operations on fractions (jfB)]% + [2013/05/26 v1.07a Expandable operations on fractions (jfB)]% \def\xintLen {\romannumeral0\xintlen }% \def\xintlen #1% {% @@ -243,32 +243,52 @@ {% \xint_UDwfork #2\dummy \XINT_frac_A - \W\dummy {\expandafter\XINT_frac_B \romannumeral-`0#2}% + \W\dummy {\expandafter\XINT_frac_U \romannumeral-`0#2}% \krof - #3.\W\Z #1.\W\Z + #3e\W\Z #1e\W\Z }% +\def\XINT_frac_U #1e#2#3\Z +{% + \xint_UDwfork + #2\dummy \XINT_frac_Ua + \W\dummy {\XINT_frac_Ub #2}% + \krof + #3\Z #1\Z +}% +\def\XINT_frac_Ua \Z #1/\W\Z {\XINT_frac_B #1.\W\Z {0}}% +\def\XINT_frac_Ub #1/\W e\W\Z #2\Z {\XINT_frac_B #2.\W\Z {#1}}% \def\XINT_frac_B #1.#2#3\Z {% \xint_UDwfork - #2\dummy \XINT_frac_Ba + #2\dummy \XINT_frac_Ba \W\dummy {\XINT_frac_Bb #2}% \krof #3\Z #1\Z }% -\def\XINT_frac_Bb #1/\W.\W\Z #2\Z +\def\XINT_frac_Ba \Z #1\Z {\XINT_frac_T {0}{#1}}% +\def\XINT_frac_Bb #1.\W\Z #2\Z {% - \expandafter \XINT_frac_C \expandafter + \expandafter \XINT_frac_T \expandafter {\romannumeral0\XINT_length {#1}}{#2#1}% }% -\def\XINT_frac_Ba \Z #1/\W\Z {\XINT_frac_C {0}{#1}}% -\def\XINT_frac_A .\W\Z {\XINT_frac_C {0}{1}}% -\def\XINT_frac_C #1#2#3.#4#5\Z +\def\XINT_frac_A e\W\Z {\XINT_frac_T {0}{1}{0}}% +\def\XINT_frac_T #1#2#3#4e#5#6\Z {% \xint_UDwfork - #4\dummy \XINT_frac_Ca - \W\dummy {\XINT_frac_Cb #4}% + #5\dummy \XINT_frac_Ta + \W\dummy {\XINT_frac_Tb #5}% \krof - #5\Z #3\Z {#1}{#2}% + #6\Z #4\Z {#1}{#2}{#3}% +}% +\def\XINT_frac_Ta \Z #1\Z {\XINT_frac_C #1.\W\Z {0}}% +\def\XINT_frac_Tb #1e\W\Z #2\Z {\XINT_frac_C #2.\W\Z {#1}}% +\def\XINT_frac_C #1.#2#3\Z +{% + \xint_UDwfork + #2\dummy \XINT_frac_Ca + \W\dummy {\XINT_frac_Cb #2}% + \krof + #3\Z #1\Z }% \def\XINT_frac_Ca \Z #1\Z {\XINT_frac_D {0}{#1}}% \def\XINT_frac_Cb #1.\W\Z #2\Z @@ -276,14 +296,14 @@ \expandafter\XINT_frac_D\expandafter {\romannumeral0\XINT_length {#1}}{#2#1}% }% -\def\XINT_frac_D #1#2#3#4% +\def\XINT_frac_D #1#2#3#4#5#6% {% \expandafter \XINT_frac_E \expandafter - {\the\numexpr -#1+#3\expandafter}\expandafter + {\the\numexpr -#1+#3+#4-#6\expandafter}\expandafter {\romannumeral0\XINT_num_loop #2% \xint_relax\xint_relax\xint_relax\xint_relax \xint_relax\xint_relax\xint_relax\xint_relax\Z }% - {\romannumeral0\XINT_num_loop #4% + {\romannumeral0\XINT_num_loop #5% \xint_relax\xint_relax\xint_relax\xint_relax \xint_relax\xint_relax\xint_relax\xint_relax\Z }% }% @@ -407,21 +427,27 @@ {% \expandafter\XINT_raw\romannumeral0\XINT_infrac }% -\def\XINT_raw #1% +\def\XINT_raw #1#2#3{ #2/#3[#1]}% +\def\xintRawWithZeros {\romannumeral0\xintrawwithzeros }% +\def\xintrawwithzeros +{% + \expandafter\XINT_rawz\romannumeral0\XINT_infrac +}% +\def\XINT_rawz #1% {% \ifcase\XINT_Sgn {#1} - \expandafter\XINT_raw_Ba + \expandafter\XINT_rawz_Ba \or - \expandafter\XINT_raw_A + \expandafter\XINT_rawz_A \else - \expandafter\XINT_raw_Ba + \expandafter\XINT_rawz_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 +\def\XINT_rawz_A #1#2#3{\xint_dsh {#2}{-#1}/#3}% +\def\XINT_rawz_Ba #1#2#3{\expandafter\XINT_rawz_Bb \expandafter{\romannumeral0\xint_dsh {#3}{#1}}{#2}}% -\def\XINT_raw_Bb #1#2{ #2/#1}% +\def\XINT_rawz_Bb #1#2{ #2/#1}% \def\xintNumerator {\romannumeral0\xintnumerator }% \def\xintnumerator {% @@ -593,10 +619,30 @@ {\the\numexpr #3+#4-#2}{#1}{#5}% }% \def\XINT_rez_E #1#2#3{ #3/#2[#1]}% +\def\xintE {\romannumeral0\xinte }% +\def\xinte #1% +{% + \expandafter\XINT_e \romannumeral0\XINT_infrac {#1}% +}% +\def\XINT_e #1#2#3#4% +{% + \expandafter\XINT_e_end\expandafter{\the\numexpr #1+#4}{#2}{#3}% +}% +\def\xintfE {\romannumeral0\xintfe }% +\def\xintfe #1% +{% + \expandafter\XINT_fe \romannumeral0\XINT_infrac {#1}% +}% +\def\XINT_fe #1#2#3#4% +{% + \expandafter\XINT_e_end\expandafter{\the\numexpr #1+\xintNum{#4}}{#2}{#3}% +}% +\def\XINT_e_end #1#2#3{ #2/#3[#1]}% +\let\XINTinFloatfE\xintfE \def\xintIrr {\romannumeral0\xintirr }% \def\xintirr #1% {% - \expandafter\XINT_irr_start\romannumeral0\xintraw {#1}\Z + \expandafter\XINT_irr_start\romannumeral0\xintrawwithzeros {#1}\Z }% \def\XINT_irr_start #1#2/#3\Z {% @@ -666,10 +712,15 @@ \xintError:NotAnInteger \space #1% }% +\def\xintfFac {\romannumeral0\xintffac }% +\def\xintffac #1% +{% + \expandafter\XINT_fac_fork\expandafter{\the\numexpr \xintNum{#1}}% +}% \def\xintJrr {\romannumeral0\xintjrr }% \def\xintjrr #1% {% - \expandafter\XINT_jrr_start\romannumeral0\xintraw {#1}\Z + \expandafter\XINT_jrr_start\romannumeral0\xintrawwithzeros {#1}\Z }% \def\XINT_jrr_start #1#2/#3\Z {% @@ -826,7 +877,7 @@ \def\XINT_trunc_Hb #1#2#3% {% \expandafter #3\expandafter0\expandafter.% - \romannumeral0\XINT_dsx_zeroloop {#1}\Z {}#2% #1=-0 possible! + \romannumeral0\XINT_dsx_zeroloop {#1}{}\Z {}#2% #1=-0 possible! }% \def\xintRound {\romannumeral0\xintround }% \def\xintiRound {\romannumeral0\xintiround }% @@ -892,6 +943,241 @@ {% \XINT_addm_A 0{}1000\W\X\Y\Z #1000\W\X\Y\Z \Z }% +\mathchardef\XINT_digits 16 +\def\xintDigits #1#2% + {\afterassignment \xint_gobble_i \mathchardef\XINT_digits=}% +\def\xinttheDigits {\number\XINT_digits }% +\def\xintFloat {\romannumeral0\xintfloat }% +\def\xintfloat #1{\XINT_float_chkopt #1\Z }% +\def\XINT_float_chkopt #1% +{% + \ifx #1[\expandafter\XINT_float_opt + \else\expandafter\XINT_float_noopt + \fi #1% +}% +\def\XINT_float_noopt #1\Z +{% + \XINT_float_a \XINT_digits {#1}% +}% +\def\XINT_float_opt [\Z #1]% +{% + \expandafter\XINT_float_a\expandafter {\the\numexpr #1}% +}% +\def\XINT_float_a #1#2% +{% + \expandafter\XINT_float_b \romannumeral0\XINT_infrac {#2}{#1}% +}% +\def\XINT_float_b #1#2#3% +{% + \XINT_float_fork #2\Z {#3}{#1}% +}% +\def\XINT_float_fork #1% +{% + \xint_UDzerominusfork + #1-\dummy \XINT_float_zero + 0#1\dummy \XINT_float_N + 0-\dummy {\XINT_float_P #1}% + \krof +}% +\def\XINT_float_zero \Z #1#2#3{ 0.e0}% +\def\XINT_float_N {\expandafter\xint_minus_andstop\romannumeral0\XINT_float_P }% +\def\XINT_float_P #1\Z #2#3#4% +{% + \ifcase \romannumeral0\XINT_fgeq_A 011{#3}{#1}{#2} + \expandafter\XINT_float_lessthanone_a + \or\expandafter\XINT_float_atleastone_b + \fi {#3}{#1}{#2}{#3+#4}{#1}{#2}% +}% +\def\XINT_float_atleastone_b +{% + \expandafter\XINT_float_atleastone_c\romannumeral0\XINT_trunc_B +}% +\def\XINT_float_atleastone_c #1\Z #2% +{% + \expandafter\XINT_float_c\expandafter + {\romannumeral0\xintisub {\xintLength{#1}}{1}}% +}% +\def\XINT_float_lessthanone_a #1% +{% + \expandafter\XINT_float_lessthanone_b\expandafter + {\the\numexpr -#1}% +}% +\def\XINT_float_lessthanone_b #1#2#3% +{% + \expandafter\XINT_float_lessthanone_c + \romannumeral0\XINT_trunc_B {#1}{#3}{#2}% +}% +\def\XINT_float_lessthanone_c #1\Z #2% +{% + \expandafter\XINT_float_c\expandafter + {\expandafter-\romannumeral0\xintilen {\xintiSub {#1}{1}}}% +}% +\def\XINT_float_c #1#2#3#4% +{% + \expandafter\XINT_float_d\expandafter + {\the\numexpr #2-#1}{#3}{#4}e#1% +}% +\def\XINT_float_d +{% + \expandafter\XINT_float_round_B\romannumeral0\XINT_trunc_B +}% +\def\XINT_float_round_B #1#2\Z #3% +{% + \ifnum #1=9 + \xint_afterfi + {\romannumeral0\XINT_rord_main {}#1#2\XINT_float_round_S}% + \else + \xint_afterfi + {\romannumeral0\XINT_rord_main {}#1#2\XINT_float_round_D}% + \fi + \xint_relax + \xint_undef\xint_undef\xint_undef\xint_undef + \xint_undef\xint_undef\xint_undef\xint_undef + \xint_relax + \Z +}% +\def\XINT_float_round_D #1% +{% + \ifnum #1<5 + \expandafter\XINT_float_round_Da + \else + \expandafter\XINT_float_round_Db + \fi +}% +\def\XINT_float_round_Da #1\Z +{% + \expandafter\XINT_float_round_f + \romannumeral0\XINT_rord_main {}#1% + \xint_relax + \xint_undef\xint_undef\xint_undef\xint_undef + \xint_undef\xint_undef\xint_undef\xint_undef + \xint_relax +}% +\def\XINT_float_round_Db #1\Z +{% + \expandafter\XINT_float_round_f + \romannumeral0\XINT_addm_A 0{}1000\W\X\Y\Z #1000\W\X\Y\Z +}% +\def\XINT_float_round_f #1{ #1.}% +\def\XINT_float_round_S #1% +{% + \ifnum #1<5 + \expandafter\XINT_float_round_Da + \else + \expandafter\XINT_float_round_Sb + \fi +}% +\def\XINT_float_round_Sb #1\Z +{% + \expandafter\XINT_float_round_g + \romannumeral0\XINT_addm_A 0{}1000\W\X\Y\Z #1000\W\X\Y\Z +}% +\def\XINT_float_round_g #1% +{% + \ifnum #1=1 \expandafter\XINT_float_round_h\fi + \space #1.% +}% +\def\XINT_float_round_h\space 1.0{ 10.}% +\def\XINT_inFloat [#1]% +{% + \expandafter\XINT_infloat\expandafter {\the\numexpr #1}% +}% +\def\XINT_infloat #1#2% +{% + \expandafter\XINT_infloat_a \romannumeral0\XINT_infrac {#2}{#1}% +}% +\def\XINT_infloat_a #1#2#3% +{% + \XINT_infloat_fork #2\Z {#3}{#1}% +}% +\def\XINT_infloat_fork #1% +{% + \xint_UDzerominusfork + #1-\dummy \XINT_infloat_zero + 0#1\dummy \XINT_infloat_N + 0-\dummy {\XINT_infloat_P #1}% + \krof +}% +\def\XINT_infloat_zero\Z #1#2#3{0[0]}% +\def\XINT_infloat_N {\expandafter-\romannumeral-`0\XINT_infloat_P }% +\def\XINT_infloat_P #1\Z #2#3#4% +{% + \ifcase \romannumeral0\XINT_fgeq_A 011{#3}{#1}{#2} + \expandafter\XINT_infloat_lessthanone_a + \or\expandafter\XINT_infloat_atleastone_b + \fi {#3}{#1}{#2}{#3+#4}{#1}{#2}{#4}% +}% +\def\XINT_infloat_atleastone_b +{% + \expandafter\XINT_infloat_atleastone_c\romannumeral0\XINT_trunc_B +}% +\def\XINT_infloat_atleastone_c #1\Z #2% +{% + \expandafter\XINT_infloat_c\expandafter + {\romannumeral0\xintisub {\xintLength{#1}}{1}}% +}% +\def\XINT_infloat_lessthanone_a #1% +{% + \expandafter\XINT_infloat_lessthanone_b\expandafter + {\the\numexpr -#1}% +}% +\def\XINT_infloat_lessthanone_b #1#2#3% +{% + \expandafter\XINT_infloat_lessthanone_c + \romannumeral0\XINT_trunc_B {#1}{#3}{#2}% +}% +\def\XINT_infloat_lessthanone_c #1\Z #2% +{% + \expandafter\XINT_infloat_c\expandafter + {\expandafter-\romannumeral0\xintilen {\xintiSub {#1}{1}}}% +}% +\def\XINT_infloat_c #1#2#3#4% +{% + \expandafter\XINT_infloat_d\expandafter + {\the\numexpr #2-#1}{#3}{#4}{#1}% +}% +\def\XINT_infloat_d +{% + \expandafter\XINT_infloat_round_B\romannumeral0\XINT_trunc_B +}% +\def\XINT_infloat_round_B #1\Z #2% +{% + \expandafter\XINT_infloat_round_D + \romannumeral0\XINT_rord_main {}#1% + \xint_relax + \xint_undef\xint_undef\xint_undef\xint_undef + \xint_undef\xint_undef\xint_undef\xint_undef + \xint_relax + \Z +}% +\def\XINT_infloat_round_D #1% +{% + \ifnum #1<5 + \expandafter\XINT_infloat_round_Da + \else + \expandafter\XINT_infloat_round_Db + \fi +}% +\def\XINT_infloat_round_Da #1\Z +{% + \expandafter\XINT_infloat_round_f + \romannumeral0\XINT_rord_main {}#1% + \xint_relax + \xint_undef\xint_undef\xint_undef\xint_undef + \xint_undef\xint_undef\xint_undef\xint_undef + \xint_relax \Z +}% +\def\XINT_infloat_round_Db #1\Z +{% + \expandafter\XINT_infloat_round_f + \romannumeral0\XINT_addm_A 0{}1000\W\X\Y\Z #1000\W\X\Y\Z \Z +}% +\def\XINT_infloat_round_f #1\Z #2#3% +{% + \expandafter\XINT_infloat_round_g\expandafter + {\the\numexpr #2-#3+1}{#1}% +}% +\def\XINT_infloat_round_g #1#2{#2[#1]}% \def\xintAdd {\romannumeral0\xintadd }% \def\xintadd #1% {% @@ -1002,10 +1288,19 @@ {% \expandafter\xint_fpow\expandafter {\romannumeral0\XINT_infrac {#1}}% }% +\def\xintfPow {\romannumeral0\xintfpow }% +\def\xintfpow #1% +{% + \expandafter\xint_ffpow\expandafter {\romannumeral0\XINT_infrac {#1}}% +}% \def\xint_fpow #1#2% {% \expandafter\XINT_fpow_fork\the\numexpr #2\relax\Z #1% }% +\def\xint_ffpow #1#2% +{% + \expandafter\XINT_fpow_fork\the\numexpr \xintNum{#2}\relax\Z #1% +}% \def\XINT_fpow_fork #1#2\Z {% \xint_UDzerominusfork @@ -1098,6 +1393,34 @@ {\romannumeral0\xintimul {\xintDSH {\the\numexpr -#3+#1\relax}{#6}}{#5}}% {\romannumeral0\xintimul {#7}{\xintDSH {\the\numexpr -#2+#1\relax}{#4}}}% }% +\def\xintGeq {\romannumeral0\xintgeq }% +\def\xintgeq #1% +{% + \expandafter\xint_fgeq\expandafter {\romannumeral0\XINT_infrac {#1}}% +}% +\def\xint_fgeq #1#2% +{% + \expandafter\XINT_fgeq_A \romannumeral0\XINT_infrac {#2}#1% +}% +\def\XINT_fgeq_A #1#2#3#4% +{% + \ifnum #4 > #1 + \xint_afterfi {\XINT_fgeq_B {#1}}% + \else + \xint_afterfi {\XINT_fgeq_B {#4}}% + \fi + {#1}{#4}{#2}{#3}% +}% +\def\XINT_fgeq_B #1#2#3#4#5#6#7% +{% + \expandafter\XINT_fgeq_C\expandafter + {\romannumeral0\xintimul {\xintDSH {\the\numexpr -#3+#1\relax}{#6}}{#5}}% + {\romannumeral0\xintimul {#7}{\xintDSH {\the\numexpr -#2+#1\relax}{#4}}}% +}% +\def\XINT_fgeq_C #1#2% +{% + \expandafter\XINT_geq_fork #2\Z #1\Z +}% \def\xintMax {\romannumeral0\xintmax }% \def\xintmax #1% {% @@ -1183,15 +1506,6 @@ \expandafter\xint_fsgn\romannumeral0\XINT_infrac {#1}% }% \def\xint_fsgn #1#2#3{\xintisgn {#2}}% -\def\xintGeq {\romannumeral0\xintgeq }% -\def\xintgeq #1% -{% - \expandafter\xint_xgeq\expandafter{\romannumeral0\xintnum {#1}}% -}% -\def\xint_xgeq #1#2% -{% - \expandafter\XINT_geq_fork\romannumeral0\xintnum {#2}\Z #1\Z -}% \def\xintDivision {\romannumeral0\xintdivision }% \def\xintdivision #1% {% @@ -1244,6 +1558,365 @@ \xint_afterfi{ 0}% \fi }% +\def\xintFloatAdd {\romannumeral0\xintfloatadd }% +\def\xintfloatadd #1{\XINT_fladd_chkopt \xintfloat #1\Z }% +\def\XINTinFloatAdd {\romannumeral-`0\XINTinfloatadd }% +\def\XINTinfloatadd #1{\XINT_fladd_chkopt \XINT_inFloat #1\Z }% +\def\XINT_fladd_chkopt #1#2% +{% + \ifx #2[\expandafter\XINT_fladd_opt + \else\expandafter\XINT_fladd_noopt + \fi #1#2% +}% +\def\XINT_fladd_noopt #1#2\Z #3% +{% + #1[\XINT_digits]{\XINT_FL_Add {\XINT_digits+2}{#2}{#3}}% +}% +\def\XINT_fladd_opt #1[\Z #2]#3#4% +{% + #1[#2]{\XINT_FL_Add {#2+2}{#3}{#4}}% +}% +\def\XINT_FL_Add #1#2% +{% + \expandafter\XINT_FL_Add_a\expandafter{\the\numexpr #1\expandafter}% + \expandafter{\romannumeral-`0\XINT_inFloat [#1]{#2}}% +}% +\def\XINT_FL_Add_a #1#2#3% +{% + \expandafter\XINT_FL_Add_b\romannumeral-`0\XINT_inFloat [#1]{#3}#2{#1}% +}% +\def\XINT_FL_Add_b #1% +{% + \xint_gob_til_zero #1\XINT_FL_Add_zero 0\XINT_FL_Add_c #1% +}% +\def\XINT_FL_Add_c #1[#2]#3% +{% + \xint_gob_til_zero #3\XINT_FL_Add_zerobis 0\XINT_FL_Add_d #1[#2]#3% +}% +\def\XINT_FL_Add_d #1[#2]#3[#4]#5% +{% + \xintSgnFork {\ifnum \numexpr #2-#4-#5>1 \expandafter 1% + \else\ifnum \numexpr #4-#2-#5>1 + \xint_afterfi {\expandafter-\expandafter1}% + \else \expandafter\expandafter\expandafter0% + \fi + \fi}% + {#3[#4]}{\xintAdd {#1[#2]}{#3[#4]}}{#1[#2]}% +}% +\def\XINT_FL_Add_zero 0\XINT_FL_Add_c 0[0]#1[#2]#3{#1[#2]}% +\def\XINT_FL_Add_zerobis 0\XINT_FL_Add_d #1[#2]0[0]#3{#1[#2]}% +\def\xintFloatSub {\romannumeral0\xintfloatsub }% +\def\xintfloatsub #1{\XINT_flsub_chkopt \xintfloat #1\Z }% +\def\XINTinFloatSub {\romannumeral-`0\XINTinfloatsub }% +\def\XINTinfloatsub #1{\XINT_flsub_chkopt \XINT_inFloat #1\Z }% +\def\XINT_flsub_chkopt #1#2% +{% + \ifx #2[\expandafter\XINT_flsub_opt + \else\expandafter\XINT_flsub_noopt + \fi #1#2% +}% +\def\XINT_flsub_noopt #1#2\Z #3% +{% + #1[\XINT_digits]{\XINT_FL_Add {\XINT_digits+2}{#2}{\xintOpp{#3}}}% +}% +\def\XINT_flsub_opt #1[\Z #2]#3#4% +{% + #1[#2]{\XINT_FL_Add {#2+2}{#3}{\xintOpp{#4}}}% +}% +\def\xintFloatMul {\romannumeral0\xintfloatmul}% +\def\xintfloatmul #1{\XINT_flmul_chkopt \xintfloat #1\Z }% +\def\XINTinFloatMul {\romannumeral-`0\XINTinfloatmul }% +\def\XINTinfloatmul #1{\XINT_flmul_chkopt \XINT_inFloat #1\Z }% +\def\XINT_flmul_chkopt #1#2% +{% + \ifx #2[\expandafter\XINT_flmul_opt + \else\expandafter\XINT_flmul_noopt + \fi #1#2% +}% +\def\XINT_flmul_noopt #1#2\Z #3% +{% + #1[\XINT_digits]{\XINT_FL_Mul {\XINT_digits+2}{#2}{#3}}% +}% +\def\XINT_flmul_opt #1[\Z #2]#3#4% +{% + #1[#2]{\XINT_FL_Mul {#2+2}{#3}{#4}}% +}% +\def\XINT_FL_Mul #1#2% +{% + \expandafter\XINT_FL_Mul_a\expandafter{\the\numexpr #1\expandafter}% + \expandafter{\romannumeral-`0\XINT_inFloat [#1]{#2}}% +}% +\def\XINT_FL_Mul_a #1#2#3% +{% + \expandafter\XINT_FL_Mul_b\romannumeral-`0\XINT_inFloat [#1]{#3}#2% +}% +\def\XINT_FL_Mul_b #1[#2]#3[#4]{\xintE{\xintiMul {#1}{#3}}{#2+#4}}% +\def\xintFloatDiv {\romannumeral0\xintfloatdiv}% +\def\xintfloatdiv #1{\XINT_fldiv_chkopt \xintfloat #1\Z }% +\def\XINTinFloatDiv {\romannumeral-`0\XINTinfloatdiv }% +\def\XINTinfloatdiv #1{\XINT_fldiv_chkopt \XINT_inFloat #1\Z }% +\def\XINT_fldiv_chkopt #1#2% +{% + \ifx #2[\expandafter\XINT_fldiv_opt + \else\expandafter\XINT_fldiv_noopt + \fi #1#2% +}% +\def\XINT_fldiv_noopt #1#2\Z #3% +{% + #1[\XINT_digits]{\XINT_FL_Div {\XINT_digits+2}{#2}{#3}}% +}% +\def\XINT_fldiv_opt #1[\Z #2]#3#4% +{% + #1[#2]{\XINT_FL_Div {#2+2}{#3}{#4}}% +}% +\def\XINT_FL_Div #1#2% +{% + \expandafter\XINT_FL_Div_a\expandafter{\the\numexpr #1\expandafter}% + \expandafter{\romannumeral-`0\XINT_inFloat [#1]{#2}}% +}% +\def\XINT_FL_Div_a #1#2#3% +{% + \expandafter\XINT_FL_Div_b\romannumeral-`0\XINT_inFloat [#1]{#3}#2% +}% +\def\XINT_FL_Div_b #1[#2]#3[#4]{\xintE{#3/#1}{#4-#2}}% +\def\xintFloatPow {\romannumeral0\xintfloatpow}% +\def\xintfloatpow #1{\XINT_flpow_chkopt \xintfloat #1\Z }% +\def\XINTinFloatPow {\romannumeral-`0\XINTinfloatpow }% +\def\XINTinfloatpow #1{\XINT_flpow_chkopt \XINT_inFloat #1\Z }% +\def\XINT_flpow_chkopt #1#2% +{% + \ifx #2[\expandafter\XINT_flpow_opt + \else\expandafter\XINT_flpow_noopt + \fi + #1#2% +}% +\def\XINT_flpow_noopt #1#2\Z #3% +{% + \expandafter\XINT_flpow_checkB_start\expandafter + {\the\numexpr #3\expandafter}\expandafter + {\the\numexpr \XINT_digits}{#2}{#1[\XINT_digits]}% +}% +\def\XINT_flpow_opt #1[\Z #2]#3#4% +{% + \expandafter\XINT_flpow_checkB_start\expandafter + {\the\numexpr #4\expandafter}\expandafter + {\the\numexpr #2}{#3}{#1[#2]}% +}% +\def\XINT_flpow_checkB_start #1{\XINT_flpow_checkB_a #1\Z }% +\def\XINT_flpow_checkB_a #1% +{% + \xint_UDzerominusfork + #1-\dummy \XINT_flpow_BisZero + 0#1\dummy {\XINT_flpow_checkB_b 1}% + 0-\dummy {\XINT_flpow_checkB_b 0#1}% + \krof +}% +\def\XINT_flpow_BisZero \Z #1#2#3{#3{1/1[0]}}% +\def\XINT_flpow_checkB_b #1#2\Z #3% +{% + \expandafter\XINT_flpow_checkB_c \expandafter + {\romannumeral0\XINT_length{#2}}{#3}{#2}#1% +}% +\def\XINT_flpow_checkB_c #1#2% +{% + \expandafter\XINT_flpow_checkB_d \expandafter + {\the\numexpr \expandafter\XINT_Length\expandafter + {\the\numexpr #1*20/3}+#1+#2+1}% +}% +\def\XINT_flpow_checkB_d #1#2#3#4% +{% + \expandafter \XINT_flpow_a + \romannumeral-`0\XINT_inFloat [#1]{#4}{#1}{#2}#3% +}% +\def\XINT_flpow_a #1% +{% + \xint_UDzerominusfork + #1-\dummy \XINT_flpow_zero + 0#1\dummy {\XINT_flpow_b 1}% + 0-\dummy {\XINT_flpow_b 0#1}% + \krof +}% +\def\XINT_flpow_zero [#1]#2#3#4#5% +{% + \if #41 \xint_afterfi {\xintError:DivisionByZero\space 1.e2147483647}% + \else \xint_afterfi { 0.e0}\fi +}% +\def\XINT_flpow_b #1#2[#3]#4#5% +{% + \XINT_flpow_c {#4}{#5}{#2[#3]}{#1*\ifodd #5 1\else 0\fi}% +}% +\def\XINT_flpow_c #1#2#3#4% +{% + \XINT_flpow_loop {#1}{#2}{#3}{{#1}}\XINT_flpow_prd + \xint_relax + \xint_undef\xint_undef\xint_undef\xint_undef + \xint_undef\xint_undef\xint_undef\xint_undef + \xint_relax {#4}% +}% +\def\XINT_flpow_loop #1#2#3% +{% + \ifnum #2 = 1 + \expandafter\XINT_flpow_loop_end + \else + \xint_afterfi{\expandafter\XINT_flpow_loop_a + \expandafter{\the\numexpr 2*(#2/2)-#2\expandafter }% b mod 2 + \expandafter{\the\numexpr #2-#2/2\expandafter }% [b/2] + \expandafter{\romannumeral-`0\XINTinfloatmul [#1]{#3}{#3}}}% + \fi + {#1}{{#3}}% +}% +\def\XINT_flpow_loop_a #1#2#3#4% +{% + \ifnum #1 = 1 + \expandafter\XINT_flpow_loop + \else + \expandafter\XINT_flpow_loop_throwaway + \fi + {#4}{#2}{#3}% +}% +\def\XINT_flpow_loop_throwaway #1#2#3#4% +{% + \XINT_flpow_loop {#1}{#2}{#3}% +}% +\def\XINT_flpow_loop_end #1{\romannumeral0\XINT_rord_main {}\relax }% +\def\XINT_flpow_prd #1#2% +{% + \XINT_flpow_prd_getnext {#2}{#1}% +}% +\def\XINT_flpow_prd_getnext #1#2#3% +{% + \XINT_flpow_prd_checkiffinished #3\Z {#1}{#2}% +}% +\def\XINT_flpow_prd_checkiffinished #1% +{% + \xint_gob_til_relax #1\XINT_flpow_prd_end\relax + \XINT_flpow_prd_compute #1% +}% +\def\XINT_flpow_prd_compute #1\Z #2#3% +{% + \expandafter\XINT_flpow_prd_getnext\expandafter + {\romannumeral-`0\XINTinfloatmul [#3]{#1}{#2}}{#3}% +}% +\def\XINT_flpow_prd_end\relax\XINT_flpow_prd_compute + \relax\Z #1#2#3% +{% + \expandafter\XINT_flpow_conclude \the\numexpr #3\relax #1% +}% +\def\XINT_flpow_conclude #1#2[#3]#4% +{% + \expandafter\XINT_flpow_conclude_really\expandafter + {\the\numexpr\if #41 -\fi#3\expandafter}% + \xint_UDzerofork + #4\dummy {{#2}}% + 0\dummy {{1/#2}}% + \krof #1% +}% +\def\XINT_flpow_conclude_really #1#2#3#4% +{% + \xint_UDzerofork + #3\dummy {#4{#2[#1]}}% + 0\dummy {#4{-#2[#1]}}% + \krof +}% +\def\xintFloatPower {\romannumeral0\xintfloatpower}% +\def\xintfloatpower #1{\XINT_flpower_chkopt \xintfloat #1\Z }% +\def\XINTinFloatPower {\romannumeral-`0\XINTinfloatpower}% +\def\XINTinfloatpower #1{\XINT_flpower_chkopt \XINT_inFloat #1\Z }% +\def\XINT_flpower_chkopt #1#2% +{% + \ifx #2[\expandafter\XINT_flpower_opt + \else\expandafter\XINT_flpower_noopt + \fi + #1#2% +}% +\def\XINT_flpower_noopt #1#2\Z #3% +{% + \expandafter\XINT_flpower_checkB_start\expandafter + {\the\numexpr \XINT_digits\expandafter}\expandafter + {\romannumeral0\xintnum{#3}}{#2}{#1[\XINT_digits]}% +}% +\def\XINT_flpower_opt #1[\Z #2]#3#4% +{% + \expandafter\XINT_flpower_checkB_start\expandafter + {\the\numexpr #2\expandafter}\expandafter + {\romannumeral0\xintnum{#4}}{#3}{#1[#2]}% +}% +\def\XINT_flpower_checkB_start #1#2{\XINT_flpower_checkB_a #2\Z {#1}}% +\def\XINT_flpower_checkB_a #1% +{% + \xint_UDzerominusfork + #1-\dummy \XINT_flpower_BisZero + 0#1\dummy {\XINT_flpower_checkB_b 1}% + 0-\dummy {\XINT_flpower_checkB_b 0#1}% + \krof +}% +\def\XINT_flpower_BisZero \Z #1#2#3{#3{1/1[0]}}% +\def\XINT_flpower_checkB_b #1#2\Z #3% +{% + \expandafter\XINT_flpower_checkB_c \expandafter + {\romannumeral0\XINT_length{#2}}{#3}{#2}#1% +}% +\def\XINT_flpower_checkB_c #1#2% +{% + \expandafter\XINT_flpower_checkB_d \expandafter + {\the\numexpr \expandafter\XINT_Length\expandafter + {\the\numexpr #1*20/3}+#1+#2+1}% +}% +\def\XINT_flpower_checkB_d #1#2#3#4% +{% + \expandafter \XINT_flpower_a + \romannumeral-`0\XINT_inFloat [#1]{#4}{#1}{#2}#3% +}% +\def\XINT_flpower_a #1% +{% + \xint_UDzerominusfork + #1-\dummy \XINT_flpower_zero + 0#1\dummy {\XINT_flpower_b 1}% + 0-\dummy {\XINT_flpower_b 0#1}% + \krof +}% +\def\XINT_flpower_zero [#1]#2#3#4#5% +{% + \if #41 + \xint_afterfi {\xintError:DivisionByZero\space 1.e2147483647}% + \else \xint_afterfi { 0.e0}\fi +}% +\def\XINT_flpower_b #1#2[#3]#4#5% +{% + \XINT_flpower_c {#4}{#5}{#2[#3]}{#1*\xintOdd {#5}}% +}% +\def\XINT_flpower_c #1#2#3#4% +{% + \XINT_flpower_loop {#1}{#2}{#3}{{#1}}\XINT_flpow_prd + \xint_relax + \xint_undef\xint_undef\xint_undef\xint_undef + \xint_undef\xint_undef\xint_undef\xint_undef + \xint_relax {#4}% +}% +\def\XINT_flpower_loop #1#2#3% +{% + \ifcase\XINT_isOne {#2} + \xint_afterfi{\expandafter\XINT_flpower_loop_x\expandafter + {\romannumeral-`0\XINTinfloatmul [#1]{#3}{#3}}% + {\romannumeral0\xintdivision {#2}{2}}}% + \or \expandafter\XINT_flpow_loop_end + \fi + {#1}{{#3}}% +}% +\def\XINT_flpower_loop_x #1#2{\expandafter\XINT_flpower_loop_a #2{#1}}% +\def\XINT_flpower_loop_a #1#2#3#4% +{% + \ifnum #2 = 1 + \expandafter\XINT_flpower_loop + \else + \expandafter\XINT_flpower_loop_throwaway + \fi + {#4}{#1}{#3}% +}% +\def\XINT_flpower_loop_throwaway #1#2#3#4% +{% + \XINT_flpower_loop {#1}{#2}{#3}% +}% \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 77bee301efe..702fa0c78a5 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.06b of May 14, 2013) +%% The xint bundle (version 1.07a of May 26, 2013) %% xintgcd: Euclidean algorithm with xint package %% Copyright (C) 2013 by Jean-Francois Burnol %%---------------------------------------------------------------- @@ -164,7 +164,7 @@ \fi \expandafter\x\csname ver@xintgcd.sty\endcsname \ProvidesPackage{xintgcd}% - [2013/05/14 v1.06b Euclide algorithm with xint package (jfB)]% + [2013/05/26 v1.07a 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 7d6c1bc0901..f1b6d882e85 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.06b of May 14, 2013) +%% The xint bundle (version 1.07a of May 26, 2013) %% xintseries: Expandable partial sums with xint package %% Copyright (C) 2013 by Jean-Francois Burnol %%---------------------------------------------------------------- @@ -164,7 +164,7 @@ \fi \expandafter\x\csname ver@xintseries.sty\endcsname \ProvidesPackage{xintseries}% - [2013/05/14 v1.06b Expandable partial sums with xint package (jfB)]% + [2013/05/26 v1.07a Expandable partial sums with xint package (jfB)]% \def\xintSeries {\romannumeral0\xintseries }% \def\xintseries #1#2% {% -- cgit v1.2.3