diff options
author | Karl Berry <karl@freefriends.org> | 2013-12-18 22:00:14 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-12-18 22:00:14 +0000 |
commit | e715b1673cfe57d1b73e0298497daa2ed19f17af (patch) | |
tree | 1903e5fa3cdef12995050bf0064966c1fa097713 /Master/texmf-dist/tex/generic/xint | |
parent | dc42edf41fdf637675cb7d76876773c4ac5df883 (diff) |
xint (18dec13)
git-svn-id: svn://tug.org/texlive/trunk@32436 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/xint')
-rw-r--r-- | Master/texmf-dist/tex/generic/xint/xint.sty | 644 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/xint/xintbinhex.sty | 62 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/xint/xintcfrac.sty | 24 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/xint/xintexpr.sty | 670 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/xint/xintfrac.sty | 457 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/xint/xintgcd.sty | 79 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/xint/xintseries.sty | 4 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/xint/xinttools.sty | 96 |
8 files changed, 1146 insertions, 890 deletions
diff --git a/Master/texmf-dist/tex/generic/xint/xint.sty b/Master/texmf-dist/tex/generic/xint/xint.sty index 96aa0c6fcad..d51548b4f59 100644 --- a/Master/texmf-dist/tex/generic/xint/xint.sty +++ b/Master/texmf-dist/tex/generic/xint/xint.sty @@ -21,7 +21,7 @@ %% same distribution. (The sources need not necessarily be %% in the same archive or directory.) %%---------------------------------------------------------------- -%% The xint bundle (version 1.09h of November 28, 2013) +%% The xint bundle (version 1.09i of December 18, 2013) %% xint: Expandable operations on long numbers %% Copyright (C) 2013 by Jean-Francois Burnol %%---------------------------------------------------------------- @@ -103,10 +103,13 @@ \XINTsetupcatcodes% \XINT_providespackage \ProvidesPackage{xint}% - [2013/11/28 v1.09h Expandable operations on long numbers (jfB)]% + [2013/12/18 v1.09i Expandable operations on long numbers (jfB)]% \long\def\xint_firstofthree #1#2#3{#1}% \long\def\xint_secondofthree #1#2#3{#2}% \long\def\xint_thirdofthree #1#2#3{#3}% +\long\def\xint_firstofthree_afterstop #1#2#3{ #1}% 1.09i +\long\def\xint_secondofthree_afterstop #1#2#3{ #2}% +\long\def\xint_thirdofthree_afterstop #1#2#3{ #3}% \def\xint_gob_til_zero #10{}% \def\xint_gob_til_zeros_iii #1000{}% \def\xint_gob_til_zeros_iv #10000{}% @@ -114,15 +117,16 @@ \def\xint_gob_til_G #1G{}% \def\xint_gob_til_minus #1-{}% \def\xint_gob_til_relax #1\relax {}% -\def\xint_exchangetwo_keepbraces_andstop #1#2{ {#2}{#1}}% -\def\xint_UDzerofork #10\dummy #2#3\krof {#2}% -\def\xint_UDsignfork #1-\dummy #2#3\krof {#2}% -\def\xint_UDwfork #1\W\dummy #2#3\krof {#2}% -\def\xint_UDzerosfork #100\dummy #2#3\krof {#2}% -\def\xint_UDonezerofork #110\dummy #2#3\krof {#2}% -\def\xint_UDzerominusfork #10-\dummy #2#3\krof {#2}% -\def\xint_UDsignsfork #1--\dummy #2#3\krof {#2}% -\chardef\xint_c_i 1 % 0 and 8 in xinttools +\def\xint_exchangetwo_keepbraces #1#2{{#2}{#1}}% +\def\xint_exchangetwo_keepbraces_afterstop #1#2{ {#2}{#1}}% +\def\xint_UDzerofork #10#2#3\krof {#2}% +\def\xint_UDsignfork #1-#2#3\krof {#2}% +\def\xint_UDwfork #1\W#2#3\krof {#2}% +\def\xint_UDzerosfork #100#2#3\krof {#2}% +\def\xint_UDonezerofork #110#2#3\krof {#2}% +\def\xint_UDzerominusfork #10-#2#3\krof {#2}% +\def\xint_UDsignsfork #1--#2#3\krof {#2}% +\chardef\xint_c_i 1 \chardef\xint_c_ii 2 \chardef\xint_c_iii 3 \chardef\xint_c_iv 4 @@ -142,8 +146,8 @@ \def\XINT_rev_fork #1% {% \xint_UDsignfork - #1\dummy {\expandafter\xint_minus_andstop\romannumeral0\XINT_rord_main {}}% - -\dummy {\XINT_rord_main {}#1}% + #1{\expandafter\xint_minus_afterstop\romannumeral0\XINT_rord_main {}}% + -{\XINT_rord_main {}#1}% \krof }% \def\xintLen {\romannumeral0\xintlen }% @@ -163,8 +167,8 @@ {% \expandafter\XINT_length_loop \xint_UDsignfork - #1\dummy {{0}}% - -\dummy {{0}#1}% + #1{{0}}% + -{{0}#1}% \krof }% \def\XINT_RQ #1#2#3#4#5#6#7#8#9% @@ -252,9 +256,9 @@ \def\XINT_OQ_end_iii #1\Z #2#3#4#5#6#7#8#9\Z { #4#5#6#7#8#9000}% \def\XINT_OQ_end_ii #1\Z #2#3#4#5#6#7#8#9\Z { #3#4#5#6#7#8#900}% \def\XINT_OQ_end_i \Z #1#2#3#4#5#6#7#8\Z { #1#2#3#4#5#6#7#80}% -\def\xint_cleanupzeros_andstop #1#2#3#4% +\edef\xint_cleanupzeros_andstop #1#2#3#4% {% - \expandafter\space\the\numexpr #1#2#3#4\relax + \noexpand\expandafter\space\noexpand\the\numexpr #1#2#3#4\relax }% \def\xint_cleanupzeros_nospace #1#2#3#4% {% @@ -283,9 +287,9 @@ {% \xint_cuz_end_b #2% }% -\def\xint_cuz_end_b #1#2#3#4#5\Z +\edef\xint_cuz_end_b #1#2#3#4#5\Z {% - \expandafter\space\the\numexpr #1#2#3#4\relax + \noexpand\expandafter\space\noexpand\the\numexpr #1#2#3#4\relax }% \def\xint_cuz_end_A \Z\XINT_cuz_check_a #1{ 0}% \def\XINT_cuz_check_a #1% @@ -298,8 +302,8 @@ }% \def\XINT_cuz_stop #1\W #2\Z{ #1}% \def\xint_cuz_backtoloop 0\XINT_cuz_stop 0{\XINT_cuz_loop }% -\def\xintIsOne {\romannumeral0\xintisone }% -\def\xintisone #1{\expandafter\XINT_isone \romannumeral0\xintnum{#1}\W\Z }% +\def\xintIsOne {\romannumeral0\xintisone }% +\def\xintisone #1{\expandafter\XINT_isone\romannumeral0\xintnum{#1}\W\Z }% \def\XINT_isOne #1{\romannumeral0\XINT_isone #1\W\Z }% \def\XINT_isone #1#2% {% @@ -330,9 +334,9 @@ \xint_gob_til_xint_relax #8\XINT_num_end\xint_relax \XINT_num_NumEight #1#2#3#4#5#6#7#8% }% -\def\XINT_num_end\xint_relax\XINT_num_NumEight #1\xint_relax #2\Z +\edef\XINT_num_end\xint_relax\XINT_num_NumEight #1\xint_relax #2\Z {% - \expandafter\space\the\numexpr #1+0\relax + \noexpand\expandafter\space\noexpand\the\numexpr #1+0\relax }% \def\XINT_num_NumEight #1#2#3#4#5#6#7#8% {% @@ -361,13 +365,28 @@ {% \expandafter\XINT_sgn \romannumeral0\xintnum{#1}\Z% }% -\def\XINT_Sgn #1{\romannumeral0\XINT_sgn #1\Z }% \def\XINT_sgn #1#2\Z {% \xint_UDzerominusfork - #1-\dummy { 0}% - 0#1\dummy { -1}% - 0-\dummy { 1}% + #1-{ 0}% + 0#1{ -1}% + 0-{ 1}% + \krof +}% +\def\XINT_Sgn #1#2\Z +{% + \xint_UDzerominusfork + #1-{0}% + 0#1{-1}% + 0-{1}% + \krof +}% +\def\XINT__Sgn #1#2\Z +{% + \xint_UDzerominusfork + #1-\z@ + 0#1\m@ne + 0-\@ne \krof }% \def\xintBool #1{\romannumeral-`0% @@ -376,80 +395,98 @@ \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}% + \ifcase #1 \expandafter\xint_secondofthree_afterstop + \or\expandafter\xint_thirdofthree_afterstop + \else\expandafter\xint_firstofthree_afterstop + \fi +}% +\def\XINT__SgnFork #1% +{% + \ifcase #1\expandafter\xint_secondofthree + \or\expandafter\xint_thirdofthree + \else\expandafter\xint_firstofthree \fi }% \def\xintifSgn {\romannumeral0\xintifsgn }% \def\xintifsgn #1% {% \ifcase \romannumeral0\xintsgn{#1} - \xint_afterfi{\expandafter\space\xint_secondofthree}% - \or\xint_afterfi{\expandafter\space\xint_thirdofthree}% - \else\xint_afterfi{\expandafter\space\xint_firstofthree}% + \expandafter\xint_secondofthree_afterstop + \or\expandafter\xint_thirdofthree_afterstop + \else\expandafter\xint_firstofthree_afterstop \fi }% \def\xintifZero {\romannumeral0\xintifzero }% \def\xintifzero #1% {% - \if\xintSgn{\xintAbs{#1}}0% - \xint_afterfi{\expandafter\space\xint_firstoftwo}% + \if0\xintSgn{#1}% + \expandafter\xint_firstoftwo_afterstop \else - \xint_afterfi{\expandafter\space\xint_secondoftwo}% + \expandafter\xint_secondoftwo_afterstop \fi }% \def\xintifNotZero {\romannumeral0\xintifnotzero }% \def\xintifnotzero #1% {% - \if\xintSgn{\xintAbs{#1}}1% - \xint_afterfi{\expandafter\space\xint_firstoftwo}% + \if0\xintSgn{#1}% + \expandafter\xint_secondoftwo_afterstop \else - \xint_afterfi{\expandafter\space\xint_secondoftwo}% + \expandafter\xint_firstoftwo_afterstop \fi }% +\def\xintifOne {\romannumeral0\xintifone }% +\def\xintifone #1% +{% + \if1\xintIsOne{#1}% + \expandafter\xint_firstoftwo_afterstop + \else + \expandafter\xint_secondoftwo_afterstop + \fi +}% +\let\xintifTrueAelseB\xintifNotZero +\let\xintifFalseAelseB\xintifZero \let\xintifTrue\xintifNotZero \let\xintifTrueFalse\xintifNotZero \def\xintifCmp {\romannumeral0\xintifcmp }% \def\xintifcmp #1#2% {% - \ifcase \xintCmp {#1}{#2} - \xint_afterfi{\expandafter\space\xint_secondofthree}% - \or\xint_afterfi{\expandafter\space\xint_thirdofthree}% - \else\xint_afterfi{\expandafter\space\xint_firstofthree}% + \ifcase\xintCmp {#1}{#2} + \expandafter\xint_secondofthree_afterstop + \or\expandafter\xint_thirdofthree_afterstop + \else\expandafter\xint_firstofthree_afterstop \fi }% \def\xintifEq {\romannumeral0\xintifeq }% \def\xintifeq #1#2% {% - \if\xintCmp{#1}{#2}0% - \xint_afterfi{\expandafter\space\xint_firstoftwo}% - \else\xint_afterfi{\expandafter\space\xint_secondoftwo}% + \if0\xintCmp{#1}{#2}% + \expandafter\xint_firstoftwo_afterstop + \else\expandafter\xint_secondoftwo_afterstop \fi }% \def\xintifGt {\romannumeral0\xintifgt }% \def\xintifgt #1#2% {% - \if\xintCmp{#1}{#2}1% - \xint_afterfi{\expandafter\space\xint_firstoftwo}% - \else\xint_afterfi{\expandafter\space\xint_secondoftwo}% + \if1\xintCmp{#1}{#2}% + \expandafter\xint_firstoftwo_afterstop + \else\expandafter\xint_secondoftwo_afterstop \fi }% \def\xintifLt {\romannumeral0\xintiflt }% \def\xintiflt #1#2% {% - \xintSgnFork{\xintCmp{#1}{#2}}% - {\expandafter\space\xint_firstoftwo}% - {\expandafter\space\xint_secondoftwo}% - {\expandafter\space\xint_secondoftwo}% + \ifnum\xintCmp{#1}{#2}<\xint_c_ + \expandafter\xint_firstoftwo_afterstop + \else \expandafter\xint_secondoftwo_afterstop + \fi }% \def\xintifOdd {\romannumeral0\xintifodd }% \def\xintifodd #1% {% \if\xintOdd{#1}1% - \xint_afterfi{\expandafter\space\xint_firstoftwo}% + \expandafter\xint_firstoftwo_afterstop \else - \xint_afterfi{\expandafter\space\xint_secondoftwo}% + \expandafter\xint_secondoftwo_afterstop \fi }% \def\xintiiOpp {\romannumeral0\xintiiopp }% @@ -467,9 +504,9 @@ \def\XINT_opp #1% {% \xint_UDzerominusfork - #1-\dummy { 0}% zero - 0#1\dummy { }% negative - 0-\dummy { -#1}% positive + #1-{ 0}% zero + 0#1{ }% negative + 0-{ -#1}% positive \krof }% \def\xintiiAbs {\romannumeral0\xintiiabs }% @@ -487,8 +524,8 @@ \def\XINT_abs #1% {% \xint_UDsignfork - #1\dummy { }% - -\dummy { #1}% + #1{ }% + -{ #1}% \krof }% \def\XINT_add_A #1#2#3#4#5#6% @@ -680,8 +717,8 @@ \XINT_addm_end #1#3% }% \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}% +\edef\XINT_addm_end #1#2#3#4#5% + {\noexpand\expandafter\space\noexpand\the\numexpr #1#2#3#4#5\relax}% \def\XINT_addp_A #1#2#3#4#5#6% {% \xint_gob_til_W #3\xint_addp_az\W @@ -837,14 +874,14 @@ \def\XINT_add_fork #1#2\Z #3#4\Z {% \xint_UDzerofork - #1\dummy \XINT_add_secondiszero - #3\dummy \XINT_add_firstiszero - 0\dummy + #1\XINT_add_secondiszero + #3\XINT_add_firstiszero + 0 {\xint_UDsignsfork - #1#3\dummy \XINT_add_minusminus % #1 = #3 = - - #1-\dummy \XINT_add_minusplus % #1 = - - #3-\dummy \XINT_add_plusminus % #3 = - - --\dummy \XINT_add_plusplus + #1#3\XINT_add_minusminus % #1 = #3 = - + #1-\XINT_add_minusplus % #1 = - + #3-\XINT_add_plusminus % #3 = - + --\XINT_add_plusplus \krof }% \krof {#2}{#4}#1#3% @@ -853,7 +890,7 @@ \def\XINT_add_firstiszero #1#2#3#4{ #3#1}% \def\XINT_add_minusminus #1#2#3#4% {% - \expandafter\xint_minus_andstop% + \expandafter\xint_minus_afterstop% \romannumeral0\XINT_add_pre {#2}{#1}% }% \def\XINT_add_minusplus #1#2#3#4% @@ -904,13 +941,13 @@ \def\XINT_sub_fork #1#2\Z #3#4\Z {% \xint_UDsignsfork - #1#3\dummy \XINT_sub_minusminus - #1-\dummy \XINT_sub_minusplus % attention, #3=0 possible - #3-\dummy \XINT_sub_plusminus % attention, #1=0 possible - --\dummy {\xint_UDzerofork - #1\dummy \XINT_sub_secondiszero - #3\dummy \XINT_sub_firstiszero - 0\dummy \XINT_sub_plusplus + #1#3\XINT_sub_minusminus + #1-\XINT_sub_minusplus % attention, #3=0 possible + #3-\XINT_sub_plusminus % attention, #1=0 possible + --{\xint_UDzerofork + #1\XINT_sub_secondiszero + #3\XINT_sub_firstiszero + 0\XINT_sub_plusplus \krof }% \krof {#2}{#4}#1#3% @@ -932,7 +969,7 @@ \def\xint_sub_mp0\XINT_add_pre #1#2{ #2}% \def\XINT_sub_plusminus #1#2#3#4% {% - \xint_gob_til_zero #3\xint_sub_pm0\expandafter\xint_minus_andstop% + \xint_gob_til_zero #3\xint_sub_pm0\expandafter\xint_minus_afterstop% \romannumeral0\XINT_add_pre {#2}{#3#1}% }% \def\xint_sub_pm #1\XINT_add_pre #2#3{ -#2}% @@ -972,8 +1009,8 @@ \W\XINT_sub_onestep #1#2#3#4#5#6#7% {% \xint_UDzerofork - #1\dummy \XINT_sub_C % une retenue - 0\dummy \XINT_sub_D % pas de retenue + #1\XINT_sub_C % une retenue + 0\XINT_sub_D % pas de retenue \krof {#7}#2#3#4#5% }% @@ -1057,13 +1094,13 @@ \def\xint_sub_F\W\XINT_sub_Eonestep #1#2#3#4% {% \xint_UDonezerofork - #4#1\dummy {\XINT_sub_Fdec 0}% soustraire 1. Et faire signe - - #1#4\dummy {\XINT_sub_Finc 1}% additionner 1. Et faire signe - - 10\dummy \XINT_sub_DD % terminer. Mais avec signe - + #4#1{\XINT_sub_Fdec 0}% soustraire 1. Et faire signe - + #1#4{\XINT_sub_Finc 1}% additionner 1. Et faire signe - + 10\XINT_sub_DD % terminer. Mais avec signe - \krof {#3}% }% -\def\XINT_sub_DD {\expandafter\xint_minus_andstop\romannumeral0\XINT_sub_D }% +\def\XINT_sub_DD {\expandafter\xint_minus_afterstop\romannumeral0\XINT_sub_D }% \def\XINT_sub_Fdec #1#2#3#4#5#6% {% \xint_gob_til_W #3\xint_sub_Fdec_finish\W @@ -1079,7 +1116,7 @@ }% \def\xint_sub_Fdec_finish\W\XINT_sub_Fdec_onestep #1#2% {% - \expandafter\xint_minus_andstop\romannumeral0\XINT_cuz + \expandafter\xint_minus_afterstop\romannumeral0\XINT_cuz }% \def\XINT_sub_Finc #1#2#3#4#5#6% {% @@ -1097,16 +1134,16 @@ \def\xint_sub_Finc_finish\W\XINT_sub_Finc_onestep #1#2#3% {% \xint_UDzerofork - #1\dummy {\expandafter\xint_minus_andstop\xint_cleanupzeros_nospace}% - 0\dummy { -1}% + #1{\expandafter\xint_minus_afterstop\xint_cleanupzeros_nospace}% + 0{ -1}% \krof #3% }% \def\xint_sub_ez\W\XINT_sub_Eenter #1% {% \xint_UDzerofork - #1\dummy \XINT_sub_K % il y a une retenue - 0\dummy \XINT_sub_L % pas de retenue + #1\XINT_sub_K % il y a une retenue + 0\XINT_sub_L % pas de retenue \krof }% \def\XINT_sub_L #1\W\X\Y\Z {\XINT_cuz_loop #1\W\W\W\W\W\W\W\Z }% @@ -1136,7 +1173,7 @@ }% \def\xint_sub_KK_finish\W\XINT_sub_KK_onestep #1#2#3% {% - \expandafter\xint_minus_andstop + \expandafter\xint_minus_afterstop \romannumeral0\XINT_cuz_loop #3\W\W\W\W\W\W\W\Z }% \def\xintCmp {\romannumeral0\xintcmp }% @@ -1152,14 +1189,14 @@ \def\XINT_cmp_fork #1#2\Z #3#4\Z {% \xint_UDsignsfork - #1#3\dummy \XINT_cmp_minusminus - #1-\dummy \XINT_cmp_minusplus - #3-\dummy \XINT_cmp_plusminus - --\dummy {\xint_UDzerosfork - #1#3\dummy \XINT_cmp_zerozero - #10\dummy \XINT_cmp_zeroplus - #30\dummy \XINT_cmp_pluszero - 00\dummy \XINT_cmp_plusplus + #1#3\XINT_cmp_minusminus + #1-\XINT_cmp_minusplus + #3-\XINT_cmp_plusminus + --{\xint_UDzerosfork + #1#3\XINT_cmp_zerozero + #10\XINT_cmp_zeroplus + #30\XINT_cmp_pluszero + 00\XINT_cmp_plusplus \krof }% \krof {#2}{#4}#1#3% @@ -1217,8 +1254,8 @@ \def\xint_cmp_ez\W\XINT_cmp_Eenter #1% {% \xint_UDzerofork - #1\dummy \XINT_cmp_K % il y a une retenue - 0\dummy \XINT_cmp_L % pas de retenue + #1\XINT_cmp_K % il y a une retenue + 0\XINT_cmp_L % pas de retenue \krof }% \def\XINT_cmp_K #1\Z { -1}% @@ -1252,45 +1289,48 @@ \def\xintLt {\romannumeral0\xintlt }% \def\xintlt #1#2{\xintiflt{#1}{#2}{1}{0}}% \def\xintIsZero {\romannumeral0\xintiszero }% -\def\xintiszero #1{\xintifsgn {#1}{0}{1}{0}}% +\def\xintiszero #1{\if0\xintSgn{#1}\xint_afterfi{ 1}\else\xint_afterfi{ 0}\fi}% \def\xintIsNotZero {\romannumeral0\xintisnotzero }% -\def\xintisnotzero #1{\xintifsgn {#1}{1}{0}{1}}% +\def\xintisnotzero + #1{\if0\xintSgn{#1}\xint_afterfi{ 0}\else\xint_afterfi{ 1}\fi}% \let\xintIsTrue\xintIsNotZero \let\xintNot\xintIsZero +\let\xintIsFalse\xintIsZero \def\xintIsTrue:csv #1{\expandafter\XINT_istrue:_a\romannumeral-`0#1,,^}% \def\XINT_istrue:_a {\XINT_istrue:_b {}}% \def\XINT_istrue:_b #1#2,% {\expandafter\XINT_istrue:_c\romannumeral-`0#2,{#1}}% -\def\XINT_istrue:_c #1{\if #1,\expandafter\XINT_istrue:_f +\def\XINT_istrue:_c #1{\if #1,\expandafter\XINT_:_f \else\expandafter\XINT_istrue:_d\fi #1}% \def\XINT_istrue:_d #1,% {\expandafter\XINT_istrue:_e\romannumeral0\xintisnotzero {#1},}% \def\XINT_istrue:_e #1,#2{\XINT_istrue:_b {#2,#1}}% -\def\XINT_istrue:_f ,#1#2^{\xint_gobble_i #1}% +\def\XINT_:_f ,#1#2^{\xint_gobble_i #1}% \def\xintAND {\romannumeral0\xintand }% -\def\xintand #1#2{\xintifzero {#1}{0}{\xintifzero {#2}{0}{1}}}% +\def\xintand #1#2{\if0\xintSgn{#1}\expandafter\xint_firstoftwo + \else\expandafter\xint_secondoftwo\fi + { 0}{\xintisnotzero{#2}}}% \def\xintOR {\romannumeral0\xintor }% -\def\xintor #1#2{\xintifzero {#1}{\xintifzero {#2}{0}{1}}{1}}% +\def\xintor #1#2{\if0\xintSgn{#1}\expandafter\xint_firstoftwo + \else\expandafter\xint_secondoftwo\fi + {\xintisnotzero{#2}}{ 1}}% \def\xintXOR {\romannumeral0\xintxor }% -\def\xintxor #1#2{\ifcase \numexpr\xintIsZero{#1}+\xintIsZero{#2}\relax - \xint_afterfi{ 0}% - \or\xint_afterfi{ 1}% - \else\xint_afterfi { 0}% - \fi }% +\def\xintxor #1#2{\if\xintIsZero{#1}\xintIsZero{#2}% + \xint_afterfi{ 0}\else\xint_afterfi{ 1}\fi }% \def\xintANDof {\romannumeral0\xintandof }% \def\xintandof #1{\expandafter\XINT_andof_a\romannumeral-`0#1\relax }% \def\XINT_andof_a #1{\expandafter\XINT_andof_b\romannumeral-`0#1\Z }% \def\XINT_andof_b #1% {\xint_gob_til_relax #1\XINT_andof_e\relax\XINT_andof_c #1}% \def\XINT_andof_c #1\Z - {\xintifZero{#1}{\XINT_andof_no}{\XINT_andof_a}}% + {\xintifTrueAelseB {#1}{\XINT_andof_a}{\XINT_andof_no}}% \def\XINT_andof_no #1\relax { 0}% \def\XINT_andof_e #1\Z { 1}% \def\xintANDof:csv #1{\expandafter\XINT_andof:_a\romannumeral-`0#1,,^}% \def\XINT_andof:_a {\expandafter\XINT_andof:_b\romannumeral-`0}% \def\XINT_andof:_b #1{\if #1,\expandafter\XINT_andof:_e \else\expandafter\XINT_andof:_c\fi #1}% -\def\XINT_andof:_c #1,{\xintifZero{#1}{\XINT_andof:_no}{\XINT_andof:_a}}% +\def\XINT_andof:_c #1,{\xintifTrueAelseB {#1}{\XINT_andof:_a}{\XINT_andof:_no}}% \def\XINT_andof:_no #1^{0}% \def\XINT_andof:_e #1^{1}% \def\xintORof {\romannumeral0\xintorof }% @@ -1299,14 +1339,14 @@ \def\XINT_orof_b #1% {\xint_gob_til_relax #1\XINT_orof_e\relax\XINT_orof_c #1}% \def\XINT_orof_c #1\Z - {\xintifZero{#1}{\XINT_orof_a}{\XINT_orof_yes}}% + {\xintifTrueAelseB {#1}{\XINT_orof_yes}{\XINT_orof_a}}% \def\XINT_orof_yes #1\relax { 1}% \def\XINT_orof_e #1\Z { 0}% \def\xintORof:csv #1{\expandafter\XINT_orof:_a\romannumeral-`0#1,,^}% \def\XINT_orof:_a {\expandafter\XINT_orof:_b\romannumeral-`0}% \def\XINT_orof:_b #1{\if #1,\expandafter\XINT_orof:_e \else\expandafter\XINT_orof:_c\fi #1}% -\def\XINT_orof:_c #1,{\xintifZero{#1}{\XINT_orof:_a}{\XINT_orof:_yes}}% +\def\XINT_orof:_c #1,{\xintifTrueAelseB{#1}{\XINT_orof:_yes}{\XINT_orof:_a}}% \def\XINT_orof:_yes #1^{1}% \def\XINT_orof:_e #1^{0}% \def\xintXORof {\romannumeral0\xintxorof }% @@ -1316,26 +1356,22 @@ \def\XINT_xorof_b #1% {\xint_gob_til_relax #1\XINT_xorof_e\relax\XINT_xorof_c #1}% \def\XINT_xorof_c #1\Z #2% - {\xintifZero {#1}{\XINT_xorof_a #2}{\ifcase #2 - \xint_afterfi{\XINT_xorof_a 1}% - \else - \xint_afterfi{\XINT_xorof_a 0}% - \fi }% + {\xintifTrueAelseB {#1}{\if #20\xint_afterfi{\XINT_xorof_a 1}% + \else\xint_afterfi{\XINT_xorof_a 0}\fi}% + {\XINT_xorof_a #2}% }% \def\XINT_xorof_e #1\Z #2{ #2}% \def\xintXORof:csv #1{\expandafter\XINT_xorof:_a\expandafter 0\romannumeral-`0#1,,^}% \def\XINT_xorof:_a #1#2,{\expandafter\XINT_xorof:_b\romannumeral-`0#2,#1}% -\def\XINT_xorof:_b #1{\if #1,\expandafter\XINT_xorof:_e +\def\XINT_xorof:_b #1{\if #1,\expandafter\XINT_:_e \else\expandafter\XINT_xorof:_c\fi #1}% \def\XINT_xorof:_c #1,#2% - {\xintifZero {#1}{\XINT_xorof:_a #2}{\ifcase #2 - \xint_afterfi{\XINT_xorof:_a 1}% - \else - \xint_afterfi{\XINT_xorof:_a 0}% - \fi }% + {\xintifTrueAelseB {#1}{\if #20\xint_afterfi{\XINT_xorof:_a 1}% + \else\xint_afterfi{\XINT_xorof:_a 0}\fi}% + {\XINT_xorof:_a #2}% }% -\def\XINT_xorof:_e ,#1#2^{#1}% allows empty list +\def\XINT_:_e ,#1#2^{#1}% allows empty list \def\xintGeq {\romannumeral0\xintgeq }% \def\xintgeq #1% {% @@ -1349,13 +1385,13 @@ \def\XINT_geq_fork #1#2\Z #3#4\Z {% \xint_UDzerofork - #1\dummy \XINT_geq_secondiszero % |#1#2|=0 - #3\dummy \XINT_geq_firstiszero % |#1#2|>0 - 0\dummy {\xint_UDsignsfork - #1#3\dummy \XINT_geq_minusminus - #1-\dummy \XINT_geq_minusplus - #3-\dummy \XINT_geq_plusminus - --\dummy \XINT_geq_plusplus + #1\XINT_geq_secondiszero % |#1#2|=0 + #3\XINT_geq_firstiszero % |#1#2|>0 + 0{\xint_UDsignsfork + #1#3\XINT_geq_minusminus + #1-\XINT_geq_minusplus + #3-\XINT_geq_plusminus + --\XINT_geq_plusplus \krof }% \krof {#2}{#4}#1#3% @@ -1406,8 +1442,8 @@ \def\xint_geq_ez\W\XINT_geq_Eenter #1% {% \xint_UDzerofork - #1\dummy { 0} % il y a une retenue - 0\dummy { 1} % pas de retenue + #1{ 0} % il y a une retenue + 0{ 1} % pas de retenue \krof }% \def\xintiMax {\romannumeral0\xintimax }% @@ -1425,37 +1461,37 @@ \def\XINT_max_fork #1#2\Z #3#4\Z {% \xint_UDsignsfork - #1#3\dummy \XINT_max_minusminus % A < 0, B < 0 - #1-\dummy \XINT_max_minusplus % B < 0, A >= 0 - #3-\dummy \XINT_max_plusminus % A < 0, B >= 0 - --\dummy {\xint_UDzerosfork - #1#3\dummy \XINT_max_zerozero % A = B = 0 - #10\dummy \XINT_max_zeroplus % B = 0, A > 0 - #30\dummy \XINT_max_pluszero % A = 0, B > 0 - 00\dummy \XINT_max_plusplus % A, B > 0 + #1#3\XINT_max_minusminus % A < 0, B < 0 + #1-\XINT_max_minusplus % B < 0, A >= 0 + #3-\XINT_max_plusminus % A < 0, B >= 0 + --{\xint_UDzerosfork + #1#3\XINT_max_zerozero % A = B = 0 + #10\XINT_max_zeroplus % B = 0, A > 0 + #30\XINT_max_pluszero % A = 0, B > 0 + 00\XINT_max_plusplus % A, B > 0 \krof }% \krof {#2}{#4}#1#3% }% -\def\XINT_max_zerozero #1#2#3#4{\xint_firstoftwo_andstop }% -\def\XINT_max_zeroplus #1#2#3#4{\xint_firstoftwo_andstop }% -\def\XINT_max_pluszero #1#2#3#4{\xint_secondoftwo_andstop }% -\def\XINT_max_minusplus #1#2#3#4{\xint_firstoftwo_andstop }% -\def\XINT_max_plusminus #1#2#3#4{\xint_secondoftwo_andstop }% +\def\XINT_max_zerozero #1#2#3#4{\xint_firstoftwo_afterstop }% +\def\XINT_max_zeroplus #1#2#3#4{\xint_firstoftwo_afterstop }% +\def\XINT_max_pluszero #1#2#3#4{\xint_secondoftwo_afterstop }% +\def\XINT_max_minusplus #1#2#3#4{\xint_firstoftwo_afterstop }% +\def\XINT_max_plusminus #1#2#3#4{\xint_secondoftwo_afterstop }% \def\XINT_max_plusplus #1#2#3#4% {% \ifodd\XINT_Geq {#4#2}{#3#1} - \expandafter\xint_firstoftwo_andstop + \expandafter\xint_firstoftwo_afterstop \else - \expandafter\xint_secondoftwo_andstop + \expandafter\xint_secondoftwo_afterstop \fi }% \def\XINT_max_minusminus #1#2#3#4% {% \ifodd\XINT_Geq {#1}{#2} - \expandafter\xint_firstoftwo_andstop + \expandafter\xint_firstoftwo_afterstop \else - \expandafter\xint_secondoftwo_andstop + \expandafter\xint_secondoftwo_afterstop \fi }% \def\xintiMaxof {\romannumeral0\xintimaxof }% @@ -1469,6 +1505,12 @@ {\expandafter\XINT_imaxof_b\romannumeral0\xintimax {#1}}% \def\XINT_imaxof_e #1\Z #2\Z { #2}% \let\xintMaxof\xintiMaxof \let\xintmaxof\xintimaxof +\def\xintiMaxof:csv #1{\expandafter\XINT_imaxof:_b\romannumeral-`0#1,,}% +\def\XINT_imaxof:_b #1,#2,{\expandafter\XINT_imaxof:_c\romannumeral-`0#2,{#1},}% +\def\XINT_imaxof:_c #1{\if #1,\expandafter\XINT_of:_e + \else\expandafter\XINT_imaxof:_d\fi #1}% +\def\XINT_imaxof:_d #1,{\expandafter\XINT_imaxof:_b\romannumeral0\xintimax {#1}}% +\def\XINT_of:_e ,#1,{#1}% \def\xintiMin {\romannumeral0\xintimin }% \def\xintimin #1% {% @@ -1484,37 +1526,37 @@ \def\XINT_min_fork #1#2\Z #3#4\Z {% \xint_UDsignsfork - #1#3\dummy \XINT_min_minusminus % A < 0, B < 0 - #1-\dummy \XINT_min_minusplus % B < 0, A >= 0 - #3-\dummy \XINT_min_plusminus % A < 0, B >= 0 - --\dummy {\xint_UDzerosfork - #1#3\dummy \XINT_min_zerozero % A = B = 0 - #10\dummy \XINT_min_zeroplus % B = 0, A > 0 - #30\dummy \XINT_min_pluszero % A = 0, B > 0 - 00\dummy \XINT_min_plusplus % A, B > 0 + #1#3\XINT_min_minusminus % A < 0, B < 0 + #1-\XINT_min_minusplus % B < 0, A >= 0 + #3-\XINT_min_plusminus % A < 0, B >= 0 + --{\xint_UDzerosfork + #1#3\XINT_min_zerozero % A = B = 0 + #10\XINT_min_zeroplus % B = 0, A > 0 + #30\XINT_min_pluszero % A = 0, B > 0 + 00\XINT_min_plusplus % A, B > 0 \krof }% \krof {#2}{#4}#1#3% }% -\def\XINT_min_zerozero #1#2#3#4{\xint_firstoftwo_andstop }% -\def\XINT_min_zeroplus #1#2#3#4{\xint_secondoftwo_andstop }% -\def\XINT_min_pluszero #1#2#3#4{\xint_firstoftwo_andstop }% -\def\XINT_min_minusplus #1#2#3#4{\xint_secondoftwo_andstop }% -\def\XINT_min_plusminus #1#2#3#4{\xint_firstoftwo_andstop }% +\def\XINT_min_zerozero #1#2#3#4{\xint_firstoftwo_afterstop }% +\def\XINT_min_zeroplus #1#2#3#4{\xint_secondoftwo_afterstop }% +\def\XINT_min_pluszero #1#2#3#4{\xint_firstoftwo_afterstop }% +\def\XINT_min_minusplus #1#2#3#4{\xint_secondoftwo_afterstop }% +\def\XINT_min_plusminus #1#2#3#4{\xint_firstoftwo_afterstop }% \def\XINT_min_plusplus #1#2#3#4% {% \ifodd\XINT_Geq {#4#2}{#3#1} - \expandafter\xint_secondoftwo_andstop + \expandafter\xint_secondoftwo_afterstop \else - \expandafter\xint_firstoftwo_andstop + \expandafter\xint_firstoftwo_afterstop \fi }% \def\XINT_min_minusminus #1#2#3#4% {% \ifodd\XINT_Geq {#1}{#2} - \expandafter\xint_secondoftwo_andstop + \expandafter\xint_secondoftwo_afterstop \else - \expandafter\xint_firstoftwo_andstop + \expandafter\xint_firstoftwo_afterstop \fi }% \def\xintiMinof {\romannumeral0\xintiminof }% @@ -1528,6 +1570,11 @@ {\expandafter\XINT_iminof_b\romannumeral0\xintimin {#1}}% \def\XINT_iminof_e #1\Z #2\Z { #2}% \let\xintMinof\xintiMinof \let\xintminof\xintiminof +\def\xintiMinof:csv #1{\expandafter\XINT_iminof:_b\romannumeral-`0#1,,}% +\def\XINT_iminof:_b #1,#2,{\expandafter\XINT_iminof:_c\romannumeral-`0#2,{#1},}% +\def\XINT_iminof:_c #1{\if #1,\expandafter\XINT_of:_e + \else\expandafter\XINT_iminof:_d\fi #1}% +\def\XINT_iminof:_d #1,{\expandafter\XINT_iminof:_b\romannumeral0\xintimin {#1}}% \def\xintiiSum {\romannumeral0\xintiisum }% \def\xintiisum #1{\xintiisumexpr #1\relax }% \def\xintiiSumExpr {\romannumeral0\xintiisumexpr }% @@ -1544,8 +1591,8 @@ \xint_gob_til_relax #1\XINT_sum_finished\relax \xint_gob_til_zero #1\XINT_sum_skipzeroinput0% \xint_UDsignfork - #1\dummy \XINT_sum_N - -\dummy {\XINT_sum_P #1}% + #1\XINT_sum_N + -{\XINT_sum_P #1}% \krof }% \def\XINT_sum_finished #1\Z #2#3% @@ -1570,6 +1617,13 @@ \W\X\Y\Z #3\W\X\Y\Z }{#2}% }% \def\XINT_sum_NN #1#2{\XINT_sum_loop {#2}{#1}}% +\def\xintiiSum:csv #1{\expandafter\XINT_iisum:_a\romannumeral-`0#1,,^}% +\def\XINT_iisum:_a {\XINT_iisum:_b {0}}% +\def\XINT_iisum:_b #1#2,{\expandafter\XINT_iisum:_c\romannumeral-`0#2,{#1}}% +\def\XINT_iisum:_c #1{\if #1,\expandafter\XINT_:_e + \else\expandafter\XINT_iisum:_d\fi #1}% +\def\XINT_iisum:_d #1,#2{\expandafter\XINT_iisum:_b\expandafter + {\romannumeral0\xintiiadd {#2}{#1}}}% \def\xintiiMul {\romannumeral0\xintiimul }% \def\xintiimul #1% {% @@ -1593,14 +1647,13 @@ \def\XINT_mul_fork #1#2\Z #3#4\Z {% \xint_UDzerofork - #1\dummy \XINT_mul_zero - #3\dummy \XINT_mul_zero - 0\dummy - {\xint_UDsignsfork - #1#3\dummy \XINT_mul_minusminus % #1 = #3 = - - #1-\dummy {\XINT_mul_minusplus #3}% % #1 = - - #3-\dummy {\XINT_mul_plusminus #1}% % #3 = - - --\dummy {\XINT_mul_plusplus #1#3}% + #1\XINT_mul_zero + #3\XINT_mul_zero + 0{\xint_UDsignsfork + #1#3\XINT_mul_minusminus % #1 = #3 = - + #1-{\XINT_mul_minusplus #3}% % #1 = - + #3-{\XINT_mul_plusminus #1}% % #3 = - + --{\XINT_mul_plusplus #1#3}% \krof }% \krof {#2}{#4}% @@ -1614,14 +1667,14 @@ }% \def\XINT_mul_minusplus #1#2#3% {% - \expandafter\xint_minus_andstop\romannumeral0\expandafter + \expandafter\xint_minus_afterstop\romannumeral0\expandafter \XINT_mul_choice_a \expandafter{\romannumeral0\xintlength {#1#3}}% {\romannumeral0\xintlength {#2}}{#2}{#1#3}% }% \def\XINT_mul_plusminus #1#2#3% {% - \expandafter\xint_minus_andstop\romannumeral0\expandafter + \expandafter\xint_minus_afterstop\romannumeral0\expandafter \XINT_mul_choice_a \expandafter{\romannumeral0\xintlength {#3}}% {\romannumeral0\xintlength {#1#2}}{#1#2}{#3}% @@ -1789,9 +1842,9 @@ {% \XINT_mul_M_end #1#4% }% -\def\XINT_mul_M_end #1#2#3#4#5#6#7#8% +\edef\XINT_mul_M_end #1#2#3#4#5#6#7#8% {% - \expandafter\space\the\numexpr #1#2#3#4#5#6#7#8\relax + \noexpand\expandafter\space\noexpand\the\numexpr #1#2#3#4#5#6#7#8\relax }% \def\XINT_mul_enter #1\Z\Z\Z\Z #2#3#4#5% {% @@ -1989,6 +2042,13 @@ \expandafter\XINT_prod_loop_a\romannumeral0\XINT_mul_fork }% \def\XINT_prod_finished #1\Z #2\Z \Z { #2}% +\def\xintiiPrd:csv #1{\expandafter\XINT_iiprd:_a\romannumeral-`0#1,,^}% +\def\XINT_iiprd:_a {\XINT_iiprd:_b {1}}% +\def\XINT_iiprd:_b #1#2,{\expandafter\XINT_iiprd:_c\romannumeral-`0#2,{#1}}% +\def\XINT_iiprd:_c #1{\if #1,\expandafter\XINT_:_e + \else\expandafter\XINT_iiprd:_d\fi #1}% +\def\XINT_iiprd:_d #1,#2{\expandafter\XINT_iiprd:_b\expandafter + {\romannumeral0\xintiimul {#2}{#1}}}% \def\xintiFac {\romannumeral0\xintifac }% \def\xintifac #1% {% @@ -1997,7 +2057,7 @@ \let\xintFac\xintiFac \let\xintfac\xintifac \def\XINT_fac_fork #1% {% - \ifcase\XINT_Sgn {#1} + \ifcase\XINT__Sgn #1\Z \xint_afterfi{\expandafter\space\expandafter 1\xint_gobble_i }% \or \expandafter\XINT_fac_checklength @@ -2086,8 +2146,8 @@ \def\xint_pow #1#2\Z {% \xint_UDsignfork - #1\dummy \XINT_pow_Aneg - -\dummy \XINT_pow_Anonneg + #1\XINT_pow_Aneg + -\XINT_pow_Anonneg \krof #1{#2}% }% @@ -2124,7 +2184,7 @@ \def\XINT_pow_AisOne #1#2{ 1}% \def\XINT_pow_AisZero #1#2% {% - \ifcase\XINT_Sgn {#1} + \ifcase\XINT__Sgn #1\Z \xint_afterfi { 1}% \or \xint_afterfi { 0}% @@ -2134,7 +2194,7 @@ }% \def\XINT_pow_AatleastTwo #1% {% - \ifcase\XINT_Sgn {#1} + \ifcase\XINT__Sgn #1\Z \expandafter\XINT_pow_BisZero \or \expandafter\XINT_pow_checkBsize @@ -2143,7 +2203,7 @@ \fi {#1}% }% -\def\XINT_pow_BisNegative #1#2{\xintError:FractionRoundedToZero\space 0}% +\edef\XINT_pow_BisNegative #1#2{\noexpand\xintError:FractionRoundedToZero\space 0}% \def\XINT_pow_BisZero #1#2{ 1}% \def\XINT_pow_checkBsize #1#2% {% @@ -2158,8 +2218,8 @@ \xint_bye\xint_bye\xint_bye\xint_bye \xint_relax }% -\def\XINT_pow_BtooBig #1\xint_relax #2\xint_relax - {\xintError:ExponentTooBig\space 0}% +\edef\XINT_pow_BtooBig #1\xint_relax #2\xint_relax + {\noexpand\xintError:ExponentTooBig\space 0}% \def\XINT_pow_loop #1#2% {% \ifnum #1 = 1 @@ -2221,15 +2281,15 @@ }% \def\xintiiQuo {\romannumeral0\xintiiquo }% \def\xintiiRem {\romannumeral0\xintiirem }% -\def\xintiiquo {\expandafter\xint_firstoftwo_andstop +\def\xintiiquo {\expandafter\xint_firstoftwo_afterstop \romannumeral0\xintiidivision }% -\def\xintiirem {\expandafter\xint_secondoftwo_andstop +\def\xintiirem {\expandafter\xint_secondoftwo_afterstop \romannumeral0\xintiidivision }% \def\xintQuo {\romannumeral0\xintquo }% \def\xintRem {\romannumeral0\xintrem }% -\def\xintquo {\expandafter\xint_firstoftwo_andstop +\def\xintquo {\expandafter\xint_firstoftwo_afterstop \romannumeral0\xintdivision }% -\def\xintrem {\expandafter\xint_secondoftwo_andstop +\def\xintrem {\expandafter\xint_secondoftwo_afterstop \romannumeral0\xintdivision }% \def\xintiidivision #1% {% @@ -2252,18 +2312,17 @@ \def\XINT_div_fork #1#2\Z #3#4\Z {% \xint_UDzerofork - #1\dummy \XINT_div_BisZero - #3\dummy \XINT_div_AisZero - 0\dummy - {\xint_UDsignfork - #1\dummy \XINT_div_BisNegative % B < 0 - #3\dummy \XINT_div_AisNegative % A < 0, B > 0 - -\dummy \XINT_div_plusplus % B > 0, A > 0 + #1\XINT_div_BisZero + #3\XINT_div_AisZero + 0{\xint_UDsignfork + #1\XINT_div_BisNegative % B < 0 + #3\XINT_div_AisNegative % A < 0, B > 0 + -\XINT_div_plusplus % B > 0, A > 0 \krof }% \krof {#2}{#4}#1#3% #1#2=B, #3#4=A }% -\def\XINT_div_BisZero #1#2#3#4{\xintError:DivisionByZero\space {0}{0}}% +\edef\XINT_div_BisZero #1#2#3#4{\noexpand\xintError:DivisionByZero\space {0}{0}}% \def\XINT_div_AisZero #1#2#3#4{ {0}{0}}% \def\XINT_div_plusplus #1#2#3#4% {% @@ -2274,9 +2333,10 @@ \expandafter\XINT_div_BisNegative_post \romannumeral0\XINT_div_fork #1\Z #4#2\Z }% -\def\XINT_div_BisNegative_post #1% +\edef\XINT_div_BisNegative_post #1% {% - \expandafter\space\expandafter {\romannumeral0\XINT_opp #1}% + \noexpand\expandafter\space\noexpand\expandafter + {\noexpand\romannumeral0\noexpand\XINT_opp #1}% }% \def\XINT_div_AisNegative #1#2#3#4% {% @@ -2285,16 +2345,17 @@ }% \def\XINT_div_AisNegative_post #1#2% {% - \ifcase\XINT_Sgn {#2} + \if0\XINT_Sgn #2\Z \expandafter \XINT_div_AisNegative_zerorem - \or + \else \expandafter \XINT_div_AisNegative_posrem \fi {#1}{#2}% }% -\def\XINT_div_AisNegative_zerorem #1#2#3% +\edef\XINT_div_AisNegative_zerorem #1#2#3% {% - \expandafter\space\expandafter {\romannumeral0\XINT_opp #1}{0}% + \noexpand\expandafter\space\noexpand\expandafter + {\noexpand\romannumeral0\noexpand\XINT_opp #1}{0}% }% \def\XINT_div_AisNegative_posrem #1% {% @@ -2303,7 +2364,7 @@ }% \def\XINT_div_AisNegative_posrem_b #1#2#3% {% - \expandafter \xint_exchangetwo_keepbraces_andstop \expandafter + \expandafter \xint_exchangetwo_keepbraces_afterstop \expandafter {\romannumeral0\XINT_sub {#3}{#2}}{#1}% }% \def\XINT_div_prepare #1% @@ -2409,18 +2470,19 @@ }% \def\XINT_div_finished_b #1#2#3#4#5% {% - \ifcase \XINT_Sgn {#1} + \if0\XINT_Sgn #1\Z \xint_afterfi {\XINT_div_finished_c {0}}% - \or + \else \xint_afterfi {\expandafter\XINT_div_finished_c\expandafter {\romannumeral0\XINT_dsh_checksignx #5\Z {#1}}% }% \fi {#2}% }% -\def\XINT_div_finished_c #1#2% +\edef\XINT_div_finished_c #1#2% {% - \expandafter\space\expandafter {\romannumeral0\XINT_rev_andcuz {#2}}{#1}% + \noexpand\expandafter\space\noexpand\expandafter + {\noexpand\romannumeral0\noexpand\XINT_rev_andcuz {#2}}{#1}% }% \def\XINT_div_final_a #1% {% @@ -2470,33 +2532,35 @@ {\romannumeral0\XINT_mul_M {#1}#5\Z\Z\Z\Z }}% {#1}{#2}{#3}{#4}{#5}% }% -\def\XINT_div_final_dc #1#2% +\def\XINT_div_final_dc #1#2% 1.09i re-styles the conditional here {% - \ifnum\XINT_Sgn{#1}<\xint_c_ - \xint_afterfi - {\expandafter\XINT_div_final_dP\the\numexpr #2-\xint_c_i\relax}% - \else \xint_afterfi {\XINT_div_final_e {#1}#2}% + \ifnum\XINT__Sgn #1\Z<\xint_c_ + \expandafter\xint_firstoftwo + \else\expandafter\xint_secondoftwo \fi + {\expandafter\XINT_div_final_dP\the\numexpr #2-\xint_c_i\relax}% + {\XINT_div_final_e {#1}#2}% }% \def\XINT_div_final_e #1#2#3#4#5#6% A final, q, trash, Q, L, B {% \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 \`a d\'evelopper,c +\def\XINT_div_final_f #1#2#3% R,Q \`a d\'evelopper,c. re-styled in 1.09i {% - \ifcase \XINT_Sgn {#1} - \xint_afterfi {\XINT_div_final_end {0}}% - \or - \xint_afterfi {\expandafter\XINT_div_final_end\expandafter + \if0\XINT_Sgn #1\Z + \expandafter\xint_firstoftwo + \else\expandafter\xint_secondoftwo + \fi + {\XINT_div_final_end {0}}% + {\expandafter\XINT_div_final_end\expandafter {\romannumeral0\XINT_dsh_checksignx #3\Z {#1}}% }% - \fi {#2}% }% -\def\XINT_div_final_end #1#2% +\edef\XINT_div_final_end #1#2% {% - \expandafter\space\expandafter {#2}{#1}% + \noexpand\expandafter\space\noexpand\expandafter {#2}{#1}% }% \def\XINT_div_body_a #1% {% @@ -2533,8 +2597,8 @@ \def\XINT_div_body_gg #1#2#3#4#5#6% {% \xint_UDzerofork - #2\dummy \XINT_div_body_gk - 0\dummy {\XINT_div_body_ggk #2}% + #2\XINT_div_body_gk + 0{\XINT_div_body_ggk #2}% \krof {#3#4#5#6}% }% @@ -2672,8 +2736,8 @@ \def\xint_div_sub_bz\W\XINT_div_sub_onestep #1#2#3#4#5#6#7% {% \xint_UDzerofork - #1\dummy \XINT_div_sub_C % - 0\dummy \XINT_div_sub_D % pas de retenue + #1\XINT_div_sub_C % + 0\XINT_div_sub_D % pas de retenue \krof {#7}#2#3#4#5% }% @@ -2732,9 +2796,9 @@ \def\XINT_fdg #1#2#3\Z {% \xint_UDzerominusfork - #1-\dummy { 0}% zero - 0#1\dummy { #2}% negative - 0-\dummy { #1}% positive + #1-{ 0}% zero + 0#1{ #2}% negative + 0-{ #1}% positive \krof }% \def\xintiiLDg {\romannumeral0\xintiildg }% @@ -2846,15 +2910,15 @@ \def\XINT_dshr_checkxpositive #1% {% \xint_UDzerominusfork - 0#1\dummy \XINT_dshr_xzeroorneg - #1-\dummy \XINT_dshr_xzeroorneg - 0-\dummy \XINT_dshr_xpositive + 0#1\XINT_dshr_xzeroorneg + #1-\XINT_dshr_xzeroorneg + 0-\XINT_dshr_xpositive \krof #1% }% \def\XINT_dshr_xzeroorneg #1\Z #2{ 0}% \def\XINT_dshr_xpositive #1\Z {% - \expandafter\xint_secondoftwo_andstop\romannumeral0\xintdsx {#1}% + \expandafter\xint_secondoftwo_afterstop\romannumeral0\xintdsx {#1}% }% \def\xintDSH {\romannumeral0\xintdsh }% \def\xintdsh #1#2% @@ -2868,15 +2932,15 @@ \def\XINT_dsh_checksignx #1% {% \xint_UDzerominusfork - #1-\dummy \XINT_dsh_xiszero - 0#1\dummy \XINT_dsx_xisNeg_checkA % on passe direct dans DSx - 0-\dummy {\XINT_dsh_xisPos #1}% + #1-\XINT_dsh_xiszero + 0#1\XINT_dsx_xisNeg_checkA % on passe direct dans DSx + 0-{\XINT_dsh_xisPos #1}% \krof }% \def\XINT_dsh_xiszero #1\Z #2{ #2}% \def\XINT_dsh_xisPos #1\Z #2% {% - \expandafter\xint_firstoftwo_andstop + \expandafter\xint_firstoftwo_afterstop \romannumeral0\XINT_dsx_checksignA #2\Z {#1}% via DSx }% \def\xintDSx {\romannumeral0\xintdsx }% @@ -2893,9 +2957,9 @@ \def\XINT_dsx_checksignx #1% {% \xint_UDzerominusfork - #1-\dummy \XINT_dsx_xisZero - 0#1\dummy \XINT_dsx_xisNeg_checkA - 0-\dummy {\XINT_dsx_xisPos #1}% + #1-\XINT_dsx_xisZero + 0#1\XINT_dsx_xisNeg_checkA + 0-{\XINT_dsx_xisPos #1}% \krof }% \def\XINT_dsx_xisZero #1\Z #2{ {#2}{0}}% attention comme x > 0 @@ -2942,9 +3006,9 @@ \def\XINT_dsx_checksignA #1% {% \xint_UDzerominusfork - #1-\dummy \XINT_dsx_AisZero - 0#1\dummy \XINT_dsx_AisNeg - 0-\dummy {\XINT_dsx_AisPos #1}% + #1-\XINT_dsx_AisZero + 0#1\XINT_dsx_AisNeg + 0-{\XINT_dsx_AisPos #1}% \krof }% \def\XINT_dsx_AisZero #1\Z #2{ {0}{0}}% @@ -2984,20 +3048,20 @@ \expandafter {\romannumeral0\XINT_num {#2}}% {\romannumeral0\XINT_num {#1}}% }% -\def\XINT_dsx_end #1#2% +\edef\XINT_dsx_end #1#2% {% - \expandafter\space\expandafter{#2}{#1}% + \noexpand\expandafter\space\noexpand\expandafter{#2}{#1}% }% \def\xintDecSplitL {\romannumeral0\xintdecsplitl }% \def\xintDecSplitR {\romannumeral0\xintdecsplitr }% \def\xintdecsplitl {% - \expandafter\xint_firstoftwo_andstop + \expandafter\xint_firstoftwo_afterstop \romannumeral0\xintdecsplit }% \def\xintdecsplitr {% - \expandafter\xint_secondoftwo_andstop + \expandafter\xint_secondoftwo_afterstop \romannumeral0\xintdecsplit }% \def\xintDecSplit {\romannumeral0\xintdecsplit }% @@ -3021,7 +3085,7 @@ }% \def\XINT_split_bigx #1\Z #2% {% - \ifcase\XINT_Sgn {#1} + \ifcase\XINT__Sgn #1\Z \or \xint_afterfi { {}{#2}}% positive big x \else \xint_afterfi { {#2}{}}% negative big x @@ -3030,9 +3094,9 @@ \def\XINT_split_xfork #1% {% \xint_UDzerominusfork - #1-\dummy \XINT_split_zerosplit - 0#1\dummy \XINT_split_fromleft - 0-\dummy {\XINT_split_fromright #1}% + #1-\XINT_split_zerosplit + 0#1\XINT_split_fromleft + 0-{\XINT_split_fromright #1}% \krof }% \def\XINT_split_zerosplit #1\Z #2{ {#2}{}}% @@ -3118,9 +3182,10 @@ {% \csname XINT_split_fromright_endsplit_\romannumeral #1\endcsname }% -\def\XINT_split_fromright_endsplit_ #1#2\W #3\Z #4% +\edef\XINT_split_fromright_endsplit_ #1#2\W #3\Z #4% {% - \expandafter\space\expandafter {\romannumeral0\xintreverseorder {#2}}{#1}% + \noexpand\expandafter\space\noexpand\expandafter + {\noexpand\romannumeral0\noexpand\xintreverseorder {#2}}{#1}% }% \def\XINT_split_fromright_endsplit_i #1#2% {\XINT_split_fromright_checkiftoofar #2{#2#1}}% @@ -3152,14 +3217,14 @@ \def\XINT_dbl #1% {% \xint_UDzerominusfork - #1-\dummy \XINT_dbl_zero - 0#1\dummy \XINT_dbl_neg - 0-\dummy {\XINT_dbl_pos #1}% + #1-\XINT_dbl_zero + 0#1\XINT_dbl_neg + 0-{\XINT_dbl_pos #1}% \krof }% \def\XINT_dbl_zero #1\Z \W\W\W\W\W\W\W { 0}% \def\XINT_dbl_neg - {\expandafter\xint_minus_andstop\romannumeral0\XINT_dbl_pos }% + {\expandafter\xint_minus_afterstop\romannumeral0\XINT_dbl_pos }% \def\XINT_dbl_pos {% \expandafter\XINT_dbl_a \expandafter{\expandafter}\expandafter 0% @@ -3179,9 +3244,9 @@ {% \expandafter\XINT_dbl_end_b #2#4% }% -\def\XINT_dbl_end_b #1#2#3#4#5#6#7#8% +\edef\XINT_dbl_end_b #1#2#3#4#5#6#7#8% {% - \expandafter\space\the\numexpr #1#2#3#4#5#6#7#8\relax + \noexpand\expandafter\space\noexpand\the\numexpr #1#2#3#4#5#6#7#8\relax }% \def\xintHalf {\romannumeral0\xinthalf }% \def\xinthalf #1% @@ -3192,9 +3257,9 @@ \def\XINT_half #1% {% \xint_UDzerominusfork - #1-\dummy \XINT_half_zero - 0#1\dummy \XINT_half_neg - 0-\dummy {\XINT_half_pos #1}% + #1-\XINT_half_zero + 0#1\XINT_half_neg + 0-{\XINT_half_pos #1}% \krof }% \def\XINT_half_zero #1\Z \W\W\W\W\W\W\W { 0}% @@ -3206,11 +3271,11 @@ \expandafter\XINT_half_b \the\numexpr \xint_c_x^viii+\xint_c_v*#7#6#5#4#3#2#1\relax #8% }% -\def\XINT_half_dont\W\expandafter\XINT_half_b +\edef\XINT_half_dont\W\expandafter\XINT_half_b \the\numexpr \xint_c_x^viii+\xint_c_v*#1#2#3#4#5#6#7\relax \W\W\W\W\W\W\W {% - \expandafter\space - \the\numexpr (#1#2#3#4#5#6#7+\xint_c_i)/\xint_c_ii-\xint_c_i \relax + \noexpand\expandafter\space + \noexpand\the\numexpr (#1#2#3#4#5#6#7+\xint_c_i)/\xint_c_ii-\xint_c_i \relax }% \def\XINT_half_b 1#1#2#3#4#5#6#7#8% {% @@ -3230,9 +3295,9 @@ {% \xint_gob_til_zero #1\XINT_half_end_b 0\space #1#3% }% -\def\XINT_half_end_b 0\space 0#1#2#3#4#5#6#7% +\edef\XINT_half_end_b 0\space 0#1#2#3#4#5#6#7% {% - \expandafter\space\the\numexpr #1#2#3#4#5#6#7\relax + \noexpand\expandafter\space\noexpand\the\numexpr #1#2#3#4#5#6#7\relax }% \def\xintDec {\romannumeral0\xintdec }% \def\xintdec #1% @@ -3243,14 +3308,14 @@ \def\XINT_dec #1% {% \xint_UDzerominusfork - #1-\dummy \XINT_dec_zero - 0#1\dummy \XINT_dec_neg - 0-\dummy {\XINT_dec_pos #1}% + #1-\XINT_dec_zero + 0#1\XINT_dec_neg + 0-{\XINT_dec_pos #1}% \krof }% \def\XINT_dec_zero #1\W\W\W\W\W\W\W\W { -1}% \def\XINT_dec_neg - {\expandafter\xint_minus_andstop\romannumeral0\XINT_inc_pos }% + {\expandafter\xint_minus_afterstop\romannumeral0\XINT_inc_pos }% \def\XINT_dec_pos {% \expandafter\XINT_dec_a \expandafter{\expandafter}% @@ -3278,8 +3343,8 @@ \xint_relax #1% }% -\def\XINT_dec_cleanup #1#2#3#4#5#6#7#8% -{\expandafter\space\the\numexpr #1#2#3#4#5#6#7#8\relax }% +\edef\XINT_dec_cleanup #1#2#3#4#5#6#7#8% + {\noexpand\expandafter\space\noexpand\the\numexpr #1#2#3#4#5#6#7#8\relax }% \def\xintInc {\romannumeral0\xintinc }% \def\xintinc #1% {% @@ -3289,9 +3354,9 @@ \def\XINT_inc #1% {% \xint_UDzerominusfork - #1-\dummy \XINT_inc_zero - 0#1\dummy \XINT_inc_neg - 0-\dummy {\XINT_inc_pos #1}% + #1-\XINT_inc_zero + 0#1\XINT_inc_neg + 0-{\XINT_inc_pos #1}% \krof }% \def\XINT_inc_zero #1\W\W\W\W\W\W\W\W { 1}% @@ -3327,13 +3392,13 @@ \def\XINT_sqrt_checkin #1% {% \xint_UDzerominusfork - #1-\dummy \XINT_sqrt_iszero - 0#1\dummy \XINT_sqrt_isneg - 0-\dummy {\XINT_sqrt #1}% + #1-\XINT_sqrt_iszero + 0#1\XINT_sqrt_isneg + 0-{\XINT_sqrt #1}% \krof }% \def\XINT_sqrt_iszero #1\Z { 1.}% 1.09e was wrong from inception in 1.08 :-(( -\def\XINT_sqrt_isneg #1\Z {\xintError:RootOfNegative\space 1.}% +\edef\XINT_sqrt_isneg #1\Z {\noexpand\xintError:RootOfNegative\space 1.}% \def\XINT_sqrt #1\Z {% \expandafter\XINT_sqrt_start\expandafter @@ -3496,9 +3561,9 @@ }% \def\XINT_sqrt_big_j #1% {% - \ifcase\XINT_Sgn {#1} - \expandafter \XINT_sqrt_big_end - \or \expandafter \XINT_sqrt_big_k + \if0\XINT_Sgn #1\Z + \expandafter \XINT_sqrt_big_end + \else \expandafter \XINT_sqrt_big_k \fi {#1}% }% \def\XINT_sqrt_big_k #1#2#3% @@ -3513,7 +3578,6 @@ {#2}{#1}% }% \def\XINT_sqrt_big_end #1#2#3#4{ {#3}{#2}}% -\let\XINT_tmpa\relax \let\XINT_tmpb\relax \let\XINT_tmpc\relax \XINT_restorecatcodes_endinput% \endinput %% diff --git a/Master/texmf-dist/tex/generic/xint/xintbinhex.sty b/Master/texmf-dist/tex/generic/xint/xintbinhex.sty index ce347a79ba9..d1b8229163d 100644 --- a/Master/texmf-dist/tex/generic/xint/xintbinhex.sty +++ b/Master/texmf-dist/tex/generic/xint/xintbinhex.sty @@ -21,7 +21,7 @@ %% same distribution. (The sources need not necessarily be %% in the same archive or directory.) %%---------------------------------------------------------------- -%% The xint bundle (version 1.09h of November 28, 2013) +%% The xint bundle (version 1.09i of December 18, 2013) %% xintbinhex: Expandable binary and hexadecimal conversions %% Copyright (C) 2013 by Jean-Francois Burnol %%---------------------------------------------------------------- @@ -103,7 +103,7 @@ \XINTsetupcatcodes% \XINT_providespackage \ProvidesPackage{xintbinhex}% - [2013/11/28 v1.09h Expandable binary and hexadecimal conversions (jfB)]% + [2013/12/18 v1.09i Expandable binary and hexadecimal conversions (jfB)]% \chardef\xint_c_xvi 16 \chardef\xint_c_ii^v 32 \chardef\xint_c_ii^vi 64 @@ -213,11 +213,11 @@ \def\XINT_dth_checkin #1% {% \xint_UDsignfork - #1\dummy \XINT_dth_N - -\dummy {\XINT_dth_P #1}% + #1\XINT_dth_N + -{\XINT_dth_P #1}% \krof }% -\def\XINT_dth_N {\expandafter\xint_minus_andstop\romannumeral0\XINT_dth_P }% +\def\XINT_dth_N {\expandafter\xint_minus_afterstop\romannumeral0\XINT_dth_P }% \def\XINT_dth_P {\expandafter\XINT_dth_III\romannumeral-`0\XINT_dtbh_I {0.}}% \def\xintDecToBin {\romannumeral0\xintdectobin }% \def\xintdectobin #1% @@ -225,11 +225,11 @@ \def\XINT_dtb_checkin #1% {% \xint_UDsignfork - #1\dummy \XINT_dtb_N - -\dummy {\XINT_dtb_P #1}% + #1\XINT_dtb_N + -{\XINT_dtb_P #1}% \krof }% -\def\XINT_dtb_N {\expandafter\xint_minus_andstop\romannumeral0\XINT_dtb_P }% +\def\XINT_dtb_N {\expandafter\xint_minus_afterstop\romannumeral0\XINT_dtb_P }% \def\XINT_dtb_P {\expandafter\XINT_dtb_III\romannumeral-`0\XINT_dtbh_I {0.}}% \def\XINT_dtbh_I #1#2#3#4#5% {% @@ -351,9 +351,9 @@ {% \expandafter\XINT_dtb_end_d\the\numexpr #1#2#3#4#5#6#7#8\relax }% -\def\XINT_dtb_end_d #1#2#3#4#5#6#7#8#9% +\edef\XINT_dtb_end_d #1#2#3#4#5#6#7#8#9% {% - \expandafter\space\the\numexpr #1#2#3#4#5#6#7#8#9\relax + \noexpand\expandafter\space\noexpand\the\numexpr #1#2#3#4#5#6#7#8#9\relax }% \def\xintHexToDec {\romannumeral0\xinthextodec }% \def\xinthextodec #1% @@ -361,11 +361,11 @@ \def\XINT_htd_checkin #1% {% \xint_UDsignfork - #1\dummy \XINT_htd_neg - -\dummy {\XINT_htd_I {0000}#1}% + #1\XINT_htd_neg + -{\XINT_htd_I {0000}#1}% \krof }% -\def\XINT_htd_neg {\expandafter\xint_minus_andstop +\def\XINT_htd_neg {\expandafter\xint_minus_afterstop \romannumeral0\XINT_htd_I {0000}}% \def\XINT_htd_I #1#2#3#4#5% {% @@ -435,9 +435,9 @@ {% \XINT_htd_II_end_b #1#3% }% -\def\XINT_htd_II_end_b #1#2#3#4#5#6#7#8% +\edef\XINT_htd_II_end_b #1#2#3#4#5#6#7#8% {% - \expandafter\space\the\numexpr #1#2#3#4#5#6#7#8\relax + \noexpand\expandafter\space\noexpand\the\numexpr #1#2#3#4#5#6#7#8\relax }% \def\xintBinToDec {\romannumeral0\xintbintodec }% \def\xintbintodec #1{\expandafter\XINT_btd_checkin @@ -445,11 +445,11 @@ \def\XINT_btd_checkin #1% {% \xint_UDsignfork - #1\dummy \XINT_btd_neg - -\dummy {\XINT_btd_I {000000}#1}% + #1\XINT_btd_neg + -{\XINT_btd_I {000000}#1}% \krof }% -\def\XINT_btd_neg {\expandafter\xint_minus_andstop +\def\XINT_btd_neg {\expandafter\xint_minus_afterstop \romannumeral0\XINT_btd_I {000000}}% \def\XINT_btd_I #1#2#3#4#5#6#7#8#9% {% @@ -480,9 +480,9 @@ \xint_bye\xint_bye\xint_bye\xint_bye \xint_relax }% -\def\XINT_btd_II_c_end #1#2#3#4#5#6% +\edef\XINT_btd_II_c_end #1#2#3#4#5#6% {% - \expandafter\space\the\numexpr #1#2#3#4#5#6\relax + \noexpand\expandafter\space\noexpand\the\numexpr #1#2#3#4#5#6\relax }% \def\XINT_btd_II_ci #1\XINT_btd_II_cvii #2\W\W\W\W\W\W\W {\XINT_btd_II_d {}{#2}{\xint_c_ii }}% @@ -520,9 +520,9 @@ {% \XINT_btd_II_end_b #1#3% }% -\def\XINT_btd_II_end_b #1#2#3#4#5#6#7#8#9% +\edef\XINT_btd_II_end_b #1#2#3#4#5#6#7#8#9% {% - \expandafter\space\the\numexpr #1#2#3#4#5#6#7#8#9\relax + \noexpand\expandafter\space\noexpand\the\numexpr #1#2#3#4#5#6#7#8#9\relax }% \def\XINT_btd_I_a #1#2#3#4#5#6#7#8% {% @@ -557,11 +557,11 @@ \def\XINT_bth_checkin #1% {% \xint_UDsignfork - #1\dummy \XINT_bth_N - -\dummy {\XINT_bth_P #1}% + #1\XINT_bth_N + -{\XINT_bth_P #1}% \krof }% -\def\XINT_bth_N {\expandafter\xint_minus_andstop\romannumeral0\XINT_bth_P }% +\def\XINT_bth_N {\expandafter\xint_minus_afterstop\romannumeral0\XINT_bth_P }% \def\XINT_bth_P {\expandafter\XINT_bth_I\expandafter{\expandafter}% \romannumeral0\XINT_OQ {}}% \def\XINT_bth_I #1#2#3#4#5#6#7#8#9% @@ -591,11 +591,11 @@ \def\XINT_htb_checkin #1% {% \xint_UDsignfork - #1\dummy \XINT_htb_N - -\dummy {\XINT_htb_P #1}% + #1\XINT_htb_N + -{\XINT_htb_P #1}% \krof }% -\def\XINT_htb_N {\expandafter\xint_minus_andstop\romannumeral0\XINT_htb_P }% +\def\XINT_htb_N {\expandafter\xint_minus_afterstop\romannumeral0\XINT_htb_P }% \def\XINT_htb_P {\XINT_htb_I_a {}}% \def\XINT_htb_I_a #1#2#3#4#5#6#7#8#9% {% @@ -632,11 +632,11 @@ \def\XINT_chtb_checkin #1% {% \xint_UDsignfork - #1\dummy \XINT_chtb_N - -\dummy {\XINT_chtb_P #1}% + #1\XINT_chtb_N + -{\XINT_chtb_P #1}% \krof }% -\def\XINT_chtb_N {\expandafter\xint_minus_andstop\romannumeral0\XINT_chtb_P }% +\def\XINT_chtb_N {\expandafter\xint_minus_afterstop\romannumeral0\XINT_chtb_P }% \def\XINT_chtb_P {\expandafter\XINT_chtb_I\expandafter{\expandafter}% \romannumeral0\XINT_OQ {}}% \def\XINT_chtb_I #1#2#3#4#5#6#7#8#9% diff --git a/Master/texmf-dist/tex/generic/xint/xintcfrac.sty b/Master/texmf-dist/tex/generic/xint/xintcfrac.sty index 345cfc7a203..776210f4ea8 100644 --- a/Master/texmf-dist/tex/generic/xint/xintcfrac.sty +++ b/Master/texmf-dist/tex/generic/xint/xintcfrac.sty @@ -21,7 +21,7 @@ %% same distribution. (The sources need not necessarily be %% in the same archive or directory.) %%---------------------------------------------------------------- -%% The xint bundle (version 1.09h of November 28, 2013) +%% The xint bundle (version 1.09i of December 18, 2013) %% xintcfrac: Expandable continued fractions with xint package %% Copyright (C) 2013 by Jean-Francois Burnol %%---------------------------------------------------------------- @@ -103,7 +103,7 @@ \XINTsetupcatcodes% \XINT_providespackage \ProvidesPackage{xintcfrac}% - [2013/11/28 v1.09h Expandable continued fractions with xint package (jfB)]% + [2013/12/18 v1.09i Expandable continued fractions with xint package (jfB)]% \def\xintCFrac {\romannumeral0\xintcfrac }% \def\xintcfrac #1% {% @@ -343,9 +343,9 @@ \def\XINT_ftcc_D #1% {% \xint_UDzerominusfork - #1-\dummy \XINT_ftcc_integer - 0#1\dummy \XINT_ftcc_En - 0-\dummy {\XINT_ftcc_Ep #1}% + #1-\XINT_ftcc_integer + 0#1\XINT_ftcc_En + 0-{\XINT_ftcc_Ep #1}% \krof }% \def\XINT_ftcc_Ep #1\Z #2% @@ -377,9 +377,9 @@ \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}% + #1-\XINT_ftcc_end + 0#1\XINT_ftcc_loop_N + 0-{\XINT_ftcc_loop_P #1}% \krof }% \def\XINT_ftcc_end #1\Z #2#3{ #3#2}% @@ -767,7 +767,7 @@ \expandafter\XINT_igctcv_loop_l\expandafter {\romannumeral0\xintrawwithzeros {#1/#2}}% }% -\def\XINT_igctcv_loop_l #1#2#3{\XINT_igctcv_loop_a {#3{#1[0]}}#2}% +\def\XINT_igctcv_loop_l #1#2#3{\XINT_igctcv_loop_a {#3{#1}}#2}%1.09i removes [0] \def\XINT_igctcv_end_a #1.#2#3#4#5% {% \expandafter\XINT_igctcv_end_b\expandafter @@ -848,7 +848,7 @@ \def\XINT_cntcs #1#2% {% \ifnum #1<0 - \xint_afterfi { 0/1[0]}% + \xint_afterfi { }% 1.09i: a 0/1[0] was strangely here, removed \else \xint_afterfi {\expandafter\XINT_cntcs_loop\expandafter {\the\numexpr #1-1\expandafter}\expandafter @@ -877,7 +877,7 @@ \def\XINT_cntgc #1#2% {% \ifnum #1<0 - \xint_afterfi { 0/1[0]}% + \xint_afterfi { }% 1.09i there was as strange 0/1[0] here, removed \else \xint_afterfi {\expandafter\XINT_cntgc_loop\expandafter {\the\numexpr #1-1\expandafter}\expandafter @@ -906,7 +906,7 @@ \def\XINT_gcntgc #1#2#3% {% \ifnum #1<0 - \xint_afterfi { {0/1[0]}}% + \xint_afterfi { }% 1.09i now returns nothing \else \xint_afterfi {\expandafter\XINT_gcntgc_loop\expandafter {\the\numexpr #1-1\expandafter}\expandafter diff --git a/Master/texmf-dist/tex/generic/xint/xintexpr.sty b/Master/texmf-dist/tex/generic/xint/xintexpr.sty index 409b7c83fe5..0565e1d0212 100644 --- a/Master/texmf-dist/tex/generic/xint/xintexpr.sty +++ b/Master/texmf-dist/tex/generic/xint/xintexpr.sty @@ -21,7 +21,7 @@ %% same distribution. (The sources need not necessarily be %% in the same archive or directory.) %%---------------------------------------------------------------- -%% The xint bundle (version 1.09h of November 28, 2013) +%% The xint bundle (version 1.09i of December 18, 2013) %% xintexpr: Expandable expression parser %% Copyright (C) 2013 by Jean-Francois Burnol %%---------------------------------------------------------------- @@ -103,109 +103,123 @@ \XINTsetupcatcodes% \XINT_providespackage \ProvidesPackage{xintexpr}% - [2013/11/28 v1.09h Expandable expression parser (jfB)]% -\def\xint_gob_til_dot #1.{}% -\def\xint_gob_til_dot_andstop #1.{ }% -\def\xint_gob_til_! #1!{}% nota bene: ! is of catcode 11 + [2013/12/18 v1.09i Expandable expression parser (jfB)]% +\def\xint_gob_til_! #1!{}% nota bene: ! is of catcode 11 +\edef\XINT_expr_lock #1!% + {\noexpand\expandafter\space\noexpand\csname .=#1\noexpand\endcsname }% +\def\XINT_expr_unlock {\expandafter\XINT_expr_unlock_a\string }% +\def\XINT_expr_unlock_a #1.={}% \def\XINT_expr_unexpectedtoken {\xintError:ignored }% -\def\XINT_newexpr_stripprefix #1>{\noexpand\romannumeral-`0}% -\def\XINT_expr_lock #1!{\expandafter\space\csname .#1\endcsname }% -\def\XINT_expr_unlock {\expandafter\xint_gob_til_dot\string }% -\def\XINT_expr_usethe {use_xintthe!\xintError:use_xintthe! }% +\def\XINT_newexpr_setprefix #1>{\noexpand\romannumeral-`0}% +\def\xint_UDxintrelaxfork #1\xint_relax #2#3\krof {#2}% \def\XINT_expr_done {!\XINT_expr_usethe\XINT_expr_print }% -\def\XINT_expr_print #1{\XINT_expr_unlock #1}% -\def\XINT_flexpr_done {!\XINT_expr_usethe\XINT_flexpr_print }% -\def\XINT_flexpr_print #1{\xintFloat:csv{\XINT_expr_unlock #1}}% -\def\XINT_numexpr_print #1{\xintRound:csv{\XINT_expr_unlock #1}}% +\let\XINT_iiexpr_done \XINT_expr_done +\def\XINT_iexpr_done {!\XINT_expr_usethe\XINT_iexpr_print }% +\def\XINT_flexpr_done {!\XINT_expr_usethe\XINT_flexpr_print }% +\def\XINT_boolexpr_done{!\XINT_expr_usethe\XINT_boolexpr_print }% +\def\XINT_expr_usethe {use_xintthe!\xintError:use_xintthe! }% +\def\xintthe #1{\romannumeral-`0\expandafter\xint_gobble_ii\romannumeral-`0#1}% +\let\XINT_expr_print \XINT_expr_unlock +\def\XINT_iexpr_print #1{\xintRound:csv {\XINT_expr_unlock #1}}% +\def\XINT_flexpr_print #1{\xintFloat:csv {\XINT_expr_unlock #1}}% \def\XINT_boolexpr_print #1{\xintIsTrue:csv{\XINT_expr_unlock #1}}% -\def\xintifboolexpr #1{\romannumeral0\xintifnotzero {\xinttheexpr #1\relax}}% -\def\xintifboolfloatexpr #1{\romannumeral0\xintifnotzero - {\xintthefloatexpr #1\relax}}% -\def\xintexpr {\romannumeral0\xinteval }% +\def\xintexpr {\romannumeral0\xinteval }% +\def\xintfloatexpr {\romannumeral0\xintfloateval }% +\def\xintiiexpr {\romannumeral0\xintiieval }% \def\xinteval -{% - \expandafter\XINT_expr_until_end_a \romannumeral-`0\XINT_expr_getnext -}% -\def\xinttheeval {\expandafter\xint_gobble_ii\romannumeral0\xinteval }% -\def\xinttheexpr {\romannumeral-`0\xinttheeval }% -\def\XINT_numexpr_post !\XINT_expr_usethe\XINT_expr_print% - { !\XINT_expr_usethe\XINT_numexpr_print }% -\def\xintnumexpr {\romannumeral0\expandafter\XINT_numexpr_post - \romannumeral0\xinteval }% -\def\xintthenumexpr {\romannumeral-`0\xintthe\xintnumexpr }% -\def\XINT_boolexpr_post !\XINT_expr_usethe\XINT_expr_print% - { !\XINT_expr_usethe\XINT_boolexpr_print }% -\def\xintboolexpr {\romannumeral0\expandafter\XINT_boolexpr_post - \romannumeral0\xinteval }% -\def\xinttheboolexpr {\romannumeral-`0\xintthe\xintboolexpr }% -\def\xintfloatexpr {\romannumeral0\xintfloateval }% + {\expandafter\XINT_expr_until_end_a \romannumeral-`0\XINT_expr_getnext }% \def\xintfloateval -{% - \expandafter\XINT_flexpr_until_end_a \romannumeral-`0\XINT_expr_getnext -}% -\def\xintthefloatexpr {\romannumeral-`0\xintthe\xintfloatexpr }% -\def\xintthe #1{\romannumeral-`0\expandafter\xint_gobble_ii\romannumeral-`0#1}% + {\expandafter\XINT_flexpr_until_end_a\romannumeral-`0\XINT_expr_getnext }% +\def\xintiieval + {\expandafter\XINT_iiexpr_until_end_a\romannumeral-`0\XINT_expr_getnext }% +\def\xinttheexpr + {\romannumeral-`0\expandafter\xint_gobble_ii\romannumeral0\xinteval }% +\def\xintthefloatexpr + {\romannumeral-`0\expandafter\xint_gobble_ii\romannumeral0\xintfloateval }% +\def\xinttheiiexpr + {\romannumeral-`0\expandafter\xint_gobble_ii\romannumeral0\xintiieval }% +\def\xintiexpr {\romannumeral0\expandafter\expandafter\expandafter + \XINT_iexpr_done \expandafter\xint_gobble_iii\romannumeral0\xinteval }% +\def\xinttheiexpr {\romannumeral-`0\expandafter\expandafter\expandafter + \XINT_iexpr_print\expandafter\xint_gobble_iii\romannumeral0\xinteval }% +\def\xintboolexpr {\romannumeral0\expandafter\expandafter\expandafter + \XINT_boolexpr_done \expandafter\xint_gobble_iii\romannumeral0\xinteval }% +\def\xinttheboolexpr {\romannumeral-`0\expandafter\expandafter\expandafter + \XINT_boolexpr_print\expandafter\xint_gobble_iii\romannumeral0\xinteval }% +\let\xintnumexpr \xintiexpr % deprecated +\let\xintthenumexpr\xinttheiexpr % deprecated +\def\xintifboolexpr #1% + {\romannumeral0\xintifnotzero {\xinttheexpr #1\relax}}% +\def\xintifboolfloatexpr #1% + {\romannumeral0\xintifnotzero {\xintthefloatexpr #1\relax}}% +\def\xintifbooliiexpr #1% + {\romannumeral0\xintifnotzero {\xinttheiiexpr #1\relax}}% \def\XINT_expr_getnext {% \expandafter\XINT_expr_getnext_checkforbraced_a \romannumeral-`0\romannumeral-`0% }% -\def\XINT_expr_getnext_checkforbraced_a #1% +\def\XINT_expr_getnext_checkforbraced_a #1% was done later in <1.09i {% - \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 + \expandafter\XINT_expr_getnext_checkforbraced_b\expandafter {\romannumeral-`0#1}% }% -\def\XINT_expr_getnext_checkforbraced_c #1% +\def\XINT_expr_getnext_checkforbraced_b #1% {% - \XINT_expr_getnext_checkforbraced_d #1\W\Z {#1}% + \XINT_expr_getnext_checkforbraced_c #1\xint_relax\Z {#1}% }% -\def\XINT_expr_getnext_checkforbraced_d #1#2% +\def\XINT_expr_getnext_checkforbraced_c #1#2% {% - \xint_UDwfork - #1\dummy \XINT_expr_getnext_emptybracepair - #2\dummy \XINT_expr_getnext_onetoken_wehope - \W\dummy \XINT_expr_getnext_gotbracedstuff + \xint_UDxintrelaxfork + #1\XINT_expr_getnext_wasemptyorspace + #2\XINT_expr_getnext_gotonetoken_wehope + \xint_relax\XINT_expr_getnext_gotbracedstuff \krof }% doubly braced things are not acceptable, will cause errors. -\def\XINT_expr_getnext_emptybracepair #1{\XINT_expr_getnext }% -\def\XINT_expr_getnext_gotbracedstuff #1\W\Z #2% {..} -> number/fraction +\def\XINT_expr_getnext_wasemptyorspace #1{\XINT_expr_getnext }% +\def\XINT_expr_getnext_gotbracedstuff #1\xint_relax\Z #2% {% - \expandafter\XINT_expr_getop\csname .#2\endcsname + \expandafter\XINT_expr_getop\csname .=#2\endcsname }% -\def\XINT_expr_getnext_onetoken_wehope\Z #1% #1 isn't a control sequence! -{% +\def\XINT_expr_getnext_gotonetoken_wehope\Z #1% +{% screens out sub-expressions and \count or \dimen registers/variables \xint_gob_til_! #1\XINT_expr_subexpr !% - \expandafter\XINT_expr_getnext_onetoken_fork\string #1% -}% after this #1 should be now a catcode 12 token. -\def\XINT_expr_subexpr !#1!{\expandafter\XINT_expr_getop\xint_gobble_ii }% + \ifcat\relax#1% \count or \numexpr etc... token or count, dimen, skip cs + \expandafter\XINT_expr_countdimenetc_fork + \else + \expandafter\expandafter\expandafter + \XINT_expr_getnext_onetoken_fork\expandafter\string + \fi + #1% +}% +\def\XINT_expr_subexpr !#1\fi {\expandafter\XINT_expr_getop\xint_gobble_iii }% +\def\XINT_expr_countdimenetc_fork #1% +{% + \ifx\count#1\else\ifx#1\dimen\else\ifx#1\numexpr\else\ifx#1\dimexpr\else + \ifx\skip#1\else\ifx\glueexpr#1\else + \XINT_expr_unpackvariable + \fi\fi\fi\fi\fi\fi + \expandafter\XINT_expr_getnext\number #1% +}% +\def\XINT_expr_unpackvariable\fi\fi\fi\fi\fi\fi\expandafter\XINT_expr_getnext + \number #1{\fi\fi\fi\fi\fi\fi + \expandafter\XINT_expr_getop\csname .=\number#1\endcsname }% \begingroup \lccode`*=`# \lowercase{\endgroup -\def\XINT_expr_sixwayfork #1(-.+*\dummy #2#3\krof {#2}% +\def\XINT_expr_sixwayfork #1(-.+*#2#3\krof {#2}% \def\XINT_expr_getnext_onetoken_fork #1% -{% The * is in truth catcode 12 #. For (clever!) use with \xintNewExpr. +{% The * is in truth catcode 12 #. For (hacking) use with \xintNewExpr. \XINT_expr_sixwayfork - #1-.+*\dummy {\xint_c_xviii ({}}% back to until to trigger oparen - (#1.+*\dummy -% - (-#1+*\dummy {\XINT_expr_scandec_II.}% - (-.#1*\dummy \XINT_expr_getnext% - (-.+#1\dummy {\XINT_expr_scandec_II}% - (-.+*\dummy {\XINT_expr_scan_dec_or_func #1}% + #1-.+*{\xint_c_xviii ({}}% back to until for oparen triggering + (#1.+*-% + (-#1+*{\XINT_expr_scandec_II.}% + (-.#1*\XINT_expr_getnext% + (-.+#1{\XINT_expr_scandec_II}% + (-.+*{\XINT_expr_scan_dec_or_func #1}% \krof }}% -\def\XINT_expr_scan_dec_or_func #1% this #1 of catcode 12 +\def\XINT_expr_scan_dec_or_func #1% this #1 has necessarily here catcode 12 {% \ifnum \xint_c_ix<1#1 \expandafter\XINT_expr_scandec_I @@ -230,18 +244,17 @@ \xint_afterfi{\expandafter\XINT_expr_scanfunc_b \string #1}% \fi }% +\def\xint_UDparenfork #1()#2#3\krof {#2}% \def\XINT_expr_scanfunc_b #1% {% - \if #1(\expandafter \xint_gobble_iii\fi - \xint_firstofone - {% added in 1.09c for bool and togl - \if #1)\expandafter \xint_gobble_i - \else \expandafter \xint_firstoftwo - \fi }% - {\XINT_expr_scanfunc_c #1}(% + \xint_UDparenfork + #1){(}% and then \XINT_expr_func + (#1{(}% and then \XINT_expr_func (this is for bool/toggle names) + (){\XINT_expr_scanfunc_c #1}% + \krof }% \def\XINT_expr_scanfunc_panic {\xintError:bigtroubleahead(0\relax }% -\def\XINT_expr_func #1(% common to expr and flexpr +\def\XINT_expr_func #1(% common to expr and flexpr and iiexpr {% \xint_c_xviii @{#1}% functions have the highest priority. }% @@ -255,17 +268,24 @@ \expandafter\XINT_expr_getop\romannumeral-`0\expandafter \XINT_expr_lock\romannumeral-`0\XINT_expr_scanfracpart_b }% -\def\XINT_expr_scanintpart_a #1% +\def\XINT_expr_scanintpart_a #1% Please no braced material: 123{FORBIDDEN} +{% + \ifcat #1\relax + \expandafter !% + \else \expandafter\expandafter\expandafter + \XINT_expr_scanintpart_aa\expandafter\string + \fi #1% +}% +\def\XINT_expr_scanintpart_aa #1% {% - \ifnum \xint_c_ix<1\string#1 - \expandafter\expandafter\expandafter\XINT_expr_scanintpart_b - \expandafter\string + \ifnum \xint_c_ix<1#1 + \expandafter\XINT_expr_scanintpart_b \else - \if #1.% + \if .#1% \expandafter\expandafter\expandafter \XINT_expr_scandec_transition - \else - \expandafter\expandafter\expandafter !% ! of catcode 11... + \else % gather what we got so far, leave catcode 12 #1 in stream + \expandafter\expandafter\expandafter !% ! of catcode 11 ... \fi \fi #1% @@ -282,9 +302,16 @@ }% \def\XINT_expr_scanfracpart_a #1% {% - \ifnum \xint_c_ix<1\string#1 - \expandafter\expandafter\expandafter\XINT_expr_scanfracpart_b - \expandafter\string + \ifcat #1\relax + \expandafter !% + \else \expandafter\expandafter\expandafter + \XINT_expr_scanfracpart_aa\expandafter\string + \fi #1% +}% +\def\XINT_expr_scanfracpart_aa #1% +{% + \ifnum \xint_c_ix<1#1 + \expandafter\XINT_expr_scanfracpart_b \else \expandafter !% \fi @@ -301,23 +328,18 @@ \romannumeral-`0\romannumeral-`0% }% \def\XINT_expr_getop_a #1#2% -{% if an un-expandable control sequence is found, must be the ending \relax - \ifcat #2\relax - \ifx #2\relax - \expandafter\expandafter\expandafter - \XINT_expr_foundend - \else - \XINT_expr_unexpectedtoken - \expandafter\expandafter\expandafter - \XINT_expr_getop - \fi - \else - \expandafter\XINT_expr_foundop\expandafter #2% +{% if a control sequence is found, must be either \relax or register|variable + \ifcat #2\relax\expandafter\xint_firstoftwo + \else \expandafter\xint_secondoftwo \fi - #1% + {\ifx #2\relax\expandafter\XINT_expr_foundend\expandafter#1% + \else + \xint_afterfi{\XINT_expr_foundop *#1#2}% + \fi }% + {\XINT_expr_foundop #2#1}% }% \def\XINT_expr_foundend {\xint_c_ \relax }% \relax is a place holder here. -\def\XINT_expr_foundop #1% then becomes <prec> <op> and is followed by <\.f> +\def\XINT_expr_foundop #1% then becomes <prec> <op> and is followed by <\.=f> {% 1.09a: no control sequence \XINT_expr_op_#1, code common to expr/flexpr \ifcsname XINT_expr_precedence_#1\endcsname \expandafter\xint_afterfi\expandafter @@ -332,43 +354,38 @@ \def#1##1% {% \xint_UDsignfork - ##1\dummy {\expandafter#1\romannumeral-`0#3}% - -\dummy {#2##1}% + ##1{\expandafter#1\romannumeral-`0#3}% + -{#2##1}% \krof }% \def#2##1##2% {% \ifcase ##1\expandafter #4% - \or \xint_afterfi{% - \XINT_expr_extra_closing_paren - \expandafter #1\romannumeral-`0\XINT_expr_getop - }% - \else \xint_afterfi{% - \expandafter#1\romannumeral-`0\csname XINT_#5_op_##2\endcsname - }% + \or\xint_afterfi{% + \XINT_expr_extra_closing_paren + \expandafter #1\romannumeral-`0\XINT_expr_getop + }% + \else + \xint_afterfi{\expandafter#1\romannumeral-`0\csname XINT_#5_op_##2\endcsname }% \fi }% }% +\xintFor #1 in {expr,flexpr,iiexpr} \do {% \expandafter\XINT_tmpa - \csname XINT_expr_until_end_a\expandafter\endcsname - \csname XINT_expr_until_end_b\expandafter\endcsname - \csname XINT_expr_op_-vi\expandafter\endcsname - \csname XINT_expr_done\endcsname - {expr}% -\expandafter\XINT_tmpa - \csname XINT_flexpr_until_end_a\expandafter\endcsname - \csname XINT_flexpr_until_end_b\expandafter\endcsname - \csname XINT_flexpr_op_-vi\expandafter\endcsname - \csname XINT_flexpr_done\endcsname - {flexpr}% + \csname XINT_#1_until_end_a\expandafter\endcsname + \csname XINT_#1_until_end_b\expandafter\endcsname + \csname XINT_#1_op_-vi\expandafter\endcsname + \csname XINT_#1_done\endcsname + {#1}% +}% \def\XINT_expr_extra_closing_paren {\xintError:removed }% \def\XINT_tmpa #1#2#3#4#5#6% {% \def #1{\expandafter #3\romannumeral-`0\XINT_expr_getnext }% \let #2#1% \def #3##1{\xint_UDsignfork - ##1\dummy {\expandafter #3\romannumeral-`0#5}% - -\dummy {#4##1}% + ##1{\expandafter #3\romannumeral-`0#5}% + -{#4##1}% \krof }% \def #4##1##2% {% @@ -379,26 +396,23 @@ \fi }% }% +\xintFor #1 in {expr,flexpr,iiexpr} \do {% \expandafter\XINT_tmpa - \csname XINT_expr_op_(\expandafter\endcsname - \csname XINT_expr_oparen\expandafter\endcsname - \csname XINT_expr_until_)_a\expandafter\endcsname - \csname XINT_expr_until_)_b\expandafter\endcsname - \csname XINT_expr_op_-vi\endcsname - {expr}% -\expandafter\XINT_tmpa - \csname XINT_flexpr_op_(\expandafter\endcsname - \csname XINT_flexpr_oparen\expandafter\endcsname - \csname XINT_flexpr_until_)_a\expandafter\endcsname - \csname XINT_flexpr_until_)_b\expandafter\endcsname - \csname XINT_flexpr_op_-vi\endcsname - {flexpr}% + \csname XINT_#1_op_(\expandafter\endcsname + \csname XINT_#1_oparen\expandafter\endcsname + \csname XINT_#1_until_)_a\expandafter\endcsname + \csname XINT_#1_until_)_b\expandafter\endcsname + \csname XINT_#1_op_-vi\endcsname + {#1}% +}% \def\XINT_expr_missing_cparen {\xintError:inserted \xint_c_ \XINT_expr_done }% -\expandafter\let\csname XINT_expr_precedence_)\endcsname \xint_c_i -\expandafter\let\csname XINT_expr_op_)\endcsname\XINT_expr_getop +\expandafter\let\csname XINT_expr_precedence_)\endcsname \xint_c_i \expandafter\let\csname XINT_flexpr_precedence_)\endcsname \xint_c_i +\expandafter\let\csname XINT_iiexpr_precedence_)\endcsname \xint_c_i +\expandafter\let\csname XINT_expr_op_)\endcsname \XINT_expr_getop \expandafter\let\csname XINT_flexpr_op_)\endcsname\XINT_expr_getop -\def\XINT_tmpb #1#2#3#4#5#6% +\expandafter\let\csname XINT_iiexpr_op_)\endcsname\XINT_expr_getop +\def\XINT_tmpb #1#2#3#4#5#6%#7% {% \expandafter\XINT_tmpc \csname XINT_#1_op_#3\expandafter\endcsname @@ -407,9 +421,9 @@ \csname XINT_#1_op_-#5\expandafter\endcsname \csname xint_c_#4\expandafter\endcsname \csname #2#6\expandafter\endcsname - \csname XINT_expr_precedence_#3\endcsname {#1}% + \csname XINT_expr_precedence_#3\endcsname {#1}%{#7}% }% -\def\XINT_tmpc #1#2#3#4#5#6#7#8% +\def\XINT_tmpc #1#2#3#4#5#6#7#8#9% {% \def #1##1% \XINT_expr_op_<op> {% keep value, get next number and operator, then do until @@ -418,8 +432,8 @@ }% \def #2##1##2% \XINT_expr_until_<op>_a {\xint_UDsignfork - ##2\dummy {\expandafter #2\expandafter ##1\romannumeral-`0#4}% - -\dummy {#3##1##2}% + ##2{\expandafter #2\expandafter ##1\romannumeral-`0#4}% + -{#3##1##2}% \krof }% \def #3##1##2##3##4% \XINT_expr_until_<op>_b {% either execute next operation now, or first do next (possibly unary) @@ -429,12 +443,12 @@ \else \xint_afterfi {\expandafter ##2\expandafter ##3% - \csname .#6{\XINT_expr_unlock ##1}{\XINT_expr_unlock ##4}\endcsname }% + \csname .=#6#9{\XINT_expr_unlock ##1}{\XINT_expr_unlock ##4}\endcsname }% \fi }% \let #7#5% }% -\def\XINT_tmpa #1{\XINT_tmpb {expr}{xint}#1}% +\def\XINT_tmpa #1{\XINT_tmpb {expr}{xint}#1{}}% \xintApplyInline {\XINT_tmpa }{% {|{iii}{vi}{OR}}% {&{iv}{vi}{AND}}% @@ -449,7 +463,7 @@ {e{ix}{ix}{fE}}% {E{ix}{ix}{fE}}% }% -\def\XINT_tmpa #1{\XINT_tmpb {flexpr}{xint}#1}% +\def\XINT_tmpa #1{\XINT_tmpb {flexpr}{xint}#1{}}% \xintApplyInline {\XINT_tmpa }{% {|{iii}{vi}{OR}}% {&{iv}{vi}{AND}}% @@ -457,7 +471,7 @@ {>{v}{vi}{Gt}}% {={v}{vi}{Eq}}% }% -\def\XINT_tmpa #1{\XINT_tmpb {flexpr}{XINTinFloat}#1}% +\def\XINT_tmpa #1{\XINT_tmpb {flexpr}{XINTinFloat}#1{[\XINTdigits]}}% \xintApplyInline {\XINT_tmpa }{% {+{vi}{vi}{Add}}% {-{vi}{vi}{Sub}}% @@ -467,6 +481,21 @@ {e{ix}{ix}{fE}}% {E{ix}{ix}{fE}}% }% +\def\XINT_tmpa #1{\XINT_tmpb {iiexpr}{xint}#1{}}% +\xintApplyInline {\XINT_tmpa }{% + {|{iii}{vi}{OR}}% + {&{iv}{vi}{AND}}% + {<{v}{vi}{Lt}}% + {>{v}{vi}{Gt}}% + {={v}{vi}{Eq}}% + {+{vi}{vi}{iiAdd}}% + {-{vi}{vi}{iiSub}}% + {*{vii}{vii}{iiMul}}% + {/{vii}{vii}{iiQuo}}% + {^{viii}{viii}{iiPow}}% + {e{ix}{ix}{iE}}% + {E{ix}{ix}{iE}}% +}% \def\XINT_tmpa #1#2#3#4#5#6% {% \def #1##1% \XINT_expr_op_,_a @@ -475,8 +504,8 @@ }% \def #2##1##2% \XINT_expr_until_,_a {\xint_UDsignfork - ##2\dummy {\expandafter #2\expandafter ##1\romannumeral-`0#4}% - -\dummy {#3##1##2}% + ##2{\expandafter #2\expandafter ##1\romannumeral-`0#4}% + -{#3##1##2}% \krof }% \def #3##1##2##3##4% \XINT_expr_until_,_b {% @@ -486,32 +515,28 @@ \else \xint_afterfi {\expandafter ##2\expandafter ##3% - \csname .\XINT_expr_unlock ##1,\XINT_expr_unlock ##4\endcsname }% + \csname .=\XINT_expr_unlock ##1,\XINT_expr_unlock ##4\endcsname }% \fi }% \let #5\xint_c_ii }% +\xintFor #1 in {expr,flexpr,iiexpr} \do {% \expandafter\XINT_tmpa - \csname XINT_expr_op_,\expandafter\endcsname - \csname XINT_expr_until_,_a\expandafter\endcsname - \csname XINT_expr_until_,_b\expandafter\endcsname - \csname XINT_expr_op_-vi\expandafter\endcsname - \csname XINT_expr_precedence_,\endcsname {expr}% -\expandafter\XINT_tmpa - \csname XINT_flexpr_op_,\expandafter\endcsname - \csname XINT_flexpr_until_,_a\expandafter\endcsname - \csname XINT_flexpr_until_,_b\expandafter\endcsname - \csname XINT_flexpr_op_-vi\expandafter\endcsname - \csname XINT_expr_precedence_,\endcsname {flexpr}% -\def\XINT_tmpa #1#2% + \csname XINT_#1_op_,\expandafter\endcsname + \csname XINT_#1_until_,_a\expandafter\endcsname + \csname XINT_#1_until_,_b\expandafter\endcsname + \csname XINT_#1_op_-vi\expandafter\endcsname + \csname XINT_expr_precedence_,\endcsname {#1}% +}% +\def\XINT_tmpa #1#2#3% {% \expandafter\XINT_tmpb - \csname XINT_#1_op_-#2\expandafter\endcsname - \csname XINT_#1_until_-#2_a\expandafter\endcsname - \csname XINT_#1_until_-#2_b\expandafter\endcsname - \csname xint_c_#2\endcsname {#1}% + \csname XINT_#1_op_-#3\expandafter\endcsname + \csname XINT_#1_until_-#3_a\expandafter\endcsname + \csname XINT_#1_until_-#3_b\expandafter\endcsname + \csname xint_c_#3\endcsname {#1}#2% }% -\def\XINT_tmpb #1#2#3#4#5% +\def\XINT_tmpb #1#2#3#4#5#6% {% \def #1% \XINT_expr_op_-<level> {% get next number+operator then switch to _until macro @@ -519,8 +544,8 @@ }% \def #2##1% \XINT_expr_until_-<l>_a {\xint_UDsignfork - ##1\dummy {\expandafter #2\romannumeral-`0#1}% - -\dummy {#3##1}% + ##1{\expandafter #2\romannumeral-`0#1}% + -{#3##1}% \krof }% \def #3##1##2##3% \XINT_expr_until_-<l>_b {% _until tests precedence level with next op, executes now or postpones @@ -529,12 +554,13 @@ \csname XINT_#5_op_##2\endcsname {##3}}% \else \xint_afterfi {\expandafter ##1\expandafter ##2% - \csname .\xintOpp{\XINT_expr_unlock ##3}\endcsname }% + \csname .=#6{\XINT_expr_unlock ##3}\endcsname }% \fi }% }% -\xintApplyInline{\XINT_tmpa {expr}}{{vi}{vii}{viii}{ix}}% -\xintApplyInline{\XINT_tmpa {flexpr}}{{vi}{vii}{viii}{ix}}% +\xintApplyInline{\XINT_tmpa {expr}\xintOpp}{{vi}{vii}{viii}{ix}}% +\xintApplyInline{\XINT_tmpa {flexpr}\xintOpp}{{vi}{vii}{viii}{ix}}% +\xintApplyInline{\XINT_tmpa {iiexpr}\xintiiOpp}{{vi}{vii}{viii}{ix}}% \let\XINT_expr_precedence_? \xint_c_x \def \XINT_expr_op_? #1#2#3% {% @@ -543,6 +569,7 @@ {\XINT_expr_getnext #2}% }% \let\XINT_flexpr_op_?\XINT_expr_op_? +\let\XINT_iiexpr_op_?\XINT_expr_op_? \let\XINT_expr_precedence_: \xint_c_x \def \XINT_expr_op_: #1#2#3#4% {% @@ -552,145 +579,198 @@ {\XINT_expr_getnext #4}% }% \let\XINT_flexpr_op_:\XINT_expr_op_: +\let\XINT_iiexpr_op_:\XINT_expr_op_: \let\XINT_expr_precedence_! \xint_c_x \def\XINT_expr_op_! #1{\expandafter\XINT_expr_getop - \csname .\xintFac{\XINT_expr_unlock #1}\endcsname }% [0] removed in 1.09c + \csname .=\xintFac{\XINT_expr_unlock #1}\endcsname }% \let\XINT_flexpr_op_!\XINT_expr_op_! -\def\XINT_expr_op_@ #1% -{% - \ifcsname XINT_expr_onlitteral_#1\endcsname - \expandafter\XINT_expr_funcoflitteral - \else - \expandafter\XINT_expr_op_@@ - \fi {#1}% +\def\XINT_iiexpr_op_! #1{\expandafter\XINT_expr_getop + \csname .=\xintiFac{\XINT_expr_unlock #1}\endcsname }% +\def\XINT_tmpa #1#2#3#4{% + \def #1##1% + {% + \ifcsname XINT_expr_onlitteral_##1\endcsname + \expandafter\XINT_expr_funcoflitteral + \else + \expandafter #2% + \fi {##1}% + }% + \def #2##1% + {% + \ifcsname XINT_#4_func_##1\endcsname + \xint_afterfi + {\expandafter\expandafter\csname XINT_#4_func_##1\endcsname}% + \else \csname xintError:unknown `##1\string'\endcsname + \xint_afterfi{\expandafter\XINT_expr_func_unknown}% + \fi + \romannumeral-`0#3% + }% }% -\def\XINT_flexpr_op_@ #1% -{% - \ifcsname XINT_expr_onlitteral_#1\endcsname - \expandafter\XINT_expr_funcoflitteral - \else - \expandafter\XINT_flexpr_op_@@ - \fi {#1}% +\xintFor #1 in {expr,flexpr,iiexpr} \do {% + \expandafter\XINT_tmpa + \csname XINT_#1_op_@\expandafter\endcsname + \csname XINT_#1_op_@@\expandafter\endcsname + \csname XINT_#1_oparen\endcsname {#1}% }% \def\XINT_expr_funcoflitteral #1% {% \expandafter\expandafter\csname XINT_expr_onlitteral_#1\endcsname \romannumeral-`0\XINT_expr_scanfunc }% -\def\XINT_expr_op_@@ #1% -{% - \ifcsname XINT_expr_func_#1\endcsname - \xint_afterfi{\expandafter\expandafter\csname XINT_expr_func_#1\endcsname}% - \else \xintError:unknownfunction - \xint_afterfi{\expandafter\XINT_expr_func_unknown}% - \fi - \romannumeral-`0\XINT_expr_oparen -}% -\def\XINT_flexpr_op_@@ #1% -{% - \ifcsname XINT_flexpr_func_#1\endcsname - \xint_afterfi{\expandafter\expandafter\csname XINT_flexpr_func_#1\endcsname}% - \else \xintError:unknownfunction - \xint_afterfi{\expandafter\XINT_expr_func_unknown}% - \fi - \romannumeral-`0\XINT_flexpr_oparen -}% \def\XINT_expr_onlitteral_bool #1#2#3{\expandafter\XINT_expr_getop - \csname .\xintBool{#3}\endcsname }% + \csname .=\xintBool{#3}\endcsname }% \def\XINT_expr_onlitteral_togl #1#2#3{\expandafter\XINT_expr_getop - \csname .\xintToggle{#3}\endcsname }% -\def\XINT_expr_func_unknown #1#2#3% -{% - \expandafter #1\expandafter #2\csname .0[0]\endcsname -}% + \csname .=\xintToggle{#3}\endcsname }% +\def\XINT_expr_func_unknown #1#2#3% 1.09i removes [0], because \xintiiexpr + {\expandafter #1\expandafter #2\csname .=0\endcsname }% \def\XINT_expr_func_reduce #1#2#3% {% \expandafter #1\expandafter #2\csname - .\xintIrr {\XINT_expr_unlock #3}\endcsname + .=\xintIrr {\XINT_expr_unlock #3}\endcsname }% \let\XINT_flexpr_func_reduce\XINT_expr_func_reduce +\def\XINT_expr_func_frac #1#2#3% +{% + \expandafter #1\expandafter #2\csname + .=\xintTFrac {\XINT_expr_unlock #3}\endcsname +}% +\def\XINT_flexpr_func_frac #1#2#3% +{% + \expandafter #1\expandafter #2\csname + .=\XINTinFloatFrac [\XINTdigits]{\XINT_expr_unlock #3}\endcsname +}% \def\XINT_expr_func_sqr #1#2#3% {% \expandafter #1\expandafter #2\csname - .\xintSqr {\XINT_expr_unlock #3}\endcsname + .=\xintSqr {\XINT_expr_unlock #3}\endcsname }% \def\XINT_flexpr_func_sqr #1#2#3% {% \expandafter #1\expandafter #2\csname - .\XINTinFloatMul {\XINT_expr_unlock #3}{\XINT_expr_unlock #3}\endcsname + .=\XINTinFloatMul [\XINTdigits]% + {\XINT_expr_unlock #3}{\XINT_expr_unlock #3}\endcsname +}% +\def\XINT_iiexpr_func_sqr #1#2#3% +{% + \expandafter #1\expandafter #2\csname + .=\xintiiSqr {\XINT_expr_unlock #3}\endcsname }% \def\XINT_expr_func_abs #1#2#3% {% \expandafter #1\expandafter #2\csname - .\xintAbs {\XINT_expr_unlock #3}\endcsname + .=\xintAbs {\XINT_expr_unlock #3}\endcsname }% \let\XINT_flexpr_func_abs\XINT_expr_func_abs +\def\XINT_iiexpr_func_abs #1#2#3% +{% + \expandafter #1\expandafter #2\csname + .=\xintiiAbs {\XINT_expr_unlock #3}\endcsname +}% \def\XINT_expr_func_sgn #1#2#3% {% \expandafter #1\expandafter #2\csname - .\xintSgn {\XINT_expr_unlock #3}\endcsname + .=\xintSgn {\XINT_expr_unlock #3}\endcsname }% \let\XINT_flexpr_func_sgn\XINT_expr_func_sgn +\def\XINT_iiexpr_func_sgn #1#2#3% +{% + \expandafter #1\expandafter #2\csname + .=\xintiiSgn {\XINT_expr_unlock #3}\endcsname +}% \def\XINT_expr_func_floor #1#2#3% {% \expandafter #1\expandafter #2\csname - .\xintFloor {\XINT_expr_unlock #3}\endcsname + .=\xintFloor {\XINT_expr_unlock #3}\endcsname }% \let\XINT_flexpr_func_floor\XINT_expr_func_floor +\let\XINT_iiexpr_func_floor\XINT_expr_func_floor \def\XINT_expr_func_ceil #1#2#3% {% \expandafter #1\expandafter #2\csname - .\xintCeil {\XINT_expr_unlock #3}\endcsname + .=\xintCeil {\XINT_expr_unlock #3}\endcsname }% \let\XINT_flexpr_func_ceil\XINT_expr_func_ceil +\let\XINT_iiexpr_func_ceil\XINT_expr_func_ceil \def\XINT_expr_twoargs #1,#2,{{#1}{#2}}% \def\XINT_expr_func_quo #1#2#3% {% - \expandafter #1\expandafter #2\csname .% + \expandafter #1\expandafter #2\csname .=% \expandafter\expandafter\expandafter\xintQuo \expandafter\XINT_expr_twoargs \romannumeral-`0\XINT_expr_unlock #3,\endcsname }% \let\XINT_flexpr_func_quo\XINT_expr_func_quo +\def\XINT_iiexpr_func_quo #1#2#3% +{% + \expandafter #1\expandafter #2\csname .=% + \expandafter\expandafter\expandafter\xintiiQuo + \expandafter\XINT_expr_twoargs + \romannumeral-`0\XINT_expr_unlock #3,\endcsname +}% \def\XINT_expr_func_rem #1#2#3% {% - \expandafter #1\expandafter #2\csname .% + \expandafter #1\expandafter #2\csname .=% \expandafter\expandafter\expandafter\xintRem \expandafter\XINT_expr_twoargs \romannumeral-`0\XINT_expr_unlock #3,\endcsname }% \let\XINT_flexpr_func_rem\XINT_expr_func_rem +\def\XINT_iiexpr_func_rem #1#2#3% +{% + \expandafter #1\expandafter #2\csname .=% + \expandafter\expandafter\expandafter\xintiiRem + \expandafter\XINT_expr_twoargs + \romannumeral-`0\XINT_expr_unlock #3,\endcsname +}% \def\XINT_expr_oneortwo #1#2#3,#4,#5.% {% \if\relax#5\relax\expandafter\xint_firstoftwo\else \expandafter\xint_secondoftwo\fi - {#1{0}{#3}}{#2{\xintNum {#4}}{#3}}% + {#1{0}}{#2{\xintNum {#4}}}{#3}% }% \def\XINT_expr_func_round #1#2#3% {% - \expandafter #1\expandafter #2\csname .% + \expandafter #1\expandafter #2\csname .=% \expandafter\XINT_expr_oneortwo \expandafter\xintiRound\expandafter\xintRound \romannumeral-`0\XINT_expr_unlock #3,,.\endcsname }% \let\XINT_flexpr_func_round\XINT_expr_func_round +\def\XINT_iiexpr_oneortwo #1#2,#3,#4.% +{% + \if\relax#4\relax\expandafter\xint_firstoftwo\else + \expandafter\xint_secondoftwo\fi + {#1{0}}{#1{#3}}{#2}% +}% +\def\XINT_iiexpr_func_round #1#2#3% +{% + \expandafter #1\expandafter #2\csname .=% + \expandafter\XINT_iiexpr_oneortwo\expandafter\xintiRound + \romannumeral-`0\XINT_expr_unlock #3,,.\endcsname +}% \def\XINT_expr_func_trunc #1#2#3% {% - \expandafter #1\expandafter #2\csname .% + \expandafter #1\expandafter #2\csname .=% \expandafter\XINT_expr_oneortwo \expandafter\xintiTrunc\expandafter\xintTrunc \romannumeral-`0\XINT_expr_unlock #3,,.\endcsname }% \let\XINT_flexpr_func_trunc\XINT_expr_func_trunc +\def\XINT_iiexpr_func_trunc #1#2#3% +{% + \expandafter #1\expandafter #2\csname .=% + \expandafter\XINT_iiexpr_oneortwo\expandafter\xintiTrunc + \romannumeral-`0\XINT_expr_unlock #3,,.\endcsname +}% \def\XINT_expr_argandopt #1,#2,#3.% {% \if\relax#3\relax\expandafter\xint_firstoftwo\else \expandafter\xint_secondoftwo\fi - {[\XINTdigits]{#1}}{[\xintNum {#2}]{#1}}% + {[\XINTdigits]}{[\xintNum {#2}]}{#1}% }% \def\XINT_expr_func_float #1#2#3% {% - \expandafter #1\expandafter #2\csname .% + \expandafter #1\expandafter #2\csname .=% \expandafter\XINTinFloat \romannumeral-`0\expandafter\XINT_expr_argandopt \romannumeral-`0\XINT_expr_unlock #3,,.\endcsname @@ -698,127 +778,164 @@ \let\XINT_flexpr_func_float\XINT_expr_func_float \def\XINT_expr_func_sqrt #1#2#3% {% - \expandafter #1\expandafter #2\csname .% + \expandafter #1\expandafter #2\csname .=% \expandafter\XINTinFloatSqrt \romannumeral-`0\expandafter\XINT_expr_argandopt \romannumeral-`0\XINT_expr_unlock #3,,.\endcsname }% \let\XINT_flexpr_func_sqrt\XINT_expr_func_sqrt +\def\XINT_iiexpr_func_sqrt #1#2#3% +{% + \expandafter #1\expandafter #2\csname + .=\xintiSqrt {\XINT_expr_unlock #3}\endcsname +}% \def\XINT_expr_func_gcd #1#2#3% {% \expandafter #1\expandafter #2\csname - .\xintGCDof:csv{\XINT_expr_unlock #3}\endcsname + .=\xintGCDof:csv{\XINT_expr_unlock #3}\endcsname }% \let\XINT_flexpr_func_gcd\XINT_expr_func_gcd +\let\XINT_iiexpr_func_gcd\XINT_expr_func_gcd \def\XINT_expr_func_lcm #1#2#3% {% \expandafter #1\expandafter #2\csname - .\xintLCMof:csv{\XINT_expr_unlock #3}\endcsname + .=\xintLCMof:csv{\XINT_expr_unlock #3}\endcsname }% \let\XINT_flexpr_func_lcm\XINT_expr_func_lcm +\let\XINT_iiexpr_func_lcm\XINT_expr_func_lcm \def\XINT_expr_func_max #1#2#3% {% \expandafter #1\expandafter #2\csname - .\xintMaxof:csv{\XINT_expr_unlock #3}\endcsname + .=\xintMaxof:csv{\XINT_expr_unlock #3}\endcsname +}% +\def\XINT_iiexpr_func_max #1#2#3% +{% + \expandafter #1\expandafter #2\csname + .=\xintiMaxof:csv{\XINT_expr_unlock #3}\endcsname }% \def\XINT_flexpr_func_max #1#2#3% {% \expandafter #1\expandafter #2\csname - .\XINTinFloatMaxof:csv{\XINT_expr_unlock #3}\endcsname + .=\XINTinFloatMaxof:csv{\XINT_expr_unlock #3}\endcsname }% \def\XINT_expr_func_min #1#2#3% {% \expandafter #1\expandafter #2\csname - .\xintMinof:csv{\XINT_expr_unlock #3}\endcsname + .=\xintMinof:csv{\XINT_expr_unlock #3}\endcsname +}% +\def\XINT_iiexpr_func_min #1#2#3% +{% + \expandafter #1\expandafter #2\csname + .=\xintiMinof:csv{\XINT_expr_unlock #3}\endcsname }% \def\XINT_flexpr_func_min #1#2#3% {% \expandafter #1\expandafter #2\csname - .\XINTinFloatMinof:csv{\XINT_expr_unlock #3}\endcsname + .=\XINTinFloatMinof:csv{\XINT_expr_unlock #3}\endcsname }% \def\XINT_expr_func_sum #1#2#3% {% \expandafter #1\expandafter #2\csname - .\xintSum:csv{\XINT_expr_unlock #3}\endcsname + .=\xintSum:csv{\XINT_expr_unlock #3}\endcsname }% \def\XINT_flexpr_func_sum #1#2#3% {% \expandafter #1\expandafter #2\csname - .\XINTinFloatSum:csv{\XINT_expr_unlock #3}\endcsname + .=\XINTinFloatSum:csv{\XINT_expr_unlock #3}\endcsname +}% +\def\XINT_iiexpr_func_sum #1#2#3% +{% + \expandafter #1\expandafter #2\csname + .=\xintiiSum:csv{\XINT_expr_unlock #3}\endcsname }% \def\XINT_expr_func_prd #1#2#3% {% \expandafter #1\expandafter #2\csname - .\xintPrd:csv{\XINT_expr_unlock #3}\endcsname + .=\xintPrd:csv{\XINT_expr_unlock #3}\endcsname }% \def\XINT_flexpr_func_prd #1#2#3% {% \expandafter #1\expandafter #2\csname - .\XINTinFloatPrd:csv{\XINT_expr_unlock #3}\endcsname + .=\XINTinFloatPrd:csv{\XINT_expr_unlock #3}\endcsname +}% +\def\XINT_iiexpr_func_prd #1#2#3% +{% + \expandafter #1\expandafter #2\csname + .=\xintiiPrd:csv{\XINT_expr_unlock #3}\endcsname }% \let\XINT_expr_func_add\XINT_expr_func_sum \let\XINT_expr_func_mul\XINT_expr_func_prd \let\XINT_flexpr_func_add\XINT_flexpr_func_sum \let\XINT_flexpr_func_mul\XINT_flexpr_func_prd +\let\XINT_iiexpr_func_add\XINT_iiexpr_func_sum +\let\XINT_iiexpr_func_mul\XINT_iiexpr_func_prd \def\XINT_expr_func_? #1#2#3% {% \expandafter #1\expandafter #2\csname - .\xintIsNotZero {\XINT_expr_unlock #3}\endcsname + .=\xintIsNotZero {\XINT_expr_unlock #3}\endcsname }% \let\XINT_flexpr_func_? \XINT_expr_func_? +\let\XINT_iiexpr_func_? \XINT_expr_func_? \def\XINT_expr_func_! #1#2#3% {% \expandafter #1\expandafter #2\csname - .\xintIsZero {\XINT_expr_unlock #3}\endcsname + .=\xintIsZero {\XINT_expr_unlock #3}\endcsname }% \let\XINT_flexpr_func_! \XINT_expr_func_! +\let\XINT_iiexpr_func_! \XINT_expr_func_! \def\XINT_expr_func_not #1#2#3% {% \expandafter #1\expandafter #2\csname - .\xintIsZero {\XINT_expr_unlock #3}\endcsname + .=\xintIsZero {\XINT_expr_unlock #3}\endcsname }% \let\XINT_flexpr_func_not \XINT_expr_func_not +\let\XINT_iiexpr_func_not \XINT_expr_func_not \def\XINT_expr_func_all #1#2#3% {% \expandafter #1\expandafter #2\csname - .\xintANDof:csv{\XINT_expr_unlock #3}\endcsname + .=\xintANDof:csv{\XINT_expr_unlock #3}\endcsname }% \let\XINT_flexpr_func_all\XINT_expr_func_all +\let\XINT_iiexpr_func_all\XINT_expr_func_all \def\XINT_expr_func_any #1#2#3% {% \expandafter #1\expandafter #2\csname - .\xintORof:csv{\XINT_expr_unlock #3}\endcsname + .=\xintORof:csv{\XINT_expr_unlock #3}\endcsname }% \let\XINT_flexpr_func_any\XINT_expr_func_any +\let\XINT_iiexpr_func_any\XINT_expr_func_any \def\XINT_expr_func_xor #1#2#3% {% \expandafter #1\expandafter #2\csname - .\xintXORof:csv{\XINT_expr_unlock #3}\endcsname + .=\xintXORof:csv{\XINT_expr_unlock #3}\endcsname }% \let\XINT_flexpr_func_xor\XINT_expr_func_xor +\let\XINT_iiexpr_func_xor\XINT_expr_func_xor \def\xintifNotZero:: #1,#2,#3,{\xintifNotZero{#1}{#2}{#3}}% \def\XINT_expr_func_if #1#2#3% {% \expandafter #1\expandafter #2\csname - .\expandafter\xintifNotZero:: + .=\expandafter\xintifNotZero:: \romannumeral-`0\XINT_expr_unlock #3,\endcsname }% \let\XINT_flexpr_func_if\XINT_expr_func_if +\let\XINT_iiexpr_func_if\XINT_expr_func_if \def\xintifSgn:: #1,#2,#3,#4,{\xintifSgn{#1}{#2}{#3}{#4}}% \def\XINT_expr_func_ifsgn #1#2#3% {% \expandafter #1\expandafter #2\csname - .\expandafter\xintifSgn:: + .=\expandafter\xintifSgn:: \romannumeral-`0\XINT_expr_unlock #3,\endcsname }% \let\XINT_flexpr_func_ifsgn\XINT_expr_func_ifsgn +\let\XINT_iiexpr_func_ifsgn\XINT_expr_func_ifsgn \def\XINT_newexpr_print #1{\ifnum\xintNthElt{0}{#1}>1 \expandafter\xint_firstoftwo \else \expandafter\xint_secondoftwo \fi {_xintListWithSep,{#1}}{\xint_firstofone#1}}% -\xintForpair #1#2 in {(fl,Float),(num,iRound0),(bool,IsTrue)}\do {% +\xintForpair #1#2 in {(fl,Float),(i,iRound0),(bool,IsTrue)}\do {% \expandafter\def\csname XINT_new#1expr_print\endcsname ##1{\ifnum\xintNthElt{0}{##1}>1 \expandafter\xint_firstoftwo @@ -828,12 +945,18 @@ {_xintListWithSep,{\xintApply{_xint#2}{##1}}} {_xint#2##1}}}% \toks0 {}% -\xintFor #1 in {Bool,Toggle,Floor,Ceil,iRound,Round,iTrunc,Trunc,% +\xintFor #1 in {Bool,Toggle,Floor,Ceil,iRound,Round,iTrunc,Trunc,TFrac,% Lt,Gt,Eq,AND,OR,IsNotZero,IsZero,ifNotZero,ifSgn,% - Irr,Num,Abs,Sgn,Opp,Quo,Rem,Add,Sub,Mul,Sqr,Div,Pow,Fac,fE}\do + Irr,Num,Abs,Sgn,Opp,Quo,Rem,Add,Sub,Mul,Sqr,Div,Pow,Fac,fE,iSqrt,% + iiAdd,iiSub,iiMul,iiSqr,iiPow,iiQuo,iiRem,iiSgn,iiAbs,iiOpp,iE}\do {\toks0 \expandafter{\the\toks0\expandafter\def\csname xint#1\endcsname {_xint#1}}}% -\xintFor #1 in {GCDof,LCMof,Maxof,Minof,ANDof,ORof,XORof,Sum,Prd}\do +\xintFor #1 in {,Sqrt,Add,Sub,Mul,Div,Power,fE,Frac}\do + {\toks0 + \expandafter{\the\toks0\expandafter\def\csname XINTinFloat#1\endcsname + {_XINTinFloat#1}}}% +\xintFor #1 in {GCDof,LCMof,Maxof,Minof,ANDof,ORof,XORof,Sum,Prd,% + iMaxof,iMinof,iiSum,iiPrd}\do {\toks0 \expandafter{\the\toks0\expandafter\def\csname xint#1:csv\endcsname ####1{_xint#1{\xintCSVtoListNonStripped {####1}}}}}% @@ -841,17 +964,13 @@ {\toks0 \expandafter{\the\toks0\expandafter\def\csname XINTinFloat#1:csv\endcsname ####1{_XINTinFloat#1{\xintCSVtoListNonStripped {####1}}}}}% -\xintFor #1 in {,Sqrt,Add,Sub,Mul,Div,Power,fE}\do - {\toks0 - \expandafter{\the\toks0\expandafter\def\csname XINTinFloat#1\endcsname - {_XINTinFloat#1}}}% \expandafter\def\expandafter\XINT_expr_protect\expandafter{\the\toks0 \def\XINTdigits {_XINTdigits}% \def\XINT_expr_print ##1{\expandafter\XINT_newexpr_print\expandafter {\romannumeral0\xintcsvtolistnonstripped{\XINT_expr_unlock ##1}}}% \def\XINT_flexpr_print ##1{\expandafter\XINT_newflexpr_print\expandafter {\romannumeral0\xintcsvtolistnonstripped{\XINT_expr_unlock ##1}}}% - \def\XINT_numexpr_print ##1{\expandafter\XINT_newnumexpr_print\expandafter + \def\XINT_iexpr_print ##1{\expandafter\XINT_newiexpr_print\expandafter {\romannumeral0\xintcsvtolistnonstripped{\XINT_expr_unlock ##1}}}% \def\XINT_boolexpr_print ##1{\expandafter\XINT_newboolexpr_print\expandafter {\romannumeral0\xintcsvtolistnonstripped{\XINT_expr_unlock ##1}}}% @@ -859,7 +978,9 @@ \toks0 {}% \def\xintNewExpr {\xint_NewExpr\xinttheexpr }% \def\xintNewFloatExpr {\xint_NewExpr\xintthefloatexpr }% -\def\xintNewNumExpr {\xint_NewExpr\xintthenumexpr }% +\def\xintNewIExpr {\xint_NewExpr\xinttheiexpr }% +\let\xintNewNumExpr\xintNewIExpr +\def\xintNewIIExpr {\xint_NewExpr\xinttheiiexpr }% \def\xintNewBoolExpr {\xint_NewExpr\xinttheboolexpr }% \def\xint_NewExpr #1#2[#3]% {% @@ -877,31 +998,32 @@ \or \toks0 {\xdef #2##1##2##3##4##5##6##7##8##9}% \fi \xintexprSafeCatcodes + \escapechar92 \XINT_NewExpr #1% }% \catcode`* 13 \def\XINT_NewExpr #1#2% {% - \def\xintTmp ##1##2##3##4##5##6##7##8##9{#2}% + \def\XINT_tmpa ##1##2##3##4##5##6##7##8##9{#2}% \XINT_expr_protect - \lccode`\*=`_ \lowercase {\def*}{!noexpand!}% - \catcode`_ 13 \catcode`: 11 \endlinechar -1 + \lccode`*=`_ \lowercase {\def*}{!noexpand!}% + \catcode`_ 13 \catcode`: 11 %\endlinechar -1 %not sure why I had that, \par? \everyeof {\noexpand }% - \edef\XINTtmp ##1##2##3##4##5##6##7##8##9% + \edef\XINT_tmpb ##1##2##3##4##5##6##7##8##9% {\scantokens \expandafter{\romannumeral-`0#1% - \xintTmp {####1}{####2}{####3}% - {####4}{####5}{####6}% - {####7}{####8}{####9}% + \XINT_tmpa {####1}{####2}{####3}% + {####4}{####5}{####6}% + {####7}{####8}{####9}% \relax}}% - \lccode`\*=`\$ \lowercase {\def*}{####}% + \lccode`*=`\$ \lowercase {\def*}{####}% \catcode`\$ 13 \catcode`! 0 \catcode`_ 11 % \the\toks0 {\scantokens\expandafter{\expandafter - \XINT_newexpr_stripprefix\meaning\XINTtmp}}% + \XINT_newexpr_setprefix\meaning\XINT_tmpb}}% \endgroup }% -\let\xintexprRestoreCatcodes\relax +\let\xintexprRestoreCatcodes\empty \def\xintexprSafeCatcodes {% for end user. \edef\xintexprRestoreCatcodes {% @@ -924,8 +1046,9 @@ \catcode46=\the\catcode46 % . \catcode45=\the\catcode45 % - \catcode44=\the\catcode44 % , - \catcode61=\the\catcode61\relax % = - }% this is just for some standard situation with a few made active by Babel + \catcode61=\the\catcode61 % = + \catcode32=\the\catcode32\relax % space + }% it's hard to know where to stop... \catcode63=12 % ? \catcode124=12 % | \catcode38=4 % & @@ -946,6 +1069,7 @@ \catcode45=12 % - \catcode44=12 % , \catcode61=12 % = + \catcode32=10 % space }% \let\XINT_tmpa\relax \let\XINT_tmpb\relax \let\XINT_tmpc\relax \XINT_restorecatcodes_endinput% diff --git a/Master/texmf-dist/tex/generic/xint/xintfrac.sty b/Master/texmf-dist/tex/generic/xint/xintfrac.sty index acebf35e6f7..ebe00b574bc 100644 --- a/Master/texmf-dist/tex/generic/xint/xintfrac.sty +++ b/Master/texmf-dist/tex/generic/xint/xintfrac.sty @@ -21,7 +21,7 @@ %% same distribution. (The sources need not necessarily be %% in the same archive or directory.) %%---------------------------------------------------------------- -%% The xint bundle (version 1.09h of November 28, 2013) +%% The xint bundle (version 1.09i of December 18, 2013) %% xintfrac: Expandable operations on fractions %% Copyright (C) 2013 by Jean-Francois Burnol %%---------------------------------------------------------------- @@ -103,7 +103,7 @@ \XINTsetupcatcodes% \XINT_providespackage \ProvidesPackage{xintfrac}% - [2013/11/28 v1.09h Expandable operations on fractions (jfB)]% + [2013/12/18 v1.09i Expandable operations on fractions (jfB)]% \chardef\xint_c_vi 6 \chardef\xint_c_vii 7 \chardef\xint_c_xviii 18 @@ -149,7 +149,7 @@ }% \def\XINT_outfrac #1#2#3% {% - \ifcase\XINT_Sgn{#3} + \ifcase\XINT__Sgn #3\Z \expandafter \XINT_outfrac_divisionbyzero \or \expandafter \XINT_outfrac_P @@ -159,11 +159,11 @@ {#2}{#3}[#1]% }% \def\XINT_outfrac_divisionbyzero #1#2{\xintError:DivisionByZero\space #1/0}% -\def\XINT_outfrac_P #1#2% +\edef\XINT_outfrac_P #1#2% {% - \ifcase\XINT_Sgn{#1} - \expandafter\XINT_outfrac_Zero - \fi + \noexpand\if0\noexpand\XINT_Sgn #1\noexpand\Z + \noexpand\expandafter\noexpand\XINT_outfrac_Zero + \noexpand\fi \space #1/#2% }% \def\XINT_outfrac_Zero #1[#2]{ 0/1[0]}% @@ -184,8 +184,8 @@ \def\XINT_infrac_ #1[#2#3]#4\Z {% \xint_UDwfork - #2\dummy \XINT_infrac_A - \W\dummy \XINT_infrac_B + #2\XINT_infrac_A + \W\XINT_infrac_B \krof #1[#2#3]#4% }% @@ -201,8 +201,8 @@ \def\XINT_infrac_BC #1/#2#3\Z {% \xint_UDwfork - #2\dummy \XINT_infrac_BCa - \W\dummy {\expandafter\XINT_infrac_BCb \romannumeral-`0#2}% + #2\XINT_infrac_BCa + \W{\expandafter\XINT_infrac_BCb \romannumeral-`0#2}% \krof #3\Z #1\Z }% @@ -212,16 +212,16 @@ \def\XINT_frac #1/#2#3\Z {% \xint_UDwfork - #2\dummy \XINT_frac_A - \W\dummy {\expandafter\XINT_frac_U \romannumeral-`0#2}% + #2\XINT_frac_A + \W{\expandafter\XINT_frac_U \romannumeral-`0#2}% \krof #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}% + #2\XINT_frac_Ua + \W{\XINT_frac_Ub #2}% \krof #3\Z #1\Z }% @@ -230,8 +230,8 @@ \def\XINT_frac_B #1.#2#3\Z {% \xint_UDwfork - #2\dummy \XINT_frac_Ba - \W\dummy {\XINT_frac_Bb #2}% + #2\XINT_frac_Ba + \W{\XINT_frac_Bb #2}% \krof #3\Z #1\Z }% @@ -245,8 +245,8 @@ \def\XINT_frac_T #1#2#3#4e#5#6\Z {% \xint_UDwfork - #5\dummy \XINT_frac_Ta - \W\dummy {\XINT_frac_Tb #5}% + #5\XINT_frac_Ta + \W{\XINT_frac_Tb #5}% \krof #6\Z #4\Z {#1}{#2}{#3}% }% @@ -255,8 +255,8 @@ \def\XINT_frac_C #1.#2#3\Z {% \xint_UDwfork - #2\dummy \XINT_frac_Ca - \W\dummy {\XINT_frac_Cb #2}% + #2\XINT_frac_Ca + \W{\XINT_frac_Cb #2}% \krof #3\Z #1\Z }% @@ -284,14 +284,14 @@ \def\XINT_frac_F #1% {% \xint_UDzerominusfork - #1-\dummy \XINT_frac_Gdivisionbyzero - 0#1\dummy \XINT_frac_Gneg - 0-\dummy {\XINT_frac_Gpos #1}% + #1-\XINT_frac_Gdivisionbyzero + 0#1\XINT_frac_Gneg + 0-{\XINT_frac_Gpos #1}% \krof }% -\def\XINT_frac_Gdivisionbyzero #1\Z #2#3% +\edef\XINT_frac_Gdivisionbyzero #1\Z #2#3% {% - \xintError:DivisionByZero\space {0}{#2}{0}% + \noexpand\xintError:DivisionByZero\space {0}{#2}{0}% }% \def\XINT_frac_Gneg #1\Z #2#3% {% @@ -426,7 +426,7 @@ }% \def\XINT_rawz #1% {% - \ifcase\XINT_Sgn {#1} + \ifcase\XINT__Sgn #1\Z \expandafter\XINT_rawz_Ba \or \expandafter\XINT_rawz_A @@ -452,7 +452,7 @@ }% \def\XINT_numer #1% {% - \ifcase\XINT_Sgn {#1} + \ifcase\XINT__Sgn #1\Z \expandafter\XINT_numer_B \or \expandafter\XINT_numer_A @@ -470,7 +470,7 @@ }% \def\XINT_denom #1% {% - \ifcase\XINT_Sgn {#1} + \ifcase\XINT__Sgn #1\Z \expandafter\XINT_denom_B \or \expandafter\XINT_denom_A @@ -492,23 +492,21 @@ {% \xint_gob_til_zero #1\XINT_fracfrac_C 0\XINT_fracfrac_D {10^{#1#2}}% }% -\def\XINT_fracfrac_C #1#2#3#4#5% +\def\XINT_fracfrac_C 0\XINT_fracfrac_D #1#2#3% {% - \ifcase\XINT_isOne {#5} - \or \xint_afterfi {\expandafter\xint_firstoftwo_andstop\xint_gobble_ii }% + \if1\XINT_isOne {#3}% + \xint_afterfi {\expandafter\xint_firstoftwo_afterstop\xint_gobble_ii }% \fi \space - \frac {#4}{#5}% + \frac {#2}{#3}% }% \def\XINT_fracfrac_D #1#2#3% {% - \ifcase\XINT_isOne {#3} - \or \XINT_fracfrac_E - \fi + \if1\XINT_isOne {#3}\XINT_fracfrac_E\fi \space \frac {#2}{#3}#1% }% -\def\XINT_fracfrac_E \fi #1#2#3#4{\fi \space #3\cdot }% +\def\XINT_fracfrac_E \fi\space\frac #1#2{\fi \space #1\cdot }% \def\xintSignedFrac {\romannumeral0\xintsignedfrac }% \def\xintsignedfrac #1% {% @@ -521,8 +519,8 @@ \def\XINT_sgnfrac_b #1% {% \xint_UDsignfork - #1\dummy \XINT_sgnfrac_N - -\dummy {\XINT_sgnfrac_P #1}% + #1\XINT_sgnfrac_N + -{\XINT_sgnfrac_P #1}% \krof }% \def\XINT_sgnfrac_P #1\Z #2% @@ -531,7 +529,7 @@ }% \def\XINT_sgnfrac_N {% - \expandafter\xint_minus_andstop\romannumeral0\XINT_sgnfrac_P + \expandafter\xint_minus_afterstop\romannumeral0\XINT_sgnfrac_P }% \def\xintFwOver {\romannumeral0\xintfwover }% \def\xintfwover #1% @@ -546,18 +544,14 @@ \catcode`^=11 \def\XINT_fwover_C #1#2#3#4#5% {% - \ifcase\XINT_isOne {#5} - \xint_afterfi { {#4\over #5}}% - \or - \xint_afterfi { #4}% + \if0\XINT_isOne {#5}\xint_afterfi { {#4\over #5}}% + \else\xint_afterfi { #4}% \fi }% \def\XINT_fwover_D #1#2#3% {% - \ifcase\XINT_isOne {#3} - \xint_afterfi { {#2\over #3}}% - \or - \xint_afterfi { #2\cdot }% + \if0\XINT_isOne {#3}\xint_afterfi { {#2\over #3}}% + \else\xint_afterfi { #2\cdot }% \fi #1% }% @@ -573,8 +567,8 @@ \def\XINT_sgnfwover_b #1% {% \xint_UDsignfork - #1\dummy \XINT_sgnfwover_N - -\dummy {\XINT_sgnfwover_P #1}% + #1\XINT_sgnfwover_N + -{\XINT_sgnfwover_P #1}% \krof }% \def\XINT_sgnfwover_P #1\Z #2% @@ -583,7 +577,7 @@ }% \def\XINT_sgnfwover_N {% - \expandafter\xint_minus_andstop\romannumeral0\XINT_sgnfwover_P + \expandafter\xint_minus_afterstop\romannumeral0\XINT_sgnfwover_P }% \def\xintREZ {\romannumeral0\xintrez }% \def\xintrez @@ -597,13 +591,13 @@ \def\XINT_rez_AB #1% {% \xint_UDzerominusfork - #1-\dummy \XINT_rez_zero - 0#1\dummy \XINT_rez_neg - 0-\dummy {\XINT_rez_B #1}% + #1-\XINT_rez_zero + 0#1\XINT_rez_neg + 0-{\XINT_rez_B #1}% \krof }% \def\XINT_rez_zero #1\Z #2#3{ 0/1[0]}% -\def\XINT_rez_neg {\expandafter\xint_minus_andstop\romannumeral0\XINT_rez_B }% +\def\XINT_rez_neg {\expandafter\xint_minus_afterstop\romannumeral0\XINT_rez_B }% \def\XINT_rez_B #1\Z {% \expandafter\XINT_rez_C\romannumeral0\XINT_factortens {#1}% @@ -627,6 +621,7 @@ {% \expandafter\XINT_e_end\expandafter{\the\numexpr #1+#4}{#2}{#3}% }% +\def\XINT_e_end #1#2#3{ #2/#3[#1]}% \def\xintfE {\romannumeral0\xintfe }% \def\xintfe #1% {% @@ -636,8 +631,51 @@ {% \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\xintFloatE {\romannumeral0\xintfloate }% +\def\xintfloate #1{\XINT_floate_chkopt #1\Z }% +\def\XINT_floate_chkopt #1% +{% + \ifx [#1\expandafter\XINT_floate_opt + \else\expandafter\XINT_floate_noopt + \fi #1% +}% +\def\XINT_floate_noopt #1\Z +{% + \expandafter\XINT_floate_a\expandafter\XINTdigits + \romannumeral0\XINT_infrac {#1}% +}% +\def\XINT_floate_opt [\Z #1]#2% +{% + \expandafter\XINT_floate_a\expandafter + {\the\numexpr #1\expandafter}\romannumeral0\XINT_infrac {#2}% +}% +\def\XINT_floate_a #1#2#3#4#5% +{% + \expandafter\expandafter\expandafter\XINT_float_a + \expandafter\xint_exchangetwo_keepbraces\expandafter + {\the\numexpr #2+#5}{#1}{#3}{#4}\XINT_float_Q +}% +\def\XINTinFloatfE {\romannumeral0\XINT_inFloatfE }% +\def\XINT_inFloatfE [#1]#2% +{% + \expandafter\XINT_infloatfe_a\expandafter + {\the\numexpr #1\expandafter}\romannumeral0\XINT_infrac {#2}% +}% +\def\XINT_infloatfe_a #1#2#3#4#5% +{% + \expandafter\expandafter\expandafter\XINT_infloat_a + \expandafter\xint_exchangetwo_keepbraces\expandafter + {\the\numexpr #2+\xintNum{#5}}{#1}{#3}{#4}\XINT_infloat_Q +}% +\def\xintiE {\romannumeral0\xintie }% for \xintiiexpr only +\def\xintie #1% +{% + \expandafter\XINT_ie \romannumeral0\XINT_infrac {#1}% allows 3.123e3 +}% +\def\XINT_ie #1#2#3#4% assumes #3=1 and uses \xint_dsh with its \numexpr +{% + \xint_dsh {#2}{0-(#1+#4)}% could have \xintNum{#4} for a bit more general +}% \def\xintIrr {\romannumeral0\xintirr }% \def\xintirr #1% {% @@ -645,27 +683,27 @@ }% \def\XINT_irr_start #1#2/#3\Z {% - \ifcase\XINT_isOne {#3} + \if0\XINT_isOne {#3}% \xint_afterfi {\xint_UDsignfork - #1\dummy \XINT_irr_negative - -\dummy {\XINT_irr_nonneg #1}% + #1\XINT_irr_negative + -{\XINT_irr_nonneg #1}% \krof}% - \or + \else \xint_afterfi{\XINT_irr_denomisone #1}% \fi #2\Z {#3}% }% \def\XINT_irr_denomisone #1\Z #2{ #1/1}% changed in 1.08 -\def\XINT_irr_negative #1\Z #2{\XINT_irr_D #1\Z #2\Z \xint_minus_andstop}% +\def\XINT_irr_negative #1\Z #2{\XINT_irr_D #1\Z #2\Z \xint_minus_afterstop}% \def\XINT_irr_nonneg #1\Z #2{\XINT_irr_D #1\Z #2\Z \space}% \def\XINT_irr_D #1#2\Z #3#4\Z {% \xint_UDzerosfork - #3#1\dummy \XINT_irr_indeterminate - #30\dummy \XINT_irr_divisionbyzero - #10\dummy \XINT_irr_zero - 00\dummy \XINT_irr_loop_a + #3#1\XINT_irr_indeterminate + #30\XINT_irr_divisionbyzero + #10\XINT_irr_zero + 00\XINT_irr_loop_a \krof {#3#4}{#1#2}{#3#4}{#1#2}% }% @@ -698,20 +736,19 @@ \def\XINT_irr_finish #1#2#3{#3#1/#2}% changed in 1.08 \def\xintNum {\romannumeral0\xintnum }% \def\xintnum #1{\expandafter\XINT_intcheck\romannumeral0\xintirr {#1}\Z }% -\def\XINT_intcheck #1/#2\Z +\edef\XINT_intcheck #1/#2\Z {% - \ifcase\XINT_isOne {#2} - \xintError:NotAnInteger - \fi\space #1% + \noexpand\if 0\noexpand\XINT_isOne {#2}\noexpand\xintError:NotAnInteger + \noexpand\fi\space #1% }% \def\xintifInt {\romannumeral0\xintifint }% \def\xintifint #1{\expandafter\XINT_ifint\romannumeral0\xintirr {#1}\Z }% \def\XINT_ifint #1/#2\Z {% \if\XINT_isOne {#2}1% - \xint_afterfi{\expandafter\space\xint_firstoftwo}% + \expandafter\xint_firstoftwo_afterstop \else - \xint_afterfi{\expandafter\space\xint_secondoftwo}% + \expandafter\xint_secondoftwo_afterstop \fi }% \def\xintJrr {\romannumeral0\xintjrr }% @@ -721,27 +758,26 @@ }% \def\XINT_jrr_start #1#2/#3\Z {% - \ifcase\XINT_isOne {#3} - \xint_afterfi + \if0\XINT_isOne {#3}\xint_afterfi {\xint_UDsignfork - #1\dummy \XINT_jrr_negative - -\dummy {\XINT_jrr_nonneg #1}% + #1\XINT_jrr_negative + -{\XINT_jrr_nonneg #1}% \krof}% - \or + \else \xint_afterfi{\XINT_jrr_denomisone #1}% \fi #2\Z {#3}% }% \def\XINT_jrr_denomisone #1\Z #2{ #1/1}% changed in 1.08 -\def\XINT_jrr_negative #1\Z #2{\XINT_jrr_D #1\Z #2\Z \xint_minus_andstop }% +\def\XINT_jrr_negative #1\Z #2{\XINT_jrr_D #1\Z #2\Z \xint_minus_afterstop }% \def\XINT_jrr_nonneg #1\Z #2{\XINT_jrr_D #1\Z #2\Z \space}% \def\XINT_jrr_D #1#2\Z #3#4\Z {% \xint_UDzerosfork - #3#1\dummy \XINT_jrr_indeterminate - #30\dummy \XINT_jrr_divisionbyzero - #10\dummy \XINT_jrr_zero - 00\dummy \XINT_jrr_loop_a + #3#1\XINT_jrr_indeterminate + #30\XINT_jrr_divisionbyzero + #10\XINT_jrr_zero + 00\XINT_jrr_loop_a \krof {#3#4}{#1#2}1001% }% @@ -776,6 +812,30 @@ {% \XINT_irr_finish {#3}{#4}% }% +\def\xintTFrac {\romannumeral0\xinttfrac }% +\def\xinttfrac #1% + {\expandafter\XINT_tfrac_fork\romannumeral0\xintrawwithzeros {#1}\Z }% +\def\XINT_tfrac_fork #1% +{% + \xint_UDzerominusfork + #1-\XINT_tfrac_zero + 0#1\XINT_tfrac_N + 0-{\XINT_tfrac_P #1}% + \krof +}% +\def\XINT_tfrac_zero #1\Z { 0/1[0]}% +\def\XINT_tfrac_N {\expandafter\XINT_opp\romannumeral0\XINT_tfrac_P }% +\def\XINT_tfrac_P #1/#2\Z +{% + \expandafter\XINT_rez_AB\romannumeral0\xintiirem{#1}{#2}\Z {0}{#2}% +}% +\def\XINTinFloatFrac {\romannumeral0\XINT_inFloatFrac }% +\def\XINT_inFloatFrac [#1]#2% +{% + \expandafter\XINT_infloatfrac_a\expandafter + {\romannumeral0\xinttfrac{#2}}{#1}% +}% +\def\XINT_infloatfrac_a #1#2{\XINT_inFloat [#2]{#1}}% \def\xintTrunc {\romannumeral0\xinttrunc }% \def\xintiTrunc {\romannumeral0\xintitrunc }% \def\xinttrunc #1% @@ -810,7 +870,7 @@ \def\XINT_trunc_iszero #1#2#3#4#5{ 0\Z 0}% \def\XINT_trunc_B #1% {% - \ifcase\XINT_Sgn {#1} + \ifcase\XINT__Sgn #1\Z \expandafter\XINT_trunc_D \or \expandafter\XINT_trunc_D @@ -833,16 +893,16 @@ \def\XINT_trunc_E #1#2\Z #3#4\Z {% \xint_UDsignsfork - #1#3\dummy \XINT_trunc_minusminus - #1-\dummy {\XINT_trunc_minusplus #3}% - #3-\dummy {\XINT_trunc_plusminus #1}% - --\dummy {\XINT_trunc_plusplus #3#1}% + #1#3\XINT_trunc_minusminus + #1-{\XINT_trunc_minusplus #3}% + #3-{\XINT_trunc_plusminus #1}% + --{\XINT_trunc_plusplus #3#1}% \krof {#4}{#2}% }% \def\XINT_trunc_minusminus #1#2{\xintiiquo {#1}{#2}\Z \space}% -\def\XINT_trunc_minusplus #1#2#3{\xintiiquo {#1#2}{#3}\Z \xint_minus_andstop}% -\def\XINT_trunc_plusminus #1#2#3{\xintiiquo {#2}{#1#3}\Z \xint_minus_andstop}% +\def\XINT_trunc_minusplus #1#2#3{\xintiiquo {#1#2}{#3}\Z \xint_minus_afterstop}% +\def\XINT_trunc_plusminus #1#2#3{\xintiiquo {#2}{#1#3}\Z \xint_minus_afterstop}% \def\XINT_trunc_plusplus #1#2#3#4{\xintiiquo {#1#3}{#2#4}\Z \space}% \def\XINT_itrunc_G #1#2\Z #3#4% {% @@ -944,12 +1004,11 @@ \def\XINT_round:_a {\XINT_round:_b {}}% \def\XINT_round:_b #1#2,% {\expandafter\XINT_round:_c\romannumeral-`0#2,{#1}}% -\def\XINT_round:_c #1{\if #1,\expandafter\XINT_round:_f +\def\XINT_round:_c #1{\if #1,\expandafter\XINT_:_f \else\expandafter\XINT_round:_d\fi #1}% \def\XINT_round:_d #1,% {\expandafter\XINT_round:_e\romannumeral0\xintiround 0{#1},}% \def\XINT_round:_e #1,#2{\XINT_round:_b {#2,#1}}% -\def\XINT_round:_f ,#1#2^{\xint_gobble_i #1}% \mathchardef\XINTdigits 16 \def\xintDigits #1#2% {\afterassignment \xint_gobble_i \mathchardef\XINTdigits=}% @@ -980,13 +1039,13 @@ \def\XINT_float_fork #1% {% \xint_UDzerominusfork - #1-\dummy \XINT_float_zero - 0#1\dummy \XINT_float_J - 0-\dummy {\XINT_float_K #1}% + #1-\XINT_float_zero + 0#1\XINT_float_J + 0-{\XINT_float_K #1}% \krof }% \def\XINT_float_zero #1\Z #2#3#4#5{ 0.e0}% -\def\XINT_float_J {\expandafter\xint_minus_andstop\romannumeral0\XINT_float_K }% +\def\XINT_float_J {\expandafter\xint_minus_afterstop\romannumeral0\XINT_float_K }% \def\XINT_float_K #1\Z #2% #1=A, #2=P, #3=n, #4=B {% \expandafter\XINT_float_L\expandafter @@ -1131,12 +1190,11 @@ \def\XINT_float:_a {\XINT_float:_b {}}% \def\XINT_float:_b #1#2,% {\expandafter\XINT_float:_c\romannumeral-`0#2,{#1}}% -\def\XINT_float:_c #1{\if #1,\expandafter\XINT_float:_f +\def\XINT_float:_c #1{\if #1,\expandafter\XINT_:_f \else\expandafter\XINT_float:_d\fi #1}% \def\XINT_float:_d #1,% {\expandafter\XINT_float:_e\romannumeral0\xintfloat {#1},}% \def\XINT_float:_e #1,#2{\XINT_float:_b {#2,#1}}% -\def\XINT_float:_f ,#1#2^{\xint_gobble_i #1}% \def\XINTinFloat {\romannumeral0\XINT_inFloat }% \def\XINT_inFloat [#1]#2% {% @@ -1151,12 +1209,12 @@ \def\XINT_infloat_fork #1% {% \xint_UDzerominusfork - #1-\dummy \XINT_infloat_zero - 0#1\dummy \XINT_infloat_J - 0-\dummy {\XINT_float_K #1}% + #1-\XINT_infloat_zero + 0#1\XINT_infloat_J + 0-{\XINT_float_K #1}% \krof }% -\def\XINT_infloat_zero #1\Z #2#3#4#5{ 0[0]}% +\def\XINT_infloat_zero #1\Z #2#3#4#5{ 0/1[0]}% \def\XINT_infloat_J {\expandafter-\romannumeral0\XINT_float_K }% \def\XINT_infloat_Q #1% {% @@ -1309,11 +1367,10 @@ \def\xintSum:csv #1{\expandafter\XINT_sum:_a\romannumeral-`0#1,,^}% \def\XINT_sum:_a {\XINT_sum:_b {0/1[0]}}% \def\XINT_sum:_b #1#2,{\expandafter\XINT_sum:_c\romannumeral-`0#2,{#1}}% -\def\XINT_sum:_c #1{\if #1,\expandafter\XINT_sum:_e +\def\XINT_sum:_c #1{\if #1,\expandafter\XINT_:_e \else\expandafter\XINT_sum:_d\fi #1}% \def\XINT_sum:_d #1,#2{\expandafter\XINT_sum:_b\expandafter {\romannumeral0\xintadd {#2}{#1}}}% -\def\XINT_sum:_e ,#1#2^{#1}% allows empty list \def\xintMul {\romannumeral0\xintmul }% \def\xintmul #1% {% @@ -1351,16 +1408,13 @@ \def\XINT_fpow_fork #1#2\Z {% \xint_UDzerominusfork - #1-\dummy \XINT_fpow_zero - 0#1\dummy \XINT_fpow_neg - 0-\dummy {\XINT_fpow_pos #1}% + #1-\XINT_fpow_zero + 0#1\XINT_fpow_neg + 0-{\XINT_fpow_pos #1}% \krof {#2}% }% -\def\XINT_fpow_zero #1#2#3#4% -{% - \space 1/1[0]% -}% +\def\XINT_fpow_zero #1#2#3#4{ 1/1[0]}% \def\XINT_fpow_pos #1#2#3#4#5% {% \expandafter\XINT_fpow_pos_A\expandafter @@ -1407,11 +1461,10 @@ \def\xintPrd:csv #1{\expandafter\XINT_prd:_a\romannumeral-`0#1,,^}% \def\XINT_prd:_a {\XINT_prd:_b {1/1[0]}}% \def\XINT_prd:_b #1#2,{\expandafter\XINT_prd:_c\romannumeral-`0#2,{#1}}% -\def\XINT_prd:_c #1{\if #1,\expandafter\XINT_prd:_e +\def\XINT_prd:_c #1{\if #1,\expandafter\XINT_:_e \else\expandafter\XINT_prd:_d\fi #1}% \def\XINT_prd:_d #1,#2{\expandafter\XINT_prd:_b\expandafter {\romannumeral0\xintmul {#2}{#1}}}% -\def\XINT_prd:_e ,#1#2^{#1}% allows empty list \def\xintDiv {\romannumeral0\xintdiv }% \def\xintdiv #1% {% @@ -1434,8 +1487,9 @@ \def\XINT_fdiv_C #1#2{\XINT_outfrac {#2}{#1}}% \def\xintIsOne {\romannumeral0\xintisone }% \def\xintisone #1{\expandafter\XINT_fracisone - \romannumeral0\xintrawwithzeros{#1}\Z }% -\def\XINT_fracisone #1/#2\Z{\xintsgnfork{\XINT_Cmp {#1}{#2}}{0}{1}{0}}% + \romannumeral0\xintrawwithzeros{#1}\Z }% +\def\XINT_fracisone #1/#2\Z + {\if0\XINT_Cmp {#1}{#2}\xint_afterfi{ 1}\else\xint_afterfi{ 0}\fi}% \def\xintGeq {\romannumeral0\xintgeq }% \def\xintgeq #1% {% @@ -1467,15 +1521,15 @@ }% \def\XINT_fgeq_D #1#2#3% {% - \xintSgnFork - {\xintiiSgn{\the\numexpr #2+\xintLength{#3}-\xintLength{#1}\relax}}% + \expandafter\XINT__SgnFork\romannumeral-`0\expandafter\XINT__Sgn + \the\numexpr #2+\xintLength{#3}-\xintLength{#1}\relax\Z { 0}{\XINT_fgeq_E #2\Z {#3}{#1}}{ 1}% }% \def\XINT_fgeq_E #1% {% \xint_UDsignfork - #1\dummy \XINT_fgeq_Fd - -\dummy {\XINT_fgeq_Fn #1}% + #1\XINT_fgeq_Fd + -{\XINT_fgeq_Fn #1}% \krof }% \def\XINT_fgeq_Fd #1\Z #2#3% @@ -1501,15 +1555,15 @@ \def\XINT_fmax_A #1#2/#3[#4]#5#6/#7[#8]% {% \xint_UDsignsfork - #1#5\dummy \XINT_fmax_minusminus - -#5\dummy \XINT_fmax_firstneg - #1-\dummy \XINT_fmax_secondneg - --\dummy \XINT_fmax_nonneg_a + #1#5\XINT_fmax_minusminus + -#5\XINT_fmax_firstneg + #1-\XINT_fmax_secondneg + --\XINT_fmax_nonneg_a \krof #1#5{#2/#3[#4]}{#6/#7[#8]}% }% \def\XINT_fmax_minusminus --% - {\expandafter\xint_minus_andstop\romannumeral0\XINT_fmin_nonneg_b }% + {\expandafter\xint_minus_afterstop\romannumeral0\XINT_fmin_nonneg_b }% \def\XINT_fmax_firstneg #1-#2#3{ #1#2}% \def\XINT_fmax_secondneg -#1#2#3{ #1#3}% \def\XINT_fmax_nonneg_a #1#2#3#4% @@ -1518,9 +1572,9 @@ }% \def\XINT_fmax_nonneg_b #1#2% {% - \ifcase\romannumeral0\XINT_fgeq_A #1#2 - \xint_afterfi{ #1}% - \or \xint_afterfi{ #2}% + \if0\romannumeral0\XINT_fgeq_A #1#2% + \xint_afterfi{ #1}% + \else \xint_afterfi{ #2}% \fi }% \def\xintMaxof {\romannumeral0\xintmaxof }% @@ -1535,10 +1589,9 @@ \def\XINT_maxof_e #1\Z #2\Z { #2}% \def\xintMaxof:csv #1{\expandafter\XINT_maxof:_b\romannumeral-`0#1,,}% \def\XINT_maxof:_b #1,#2,{\expandafter\XINT_maxof:_c\romannumeral-`0#2,{#1},}% -\def\XINT_maxof:_c #1{\if #1,\expandafter\XINT_maxof:_e +\def\XINT_maxof:_c #1{\if #1,\expandafter\XINT_of:_e \else\expandafter\XINT_maxof:_d\fi #1}% \def\XINT_maxof:_d #1,{\expandafter\XINT_maxof:_b\romannumeral0\xintmax {#1}}% -\def\XINT_maxof:_e ,#1,{#1}% \def\XINTinFloatMaxof {\romannumeral0\XINTinfloatmaxof }% \def\XINTinfloatmaxof #1{\expandafter\XINT_flmaxof_a\romannumeral-`0#1\relax }% \def\XINT_flmaxof_a #1{\expandafter\XINT_flmaxof_b @@ -1556,12 +1609,11 @@ \romannumeral0\XINT_inFloat [\XINTdigits]{#1},}% \def\XINT_flmaxof:_b #1,#2,% {\expandafter\XINT_flmaxof:_c\romannumeral-`0#2,{#1},}% -\def\XINT_flmaxof:_c #1{\if #1,\expandafter\XINT_flmaxof:_e +\def\XINT_flmaxof:_c #1{\if #1,\expandafter\XINT_of:_e \else\expandafter\XINT_flmaxof:_d\fi #1}% \def\XINT_flmaxof:_d #1,% {\expandafter\XINT_flmaxof:_b\romannumeral0\xintmax {\XINTinFloat [\XINTdigits]{#1}}}% -\def\XINT_flmaxof:_e ,#1,{#1}% \def\xintMin {\romannumeral0\xintmin }% \def\xintmin #1% {% @@ -1574,15 +1626,15 @@ \def\XINT_fmin_A #1#2/#3[#4]#5#6/#7[#8]% {% \xint_UDsignsfork - #1#5\dummy \XINT_fmin_minusminus - -#5\dummy \XINT_fmin_firstneg - #1-\dummy \XINT_fmin_secondneg - --\dummy \XINT_fmin_nonneg_a + #1#5\XINT_fmin_minusminus + -#5\XINT_fmin_firstneg + #1-\XINT_fmin_secondneg + --\XINT_fmin_nonneg_a \krof #1#5{#2/#3[#4]}{#6/#7[#8]}% }% \def\XINT_fmin_minusminus --% - {\expandafter\xint_minus_andstop\romannumeral0\XINT_fmax_nonneg_b }% + {\expandafter\xint_minus_afterstop\romannumeral0\XINT_fmax_nonneg_b }% \def\XINT_fmin_firstneg #1-#2#3{ -#3}% \def\XINT_fmin_secondneg -#1#2#3{ -#2}% \def\XINT_fmin_nonneg_a #1#2#3#4% @@ -1591,9 +1643,9 @@ }% \def\XINT_fmin_nonneg_b #1#2% {% - \ifcase\romannumeral0\XINT_fgeq_A #1#2 - \xint_afterfi{ #2}% - \or \xint_afterfi{ #1}% + \if0\romannumeral0\XINT_fgeq_A #1#2% + \xint_afterfi{ #2}% + \else \xint_afterfi{ #1}% \fi }% \def\xintMinof {\romannumeral0\xintminof }% @@ -1608,10 +1660,9 @@ \def\XINT_minof_e #1\Z #2\Z { #2}% \def\xintMinof:csv #1{\expandafter\XINT_minof:_b\romannumeral-`0#1,,}% \def\XINT_minof:_b #1,#2,{\expandafter\XINT_minof:_c\romannumeral-`0#2,{#1},}% -\def\XINT_minof:_c #1{\if #1,\expandafter\XINT_minof:_e +\def\XINT_minof:_c #1{\if #1,\expandafter\XINT_of:_e \else\expandafter\XINT_minof:_d\fi #1}% \def\XINT_minof:_d #1,{\expandafter\XINT_minof:_b\romannumeral0\xintmin {#1}}% -\def\XINT_minof:_e ,#1,{#1}% \def\XINTinFloatMinof {\romannumeral0\XINTinfloatminof }% \def\XINTinfloatminof #1{\expandafter\XINT_flminof_a\romannumeral-`0#1\relax }% \def\XINT_flminof_a #1{\expandafter\XINT_flminof_b @@ -1629,12 +1680,11 @@ \romannumeral0\XINT_inFloat [\XINTdigits]{#1},}% \def\XINT_flminof:_b #1,#2,% {\expandafter\XINT_flminof:_c\romannumeral-`0#2,{#1},}% -\def\XINT_flminof:_c #1{\if #1,\expandafter\XINT_flminof:_e +\def\XINT_flminof:_c #1{\if #1,\expandafter\XINT_of:_e \else\expandafter\XINT_flminof:_d\fi #1}% \def\XINT_flminof:_d #1,% {\expandafter\XINT_flminof:_b\romannumeral0\xintmin {\XINTinFloat [\XINTdigits]{#1}}}% -\def\XINT_flminof:_e ,#1,{#1}% \def\xintCmp {\romannumeral0\xintcmp }% \def\xintcmp #1% {% @@ -1647,10 +1697,10 @@ \def\XINT_fcmp_A #1#2/#3[#4]#5#6/#7[#8]% {% \xint_UDsignsfork - #1#5\dummy \XINT_fcmp_minusminus - -#5\dummy \XINT_fcmp_firstneg - #1-\dummy \XINT_fcmp_secondneg - --\dummy \XINT_fcmp_nonneg_a + #1#5\XINT_fcmp_minusminus + -#5\XINT_fcmp_firstneg + #1-\XINT_fcmp_secondneg + --\XINT_fcmp_nonneg_a \krof #1#5{#2/#3[#4]}{#6/#7[#8]}% }% @@ -1660,10 +1710,10 @@ \def\XINT_fcmp_nonneg_a #1#2% {% \xint_UDzerosfork - #1#2\dummy \XINT_fcmp_zerozero - 0#2\dummy \XINT_fcmp_firstzero - #10\dummy \XINT_fcmp_secondzero - 00\dummy \XINT_fcmp_pos + #1#2\XINT_fcmp_zerozero + 0#2\XINT_fcmp_firstzero + #10\XINT_fcmp_secondzero + 00\XINT_fcmp_pos \krof #1#2% }% @@ -1688,15 +1738,15 @@ }% \def\XINT_fcmp_D #1#2#3% {% - \xintSgnFork - {\xintiiSgn{\the\numexpr #2+\xintLength{#3}-\xintLength{#1}\relax}}% + \expandafter\XINT__SgnFork\romannumeral-`0\expandafter\XINT__Sgn + \the\numexpr #2+\xintLength{#3}-\xintLength{#1}\relax\Z { -1}{\XINT_fcmp_E #2\Z {#3}{#1}}{ 1}% }% \def\XINT_fcmp_E #1% {% \xint_UDsignfork - #1\dummy \XINT_fcmp_Fd - -\dummy {\XINT_fcmp_Fn #1}% + #1\XINT_fcmp_Fd + -{\XINT_fcmp_Fn #1}% \krof }% \def\XINT_fcmp_Fd #1\Z #2#3% @@ -1710,34 +1760,12 @@ \expandafter\XINT_cmp_pre\expandafter {\romannumeral0\XINT_dsx_addzerosnofuss {#1}{#2}}{#3}% }% -\def\xintAbs {\romannumeral0\xintabs }% -\def\xintabs #1% -{% - \expandafter\xint_fabs\romannumeral0\XINT_infrac {#1}% -}% -\def\xint_fabs #1#2% -{% - \expandafter\XINT_outfrac\expandafter - {\the\numexpr #1\expandafter}\expandafter - {\romannumeral0\XINT_abs #2}% -}% -\def\xintOpp {\romannumeral0\xintopp }% -\def\xintopp #1% -{% - \expandafter\xint_fopp\romannumeral0\XINT_infrac {#1}% -}% -\def\xint_fopp #1#2% -{% - \expandafter\XINT_outfrac\expandafter - {\the\numexpr #1\expandafter}\expandafter - {\romannumeral0\XINT_opp #2}% -}% -\def\xintSgn {\romannumeral0\xintsgn }% -\def\xintsgn #1% -{% - \expandafter\xint_fsgn\romannumeral0\XINT_infrac {#1}% -}% -\def\xint_fsgn #1#2#3{\xintiisgn {#2}}% +\def\xintAbs {\romannumeral0\xintabs }% +\def\xintabs #1{\expandafter\XINT_abs\romannumeral0\xintraw {#1}}% +\def\xintOpp {\romannumeral0\xintopp }% +\def\xintopp #1{\expandafter\XINT_opp\romannumeral0\xintraw {#1}}% +\def\xintSgn {\romannumeral0\xintsgn }% +\def\xintsgn #1{\expandafter\XINT_sgn\romannumeral0\xintraw {#1}\Z }% \def\xintFloatAdd {\romannumeral0\xintfloatadd }% \def\xintfloatadd #1{\XINT_fladd_chkopt \xintfloat #1\Z }% \def\XINTinFloatAdd {\romannumeral0\XINTinfloatadd }% @@ -1871,14 +1899,13 @@ {\expandafter\XINT_floatsum_b\romannumeral0\XINTinfloatadd {#1}}% \def\XINT_floatsum_e #1\Z #2\Z { #2}% \def\XINTinFloatSum:csv #1{\expandafter\XINT_floatsum:_a\romannumeral-`0#1,,^}% -\def\XINT_floatsum:_a {\XINT_floatsum:_b {0[0]}}% was 0/1[0] prior to 1.09h +\def\XINT_floatsum:_a {\XINT_floatsum:_b {0/1[0]}}% \def\XINT_floatsum:_b #1#2,% {\expandafter\XINT_floatsum:_c\romannumeral-`0#2,{#1}}% -\def\XINT_floatsum:_c #1{\if #1,\expandafter\XINT_floatsum:_e +\def\XINT_floatsum:_c #1{\if #1,\expandafter\XINT_:_e \else\expandafter\XINT_floatsum:_d\fi #1}% \def\XINT_floatsum:_d #1,#2{\expandafter\XINT_floatsum:_b\expandafter {\romannumeral0\XINTinfloatadd {#2}{#1}}}% -\def\XINT_floatsum:_e ,#1#2^{#1}% allows empty list \def\XINTinFloatPrd {\romannumeral0\XINTinfloatprd }% \def\XINTinfloatprd #1{\expandafter\XINT_floatprd_a\romannumeral-`0#1\relax }% \def\XINT_floatprd_a #1{\expandafter\XINT_floatprd_b @@ -1891,14 +1918,13 @@ {\expandafter\XINT_floatprd_b\romannumeral0\XINTinfloatmul {#1}}% \def\XINT_floatprd_e #1\Z #2\Z { #2}% \def\XINTinFloatPred:csv #1{\expandafter\XINT_floatprd:_a\romannumeral-`0#1,,^}% -\def\XINT_floatprd:_a {\XINT_floatprd:_b {1[0]}}% was 1/1[0] prior to 1.09h +\def\XINT_floatprd:_a {\XINT_floatprd:_b {1/1[0]}}% \def\XINT_floatprd:_b #1#2,% {\expandafter\XINT_floatprd:_c\romannumeral-`0#2,{#1}}% -\def\XINT_floatprd:_c #1{\if #1,\expandafter\XINT_floatprd:_e +\def\XINT_floatprd:_c #1{\if #1,\expandafter\XINT_:_e \else\expandafter\XINT_floatprd:_d\fi #1}% \def\XINT_floatprd:_d #1,#2{\expandafter\XINT_floatprd:_b\expandafter {\romannumeral0\XINTinfloatmul {#2}{#1}}}% -\def\XINT_floatprd:_e ,#1#2^{#1}% allows empty list \def\xintFloatPow {\romannumeral0\xintfloatpow}% \def\xintfloatpow #1{\XINT_flpow_chkopt \xintfloat #1\Z }% \def\XINTinFloatPow {\romannumeral0\XINTinfloatpow }% @@ -1926,9 +1952,9 @@ \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}% + #1-\XINT_flpow_BisZero + 0#1{\XINT_flpow_checkB_b 1}% + 0-{\XINT_flpow_checkB_b 0#1}% \krof }% \def\XINT_flpow_BisZero \Z #1#2#3{#3{1/1[0]}}% @@ -1951,9 +1977,9 @@ \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}% + #1-\XINT_flpow_zero + 0#1{\XINT_flpow_b 1}% + 0-{\XINT_flpow_b 0#1}% \krof }% \def\XINT_flpow_zero [#1]#2#3#4#5% @@ -2027,15 +2053,15 @@ \expandafter\XINT_flpow_conclude_really\expandafter {\the\numexpr\if #41 -\fi#3\expandafter}% \xint_UDzerofork - #4\dummy {{#2}}% - 0\dummy {{1/#2}}% + #4{{#2}}% + 0{{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]}}% + #3{#4{#2[#1]}}% + 0{#4{-#2[#1]}}% \krof }% \def\xintFloatPower {\romannumeral0\xintfloatpower}% @@ -2065,9 +2091,9 @@ \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}% + #1-\XINT_flpower_BisZero + 0#1{\XINT_flpower_checkB_b 1}% + 0-{\XINT_flpower_checkB_b 0#1}% \krof }% \def\XINT_flpower_BisZero \Z #1#2#3{#3{1/1[0]}}% @@ -2090,9 +2116,9 @@ \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}% + #1-\XINT_flpower_zero + 0#1{\XINT_flpower_b 1}% + 0-{\XINT_flpower_b 0#1}% \krof }% \def\XINT_flpower_zero [#1]#2#3#4#5% @@ -2115,11 +2141,12 @@ }% \def\XINT_flpower_loop #1#2#3% {% - \ifcase\XINT_isOne {#2} - \xint_afterfi{\expandafter\XINT_flpower_loop_x\expandafter + \if0\XINT_isOne {#2}\xint_afterfi + {\expandafter\XINT_flpower_loop_x\expandafter {\romannumeral0\XINTinfloatmul [#1]{#3}{#3}}% - {\romannumeral0\xintdivision {#2}{2}}}% - \or \expandafter\XINT_flpow_loop_end + {\romannumeral0\xintdivision {#2}{2}}% + }% + \else\expandafter\XINT_flpow_loop_end \fi {#1}{{#3}}% }% @@ -2171,13 +2198,13 @@ \def\XINT_FL_sqrt_checkifzeroorneg #1% {% \xint_UDzerominusfork - #1-\dummy \XINT_FL_sqrt_iszero - 0#1\dummy \XINT_FL_sqrt_isneg - 0-\dummy {\XINT_FL_sqrt_b #1}% + #1-\XINT_FL_sqrt_iszero + 0#1\XINT_FL_sqrt_isneg + 0-{\XINT_FL_sqrt_b #1}% \krof }% -\def\XINT_FL_sqrt_iszero #1[#2]{0[0]}% -\def\XINT_FL_sqrt_isneg #1[#2]{\xintError:RootOfNegative 0[0]}% +\def\XINT_FL_sqrt_iszero #1[#2]{0/1[0]}% +\def\XINT_FL_sqrt_isneg #1[#2]{\xintError:RootOfNegative 0/1[0]}% \def\XINT_FL_sqrt_b #1[#2]% {% \ifodd #2 @@ -2290,9 +2317,9 @@ }% \def\XINT_flsqrt_big_j #1% {% - \ifcase\XINT_Sgn {#1} + \if0\XINT_Sgn #1\Z \expandafter \XINT_flsqrt_big_end_a - \or \expandafter \XINT_flsqrt_big_k + \else \expandafter \XINT_flsqrt_big_k \fi {#1}% }% \def\XINT_flsqrt_big_k #1#2#3% diff --git a/Master/texmf-dist/tex/generic/xint/xintgcd.sty b/Master/texmf-dist/tex/generic/xint/xintgcd.sty index 6dc7319aea5..e4db522a478 100644 --- a/Master/texmf-dist/tex/generic/xint/xintgcd.sty +++ b/Master/texmf-dist/tex/generic/xint/xintgcd.sty @@ -21,7 +21,7 @@ %% same distribution. (The sources need not necessarily be %% in the same archive or directory.) %%---------------------------------------------------------------- -%% The xint bundle (version 1.09h of November 28, 2013) +%% The xint bundle (version 1.09i of December 18, 2013) %% xintgcd: Euclidean algorithm with xint package %% Copyright (C) 2013 by Jean-Francois Burnol %%---------------------------------------------------------------- @@ -103,7 +103,7 @@ \XINTsetupcatcodes% \XINT_providespackage \ProvidesPackage{xintgcd}% - [2013/11/28 v1.09h Euclide algorithm with xint package (jfB)]% + [2013/12/18 v1.09i Euclide algorithm with xint package (jfB)]% \def\xintGCD {\romannumeral0\xintgcd }% \def\xintgcd #1% {% @@ -116,9 +116,9 @@ \def\XINT_gcd_fork #1#2\Z #3#4\Z {% \xint_UDzerofork - #1\dummy \XINT_gcd_BisZero - #3\dummy \XINT_gcd_AisZero - 0\dummy \XINT_gcd_loop + #1\XINT_gcd_BisZero + #3\XINT_gcd_AisZero + 0\XINT_gcd_loop \krof {#1#2}{#3#4}% }% @@ -146,10 +146,9 @@ \def\XINT_gcdof_e #1\Z #2\Z { #2}% \def\xintGCDof:csv #1{\expandafter\XINT_gcdof:_b\romannumeral-`0#1,,}% \def\XINT_gcdof:_b #1,#2,{\expandafter\XINT_gcdof:_c\romannumeral-`0#2,{#1},}% -\def\XINT_gcdof:_c #1{\if #1,\expandafter\XINT_gcdof:_e +\def\XINT_gcdof:_c #1{\if #1,\expandafter\XINT_of:_e \else\expandafter\XINT_gcdof:_d\fi #1}% \def\XINT_gcdof:_d #1,{\expandafter\XINT_gcdof:_b\romannumeral0\xintgcd {#1}}% -\def\XINT_gcdof:_e ,#1,{#1}% \def\xintLCM {\romannumeral0\xintlcm}% \def\xintlcm #1% {% @@ -162,9 +161,9 @@ \def\XINT_lcm_fork #1#2\Z #3#4\Z {% \xint_UDzerofork - #1\dummy \XINT_lcm_BisZero - #3\dummy \XINT_lcm_AisZero - 0\dummy \expandafter + #1\XINT_lcm_BisZero + #3\XINT_lcm_AisZero + 0\expandafter \krof \XINT_lcm_notzero\expandafter{\romannumeral0\XINT_gcd_loop {#1#2}{#3#4}}% {#1#2}{#3#4}% @@ -181,10 +180,9 @@ \def\XINT_lcmof_e #1\Z #2\Z { #2}% \def\xintLCMof:csv #1{\expandafter\XINT_lcmof:_a\romannumeral-`0#1,,}% \def\XINT_lcmof:_a #1,#2,{\expandafter\XINT_lcmof:_c\romannumeral-`0#2,{#1},}% -\def\XINT_lcmof:_c #1{\if#1,\expandafter\XINT_lcmof:_e +\def\XINT_lcmof:_c #1{\if#1,\expandafter\XINT_of:_e \else\expandafter\XINT_lcmof:_d\fi #1}% \def\XINT_lcmof:_d #1,{\expandafter\XINT_lcmof:_a\romannumeral0\xintlcm {#1}}% -\def\XINT_lcmof:_e ,#1,{#1}% \def\xintBezout {\romannumeral0\xintbezout }% \def\xintbezout #1% {% @@ -197,36 +195,35 @@ \def\XINT_bezout_fork #1#2\Z #3#4\Z {% \xint_UDzerosfork - #1#3\dummy \XINT_bezout_botharezero - #10\dummy \XINT_bezout_secondiszero - #30\dummy \XINT_bezout_firstiszero - 00\dummy - {\xint_UDsignsfork - #1#3\dummy \XINT_bezout_minusminus % A < 0, B < 0 - #1-\dummy \XINT_bezout_minusplus % A > 0, B < 0 - #3-\dummy \XINT_bezout_plusminus % A < 0, B > 0 - --\dummy \XINT_bezout_plusplus % A > 0, B > 0 + #1#3\XINT_bezout_botharezero + #10\XINT_bezout_secondiszero + #30\XINT_bezout_firstiszero + 00{\xint_UDsignsfork + #1#3\XINT_bezout_minusminus % A < 0, B < 0 + #1-\XINT_bezout_minusplus % A > 0, B < 0 + #3-\XINT_bezout_plusminus % A < 0, B > 0 + --\XINT_bezout_plusplus % A > 0, B > 0 \krof }% \krof {#2}{#4}#1#3{#3#4}{#1#2}% #1#2=B, #3#4=A }% -\def\XINT_bezout_botharezero #1#2#3#4#5#6% +\edef\XINT_bezout_botharezero #1#2#3#4#5#6% {% - \xintError:NoBezoutForZeros + \noexpand\xintError:NoBezoutForZeros \space {0}{0}{0}{0}{0}% }% \def\XINT_bezout_firstiszero #1#2#3#4#5#6% {% \xint_UDsignfork - #3\dummy { {0}{#3#1}{0}{1}{#1}}% - -\dummy { {0}{#3#1}{0}{-1}{#1}}% + #3{ {0}{#3#1}{0}{1}{#1}}% + -{ {0}{#3#1}{0}{-1}{#1}}% \krof }% \def\XINT_bezout_secondiszero #1#2#3#4#5#6% {% \xint_UDsignfork - #4\dummy{ {#4#2}{0}{-1}{0}{#2}}% - -\dummy{ {#4#2}{0}{1}{0}{#2}}% + #4{ {#4#2}{0}{-1}{0}{#2}}% + -{ {#4#2}{0}{1}{0}{#2}}% \krof }% \def\XINT_bezout_minusminus #1#2#3#4% @@ -243,7 +240,7 @@ {% \expandafter\XINT_bezout_mm_postc\expandafter {#2}{#1}% }% -\def\XINT_bezout_mm_postc #1#2#3#4#5% +\edef\XINT_bezout_mm_postc #1#2#3#4#5% {% \space {#4}{#5}{#1}{#2}{#3}% }% @@ -257,7 +254,7 @@ \expandafter\XINT_bezout_mp_postb\expandafter {\romannumeral0\xintiiopp {#2}}{#1}% }% -\def\XINT_bezout_mp_postb #1#2#3#4#5% +\edef\XINT_bezout_mp_postb #1#2#3#4#5% {% \space {#4}{#5}{#2}{#1}{#3}% }% @@ -271,7 +268,7 @@ \expandafter \XINT_bezout_pm_postb \expandafter {\romannumeral0\xintiiopp{#1}}% }% -\def\XINT_bezout_pm_postb #1#2#3#4#5% +\edef\XINT_bezout_pm_postb #1#2#3#4#5% {% \space {#4}{#5}{#1}{#2}{#3}% }% @@ -280,7 +277,7 @@ \expandafter\XINT_bezout_pp_post \romannumeral0\XINT_bezout_loop_a 1{#3#1}{#4#2}1001% }% -\def\XINT_bezout_pp_post #1#2#3#4#5% +\edef\XINT_bezout_pp_post #1#2#3#4#5% {% \space {#4}{#5}{#1}{#2}{#3}% }% @@ -322,11 +319,11 @@ \else\expandafter\XINT_bezout_exitodd \fi }% -\def\XINT_bezout_exiteven #1#2#3#4#5% +\edef\XINT_bezout_exiteven #1#2#3#4#5% {% \space {#5}{#4}{#1}% }% -\def\XINT_bezout_exitodd #1#2#3#4#5% +\edef\XINT_bezout_exitodd #1#2#3#4#5% {% \space {-#5}{-#4}{#1}% }% @@ -342,9 +339,9 @@ \def\XINT_euc_fork #1#2\Z #3#4\Z {% \xint_UDzerofork - #1\dummy \XINT_euc_BisZero - #3\dummy \XINT_euc_AisZero - 0\dummy \XINT_euc_a + #1\XINT_euc_BisZero + #3\XINT_euc_AisZero + 0\XINT_euc_a \krof {0}{#1#2}{#3#4}{{#3#4}{#1#2}}{}\Z }% @@ -374,7 +371,7 @@ \xint_bye\xint_bye\xint_bye\xint_bye \xint_relax }% -\def\xint_euc_end_ #1#2#3% +\edef\xint_euc_end_ #1#2#3% {% \space {#1}{#3}{#2}% }% @@ -390,9 +387,9 @@ \def\XINT_bezalg_fork #1#2\Z #3#4\Z {% \xint_UDzerofork - #1\dummy \XINT_bezalg_BisZero - #3\dummy \XINT_bezalg_AisZero - 0\dummy \XINT_bezalg_a + #1\XINT_bezalg_BisZero + #3\XINT_bezalg_AisZero + 0\XINT_bezalg_a \krof 0{#1#2}{#3#4}1001{{#3#4}{#1#2}}{}\Z }% @@ -433,7 +430,7 @@ \xint_bye\xint_bye\xint_bye\xint_bye \xint_relax }% -\def\xint_bezalg_end_ #1#2#3#4% +\edef\xint_bezalg_end_ #1#2#3#4% {% \space {#1}{#3}{0}{1}{#2}{#4}{1}{0}% }% diff --git a/Master/texmf-dist/tex/generic/xint/xintseries.sty b/Master/texmf-dist/tex/generic/xint/xintseries.sty index ce13095a7ae..c38cdaaeb03 100644 --- a/Master/texmf-dist/tex/generic/xint/xintseries.sty +++ b/Master/texmf-dist/tex/generic/xint/xintseries.sty @@ -21,7 +21,7 @@ %% same distribution. (The sources need not necessarily be %% in the same archive or directory.) %%---------------------------------------------------------------- -%% The xint bundle (version 1.09h of November 28, 2013) +%% The xint bundle (version 1.09i of December 18, 2013) %% xintseries: Expandable partial sums with xint package %% Copyright (C) 2013 by Jean-Francois Burnol %%---------------------------------------------------------------- @@ -103,7 +103,7 @@ \XINTsetupcatcodes% \XINT_providespackage \ProvidesPackage{xintseries}% - [2013/11/28 v1.09h Expandable partial sums with xint package (jfB)]% + [2013/12/18 v1.09i Expandable partial sums with xint package (jfB)]% \def\xintSeries {\romannumeral0\xintseries }% \def\xintseries #1#2% {% diff --git a/Master/texmf-dist/tex/generic/xint/xinttools.sty b/Master/texmf-dist/tex/generic/xint/xinttools.sty index 9b0414b32fa..945f73bf1b5 100644 --- a/Master/texmf-dist/tex/generic/xint/xinttools.sty +++ b/Master/texmf-dist/tex/generic/xint/xinttools.sty @@ -21,7 +21,7 @@ %% same distribution. (The sources need not necessarily be %% in the same archive or directory.) %%---------------------------------------------------------------- -%% The xint bundle (version 1.09h of November 28, 2013) +%% The xint bundle (version 1.09i of December 18, 2013) %% xinttools: Expandable and non-expandable utilities %% Copyright (C) 2013 by Jean-Francois Burnol %%---------------------------------------------------------------- @@ -120,7 +120,7 @@ \catcode40=12 % ( \catcode41=12 % ) \catcode47=12 % / - \catcode96=12 % ` + \catcode96=12 % ` (for ubiquitous \romannumeral-`0 and some \catcode ) \catcode94=11 % ^ \catcode36=3 % $ \catcode91=12 % [ @@ -150,7 +150,7 @@ \fi \XINT_providespackage \ProvidesPackage {xinttools}% - [2013/11/28 v1.09h Expandable and non-expandable utilities (jfB)]% + [2013/12/18 v1.09i Expandable and non-expandable utilities (jfB)]% \long\def\xint_gobble_ {}% \long\def\xint_gobble_i #1{}% \long\def\xint_gobble_ii #1#2{}% @@ -164,9 +164,9 @@ \xint_firstofone{\let\XINT_sptoken= } %<- space here! \long\def\xint_firstoftwo #1#2{#1}% \long\def\xint_secondoftwo #1#2{#2}% -\long\def\xint_firstoftwo_andstop #1#2{ #1}% -\long\def\xint_secondoftwo_andstop #1#2{ #2}% -\def\xint_minus_andstop { -}% +\long\def\xint_firstoftwo_afterstop #1#2{ #1}% +\long\def\xint_secondoftwo_afterstop #1#2{ #2}% +\def\xint_minus_afterstop { -}% \long\def\xint_gob_til_R #1\R {}% \long\def\xint_gob_til_W #1\W {}% \long\def\xint_gob_til_Z #1\Z {}% @@ -178,6 +178,18 @@ \chardef\xint_c_ 0 \chardef\xint_c_viii 8 \newtoks\XINT_toks +\def\XINT_odef #1{\expandafter\def\expandafter#1\expandafter }% +\ifdefined\odef\else\let\odef\XINT_odef\fi +\def\XINT_godef {\global\XINT_odef }% +\def\XINT_oodef #1{\expandafter\expandafter\expandafter\def + \expandafter\expandafter\expandafter#1% + \expandafter\expandafter\expandafter }% +\ifdefined\oodef\else\let\oodef\XINT_oodef\fi +\def\XINT_goodef {\global\XINT_oodef }% +\def\XINT_fdef #1#2{\expandafter\def\expandafter#1\expandafter + {\romannumeral-`0#2}}% +\ifdefined\fdef\else\let\fdef\XINT_fdef\fi +\def\XINT_gfdef {\global\XINT_fdef }% \def\xintReverseOrder {\romannumeral0\xintreverseorder }% \long\def\xintreverseorder #1% {% @@ -192,9 +204,9 @@ \xint_bye #9\XINT_rord_cleanup\xint_bye \XINT_rord_main {#9#8#7#6#5#4#3#2#1}% }% -\long\def\XINT_rord_cleanup\xint_bye\XINT_rord_main #1#2\xint_relax +\long\edef\XINT_rord_cleanup\xint_bye\XINT_rord_main #1#2\xint_relax {% - \expandafter\space\xint_gob_til_xint_relax #1% + \noexpand\expandafter\space\noexpand\xint_gob_til_xint_relax #1% }% \def\xintRevWithBraces {\romannumeral0\xintrevwithbraces }% \def\xintRevWithBracesNoExpand {\romannumeral0\xintrevwithbracesnoexpand }% @@ -266,7 +278,8 @@ #7\XINT_length_finish_c 2% \W\XINT_length_finish_c 1\Z }% -\def\XINT_length_finish_c #1#2\Z #3{\expandafter\space\the\numexpr #3-#1\relax}% +\edef\XINT_length_finish_c #1#2\Z #3% + {\noexpand\expandafter\space\noexpand\the\numexpr #3-#1\relax}% \def\xintZapFirstSpaces {\romannumeral0\xintzapfirstspaces }% \long\edef\xintzapfirstspaces #1% {\noexpand\XINT_zapbsp_a \space #1\space\space\noexpand\xint_bye\xint_relax }% @@ -452,9 +465,9 @@ \expandafter\expandafter\expandafter\XINT_nthelt_finish \csname xint_gobble_\romannumeral\numexpr#1-1\endcsname }% -\long\def\XINT_nthelt_finish #1#2\xint_bye - {\xint_gob_til_xint_relax #1\expandafter\space - \xint_gobble_iii\xint_relax\space #1}% +\long\edef\XINT_nthelt_finish #1#2\xint_bye + {\noexpand\xint_gob_til_xint_relax #1\noexpand\expandafter\space + \noexpand\xint_gobble_iii\xint_relax\space #1}% \def\xintApply {\romannumeral0\xintapply }% \def\xintApplyNoExpand {\romannumeral0\xintapplynoexpand }% \long\def\xintapply #1#2% @@ -509,7 +522,7 @@ \def\XINT_seq #1#2% {% \ifcase\ifnum #1=#2 0\else\ifnum #2>#1 1\else -1\fi\fi\space - \expandafter\xint_firstoftwo_andstop + \expandafter\xint_firstoftwo_afterstop \or \expandafter\XINT_seq_p \else @@ -935,27 +948,41 @@ }% \catcode`Z 11 \catcode`j 11 -\long\def\xintAssign #1\to +\def\xintAssign{\def\XINT_flet_macro {\XINT_assign_fork}\XINT_flet_zapsp }% +\def\XINT_assign_fork {% - \expandafter\XINT_assign_a\romannumeral-`0#1{}\to + \let\XINT_assign_def\edef + \ifx\XINT_token[\expandafter\XINT_assign_opt + \else\expandafter\XINT_assign_a + \fi +}% +\def\XINT_assign_opt [#1]% +{% + \expandafter\let\expandafter\XINT_assign_def \csname XINT_#1def\endcsname + \XINT_assign_a +}% +\long\def\XINT_assign_a #1\to +{% + \expandafter\XINT_assign_b\romannumeral-`0#1{}\to }% -\long\def\XINT_assign_a #1% attention to the # at the beginning of next line +\long\def\XINT_assign_b #1% attention to the # at the beginning of next line #{% \def\xint_temp {#1}% \ifx\empty\xint_temp - \expandafter\XINT_assign_b + \expandafter\XINT_assign_c \else - \expandafter\XINT_assign_B + \expandafter\XINT_assign_d \fi }% -\long\def\XINT_assign_b #1#2\to #3% +\long\def\XINT_assign_c #1#2\to #3% {% - \edef #3{#1}\def\xint_temp {#2}% - \unless\ifx\empty\xint_temp\xint_afterfi{\XINT_assign_a #2\to }\fi + \XINT_assign_def #3{#1}% + \def\xint_temp {#2}% + \unless\ifx\empty\xint_temp\xint_afterfi{\XINT_assign_b #2\to }\fi }% -\def\XINT_assign_B #1\to #2% +\def\XINT_assign_d #1\to #2% normally #1 is {} here. {% - \edef #2{\xint_temp}% + \expandafter\XINT_assign_def\expandafter #2\expandafter{\xint_temp}% }% \def\xintRelaxArray #1% {% @@ -971,7 +998,22 @@ \global\expandafter\let\csname\xint_arrayname 00\endcsname\relax \global\let #1\relax }% -\long\def\xintAssignArray #1\to #2% +\def\xintAssignArray{\def\XINT_flet_macro {\XINT_assignarray_fork}% + \XINT_flet_zapsp }% +\def\XINT_assignarray_fork +{% + \let\XINT_assignarray_def\edef + \ifx\XINT_token[\expandafter\XINT_assignarray_opt + \else\expandafter\XINT_assignarray + \fi +}% +\def\XINT_assignarray_opt [#1]% +{% + \expandafter\let\expandafter\XINT_assignarray_def + \csname XINT_#1def\endcsname + \XINT_assignarray +}% +\long\def\XINT_assignarray #1\to #2% {% \edef\XINT_restoreescapechar {\escapechar\the\escapechar\relax }% \escapechar -1 @@ -993,8 +1035,9 @@ \else \expandafter\def\expandafter\xint_itemcount\expandafter {\the\numexpr\xint_itemcount+\xint_c_i}% - \expandafter\edef - \csname\xint_arrayname\xint_itemcount\endcsname {\xint_temp }% + \expandafter\XINT_assignarray_def + \csname\xint_arrayname\xint_itemcount\expandafter\endcsname + \expandafter{\xint_temp }% \expandafter\XINT_assignarray_loop \fi }% @@ -1019,6 +1062,7 @@ }% }% \let\xintDigitsOf\xintAssignArray +\let\XINT_tmpa\relax \let\XINT_tmpb\relax \let\XINT_tmpc\relax \XINT_restorecatcodes_endinput% \endinput %% |