diff options
author | Karl Berry <karl@freefriends.org> | 2016-03-19 22:13:18 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2016-03-19 22:13:18 +0000 |
commit | ff3c0e83bcf8933daf4eebaf87613022ca946b6a (patch) | |
tree | c004090697462976dff59f90084c8012f970a0c6 /Master/texmf-dist/tex/generic/xint | |
parent | 4f476d8d94c0d15e98b145f8674621c8b309fe39 (diff) |
xint (19mar16)
git-svn-id: svn://tug.org/texlive/trunk@40077 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 | 23 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/xint/xintbinhex.sty | 20 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/xint/xintcfrac.sty | 4 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/xint/xintcore.sty | 22 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/xint/xintexpr.sty | 211 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/xint/xintfrac.sty | 296 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/xint/xintgcd.sty | 4 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/xint/xintkernel.sty | 6 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/xint/xintseries.sty | 4 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/xint/xinttools.sty | 664 |
10 files changed, 790 insertions, 464 deletions
diff --git a/Master/texmf-dist/tex/generic/xint/xint.sty b/Master/texmf-dist/tex/generic/xint/xint.sty index 85e1274744c..6cad13c1d89 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 1.2f 2016/03/12 +%% The xint bundle 1.2g 2016/03/19 %% Copyright (C) 2013-2016 by Jean-Francois Burnol %% xint: Expandable operations on big integers %% --------------------------------------------------------------- @@ -70,7 +70,7 @@ \XINTsetupcatcodes% defined in xintkernel.sty (loaded by xintcore.sty) \XINT_providespackage \ProvidesPackage{xint}% - [2016/03/12 1.2f Expandable operations on big integers (JFB)]% + [2016/03/19 1.2g Expandable operations on big integers (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}% @@ -90,21 +90,16 @@ \fi }% \def\xintiiIsOne {\romannumeral0\xintiiisone }% -\def\xintiiisone #1{\expandafter\XINT_isone\romannumeral`&&@#1\W\Z }% +\def\xintiiisone #1{\expandafter\XINT_isone\romannumeral`&&@#1XY}% \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% +\def\xintisone #1{\expandafter\XINT_isone\romannumeral0\xintnum{#1}XY}% +\def\XINT_isOne #1{\romannumeral0\XINT_isone #1XY}% +\def\XINT_isone #1#2#3Y% {% - \xint_gob_til_one #1\XINT_isone_b 1% - \expandafter\space\expandafter 0\xint_gob_til_Z #2% + \unless\if#2X\xint_dothis{ 0}\fi + \unless\if#11\xint_dothis{ 0}\fi + \xint_orthat{ 1}% }% -\def\XINT_isone_b #1\xint_gob_til_Z #2% -{% - \xint_gob_til_W #2\XINT_isone_yes \W - \expandafter\space\expandafter 0\xint_gob_til_Z -}% -\def\XINT_isone_yes #1\Z { 1}% \let\xintRev\xintReverseDigits \def\xintLen {\romannumeral0\xintlen }% \def\xintlen #1% diff --git a/Master/texmf-dist/tex/generic/xint/xintbinhex.sty b/Master/texmf-dist/tex/generic/xint/xintbinhex.sty index 061e629acca..429bd7fb008 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 1.2f 2016/03/12 +%% The xint bundle 1.2g 2016/03/19 %% Copyright (C) 2013-2016 by Jean-Francois Burnol %% xintbinhex: Expandable binary and hexadecimal conversions %% --------------------------------------------------------------- @@ -70,7 +70,7 @@ \XINTsetupcatcodes% defined in xintkernel.sty \XINT_providespackage \ProvidesPackage{xintbinhex}% - [2016/03/12 1.2f Expandable binary and hexadecimal conversions (JFB)]% + [2016/03/19 1.2g Expandable binary and hexadecimal conversions (JFB)]% \newcount\xint_c_ii^xv \xint_c_ii^xv 32768 \newcount\xint_c_ii^xvi \xint_c_ii^xvi 65536 \newcount\xint_c_x^v \xint_c_x^v 100000 @@ -206,7 +206,7 @@ -{\XINT_dth_P #1}% \krof }% -\def\XINT_dth_N {\expandafter\xint_minus_thenstop\romannumeral0\XINT_dth_P }% +\def\XINT_dth_N {\expandafter-\romannumeral0\XINT_dth_P }% \def\XINT_dth_P {\expandafter\XINT_dth_III\romannumeral`&&@\XINT_dtbh_I {0.}}% \def\xintDecToBin {\romannumeral0\xintdectobin }% \def\xintdectobin #1% @@ -218,7 +218,7 @@ -{\XINT_dtb_P #1}% \krof }% -\def\XINT_dtb_N {\expandafter\xint_minus_thenstop\romannumeral0\XINT_dtb_P }% +\def\XINT_dtb_N {\expandafter-\romannumeral0\XINT_dtb_P }% \def\XINT_dtb_P {\expandafter\XINT_dtb_III\romannumeral`&&@\XINT_dtbh_I {0.}}% \def\XINT_dtbh_I #1#2#3#4#5% {% @@ -354,8 +354,7 @@ -{\XINT_htd_I {0000}#1}% \krof }% -\def\XINT_htd_neg {\expandafter\xint_minus_thenstop - \romannumeral0\XINT_htd_I {0000}}% +\def\XINT_htd_neg {\expandafter-\romannumeral0\XINT_htd_I {0000}}% \def\XINT_htd_I #1#2#3#4#5% {% \xint_gob_til_W #5\XINT_htd_II_a\W @@ -438,8 +437,7 @@ -{\XINT_btd_I {000000}#1}% \krof }% -\def\XINT_btd_neg {\expandafter\xint_minus_thenstop - \romannumeral0\XINT_btd_I {000000}}% +\def\XINT_btd_neg {\expandafter-\romannumeral0\XINT_btd_I {000000}}% \def\XINT_btd_I #1#2#3#4#5#6#7#8#9% {% \xint_gob_til_W #9\XINT_btd_II_a {#2#3#4#5#6#7#8#9}\W @@ -550,7 +548,7 @@ -{\XINT_bth_P #1}% \krof }% -\def\XINT_bth_N {\expandafter\xint_minus_thenstop\romannumeral0\XINT_bth_P }% +\def\XINT_bth_N {\expandafter-\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% @@ -584,7 +582,7 @@ -{\XINT_htb_P #1}% \krof }% -\def\XINT_htb_N {\expandafter\xint_minus_thenstop\romannumeral0\XINT_htb_P }% +\def\XINT_htb_N {\expandafter-\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% {% @@ -625,7 +623,7 @@ -{\XINT_chtb_P #1}% \krof }% -\def\XINT_chtb_N {\expandafter\xint_minus_thenstop\romannumeral0\XINT_chtb_P }% +\def\XINT_chtb_N {\expandafter-\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 6f516f56bfb..d4df3400f4b 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 1.2f 2016/03/12 +%% The xint bundle 1.2g 2016/03/19 %% Copyright (C) 2013-2016 by Jean-Francois Burnol %% xintcfrac: Expandable continued fractions with xint package %% --------------------------------------------------------------- @@ -70,7 +70,7 @@ \XINTsetupcatcodes% defined in xintkernel.sty \XINT_providespackage \ProvidesPackage{xintcfrac}% - [2016/03/12 1.2f Expandable continued fractions with xint package (JFB)]% + [2016/03/19 1.2g Expandable continued fractions with xint package (JFB)]% \def\xintCFrac {\romannumeral0\xintcfrac }% \def\xintcfrac #1% {% diff --git a/Master/texmf-dist/tex/generic/xint/xintcore.sty b/Master/texmf-dist/tex/generic/xint/xintcore.sty index 5088cdefa12..c0ae2f7d5dc 100644 --- a/Master/texmf-dist/tex/generic/xint/xintcore.sty +++ b/Master/texmf-dist/tex/generic/xint/xintcore.sty @@ -21,7 +21,7 @@ %% same distribution. (The sources need not necessarily be %% in the same archive or directory.) %% --------------------------------------------------------------- -%% The xint bundle 1.2f 2016/03/12 +%% The xint bundle 1.2g 2016/03/19 %% Copyright (C) 2013-2016 by Jean-Francois Burnol %% xintcore: Expandable arithmetic on big integers %% --------------------------------------------------------------- @@ -70,7 +70,7 @@ \XINTsetupcatcodes% defined in xintkernel.sty \XINT_providespackage \ProvidesPackage{xintcore}% - [2016/03/12 1.2f Expandable arithmetic on big integers (JFB)]% + [2016/03/19 1.2g Expandable arithmetic on big integers (JFB)]% \ifdefined\m@ne\let\xint_c_mone\m@ne \else\csname newcount\endcsname\xint_c_mone \xint_c_mone -1 \fi \newcount\xint_c_x^viii \xint_c_x^viii 100000000 @@ -274,7 +274,7 @@ \def\XINT_reversedigits #1% {% \xint_UDsignfork - #1{\expandafter\xint_minus_thenstop\romannumeral0\XINT_reversedigits_a}% + #1{\expandafter-\romannumeral0\XINT_reversedigits_a}% -{\XINT_reversedigits_a #1}% \krof }% @@ -309,7 +309,7 @@ {% \xint_UDzerominusfork #1-{ 0}% - 0#1{ -1}% + 0#1{-1}% 0-{ 1}% \krof }% @@ -416,7 +416,7 @@ }% \def\XINT_dbl_zero #1\Z { 0}% \def\XINT_dbl_neg - {\expandafter\xint_minus_thenstop\romannumeral0\XINT_dbl_pos }% + {\expandafter-\romannumeral0\XINT_dbl_pos }% \def\XINT_dbl_pos #1\Z {% \expandafter\XINT_dbl_pos_aa @@ -481,9 +481,9 @@ 0-{\XINT_dec_pos #1}% \krof }% -\def\XINT_dec_zero #1\Z { -1}% +\def\XINT_dec_zero #1\Z {-1}% \def\XINT_dec_neg - {\expandafter\xint_minus_thenstop\romannumeral0\XINT_inc_pos }% + {\expandafter-\romannumeral0\XINT_inc_pos }% \def\XINT_dec_pos #1\Z {% \expandafter\XINT_dec_pos_aa @@ -552,7 +552,7 @@ \def\XINT_add_firstiszero #1\krof 0#2#3\Z #4\Z { #2#3}% \def\XINT_add_secondiszero #1\krof #20#3\Z #4\Z { #2#4}% \def\XINT_add_minusminus #1#2% - {\expandafter\xint_minus_thenstop\romannumeral0\XINT_add_pp_a {}{}}% + {\expandafter-\romannumeral0\XINT_add_pp_a {}{}}% \def\XINT_add_minusplus #1#2{\XINT_sub_mm_a {}#2}% \def\XINT_add_plusminus #1#2% {\expandafter\XINT_opp\romannumeral0\XINT_sub_mm_a #1{}}% @@ -705,7 +705,7 @@ \def\XINT_sub_plusplus #1#2% {\expandafter\XINT_opp\romannumeral0\XINT_sub_mm_a #1#2}% \def\XINT_sub_minusplus #1#2% - {\expandafter\xint_minus_thenstop\romannumeral0\XINT_add_pp_a {}#2}% + {\expandafter-\romannumeral0\XINT_add_pp_a {}#2}% \def\XINT_sub_minusminus #1#2{\XINT_sub_mm_a {}{}}% \def\XINT_sub_mm_a #1#2#3\Z {% @@ -899,9 +899,9 @@ \def\XINT_mul_zero #1\krof #2#3\Z #4\Z { 0}% \def\XINT_mul_minusminus #1#2{\XINT_mul_plusplus {}{}}% \def\XINT_mul_minusplus #1#2% - {\expandafter\xint_minus_thenstop\romannumeral0\XINT_mul_plusplus {}#2}% + {\expandafter-\romannumeral0\XINT_mul_plusplus {}#2}% \def\XINT_mul_plusminus #1#2% - {\expandafter\xint_minus_thenstop\romannumeral0\XINT_mul_plusplus #1{}}% + {\expandafter-\romannumeral0\XINT_mul_plusplus #1{}}% \def\XINT_mul_plusplus #1#2#3\Z {% \expandafter\XINT_mul_pre_b diff --git a/Master/texmf-dist/tex/generic/xint/xintexpr.sty b/Master/texmf-dist/tex/generic/xint/xintexpr.sty index ab7896f4fe0..b2736c3398b 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 1.2f 2016/03/12 +%% The xint bundle 1.2g 2016/03/19 %% Copyright (C) 2013-2016 by Jean-Francois Burnol %% xintexpr: Expandable expression parser %% --------------------------------------------------------------- @@ -81,7 +81,7 @@ \XINTsetupcatcodes% \XINT_providespackage \ProvidesPackage{xintexpr}% - [2016/03/12 1.2f Expandable expression parser (JFB)]% + [2016/03/19 1.2g Expandable expression parser (JFB)]% \catcode`! 11 \def\xint_gob_til_! #1!{}% catcode 11 ! default in xintexpr.sty code. \edef\XINT_expr_lockscan#1!% not used for decimal numbers in xintexpr 1.2 @@ -910,8 +910,9 @@ \else \xint_afterfi {\expandafter ##2\expandafter ##3\csname - .=\expandafter\xintListSel::csv \romannumeral`&&@\XINT_expr_unlock ##4;% - \XINT_expr_unlock ##1;\endcsname % unlock added for \xintNewExpr + .=\expandafter\xintListSel:f:csv + \romannumeral`&&@\XINT_expr_unlock ##4;% + \XINT_expr_unlock ##1;\endcsname % unlock for \xintNewExpr }% \fi }% @@ -972,7 +973,7 @@ \let\XINT_flexpr_op_][: \XINT_expr_op_][: \let\XINT_iiexpr_op_][: \XINT_expr_op_][: \catcode`[ 12 \catcode`] 12 -\def\xintListSel::csv #1{% +\def\xintListSel:f:csv #1{% \if ]\noexpand#1\xint_dothis{\expandafter\XINT_listsel:_s\romannumeral`&&@}\fi \if :\noexpand#1\xint_dothis{\XINT_listsel:_:}\fi \xint_orthat {\XINT_listsel:_nth #1}% @@ -980,31 +981,22 @@ \def\XINT_listsel:_s #1{\if p#1\expandafter\XINT_listsel:_trim\else \expandafter\XINT_listsel:_keep\fi }% \def\XINT_listsel:_: #1.#2.{\csname XINT_listsel:_#1#2\endcsname }% -\def\XINT_listsel:_trim #1;#2;% - {\xintListWithSep,{\xintTrim {\xintNum{#1}}{\xintCSVtoListNonStripped{#2}}}}% -\def\XINT_listsel:_keep #1;#2;% - {\xintListWithSep,{\xintKeep {\xintNum{#1}}{\xintCSVtoListNonStripped{#2}}}}% -\def\XINT_listsel:_nth#1;#2;% - {\xintNthElt {\xintNum{#1}}{\xintCSVtoListNonStripped{#2}}}% +\def\XINT_listsel:_trim #1;#2;{\xintTrim:f:csv {\xintNum{#1}}{#2}}% +\def\XINT_listsel:_keep #1;#2;{\xintKeep:f:csv {\xintNum{#1}}{#2}}% +\def\XINT_listsel:_nth#1;#2;{\xintNthEltPy:f:csv {\xintNum{#1}}{#2}}% \def\XINT_listsel:_PP #1;#2;#3;% - {\xintListWithSep,% - {\xintTrim {\xintNum{#1}}{\xintKeep {\xintNum{#2}}{\xintCSVtoListNonStripped{#3}}}}% - }% + {\xintTrim:f:csv {\xintNum{#1}}{\xintKeep:f:csv {\xintNum{#2}}{#3}}}% \def\XINT_listsel:_NN #1;#2;#3;% - {\xintListWithSep,% - {\xintTrim {\xintNum{#2}}{\xintKeep {\xintNum{#1}}{\xintCSVtoListNonStripped{#3}}}}% - }% -\def\XINT_listsel:_NP #1;#2;#3;% - {\expandafter\XINT_listsel:_NP_a \the\numexpr #1+% - \xintNthElt{0}{\xintCSVtoListNonStripped{#3}};#2;#3;}% -\def\XINT_listsel:_NP_a #1#2;{\if -#1\expandafter\XINT_listsel:_OP\fi - \XINT_listsel:_PP #1#2;}% + {\xintTrim:f:csv {\xintNum{#2}}{\xintKeep:f:csv {\xintNum{#1}}{#3}}}% +\def\XINT_listsel:_NP #1;#2;#3;{\expandafter\XINT_listsel:_NP_a + \the\numexpr #1+\xintLength:f:csv{#3};#2;#3;}% +\def\XINT_listsel:_NP_a #1#2;% + {\if -#1\expandafter\XINT_listsel:_OP\fi\XINT_listsel:_PP #1#2;}% \def\XINT_listsel:_OP\XINT_listsel:_PP #1;{\XINT_listsel:_PP 0;}% -\def\XINT_listsel:_PN #1;#2;#3;% - {\expandafter\XINT_listsel:_PN_a \the\numexpr #2+% - \xintNthElt{0}{\xintCSVtoListNonStripped{#3}};#1;#3;}% -\def\XINT_listsel:_PN_a #1#2;#3;{\if -#1\expandafter\XINT_listsel:_PO\fi - \XINT_listsel:_PP #3;#1#2;}% +\def\XINT_listsel:_PN #1;#2;#3;{\expandafter\XINT_listsel:_PN_a + \the\numexpr #2+\xintLength:f:csv{#3};#1;#3;}% +\def\XINT_listsel:_PN_a #1#2;#3;% + {\if -#1\expandafter\XINT_listsel:_PO\fi\XINT_listsel:_PP #3;#1#2;}% \def\XINT_listsel:_PO\XINT_listsel:_PP #1;#2;{\XINT_listsel:_PP #1;0;}% \def\xintSeq::csv {\romannumeral0\xintseq::csv }% \def\xintseq::csv #1#2% @@ -1602,6 +1594,64 @@ \csname.=\the\numexpr \XINT_expr_unlock#3+\xint_c_i\endcsname }% \def\XINT_expr_rseq:_Abort #1!#2#3~#4#5{}% \def\XINT_expr_rseq:_Break #1!#2#3~#4#5{,#1}% +\def\XINT_expr_func_iter {\XINT_allexpr_iter \xintbareeval \xintthebareeval }% +\def\XINT_flexpr_func_iter {\XINT_allexpr_iter \xintbarefloateval \xintthebarefloateval }% +\def\XINT_iiexpr_func_iter {\XINT_allexpr_iter \xintbareiieval \xintthebareiieval }% +\def\XINT_allexpr_iter #1#2#3% +{% + \expandafter\XINT_expr_iterx\expandafter #1\expandafter#2\expandafter + #3\romannumeral`&&@\XINT_expr_onlitteral_seq_a {}% +}% +\def\XINT_expr_iterx #1#2#3#4#5% +{% + \expandafter\XINT_expr_itery\romannumeral0#1(#5)\relax #3#4#2% +}% +\def\XINT_expr_itery #1#2#3#4#5% +{% + \expandafter \XINT_expr_getop + \csname .=% + \expandafter\XINT_expr_iter:_aa + \romannumeral`&&@\XINT_expr_unlock #1!{#5#4\relax !#3}#2\endcsname +}% +\def\XINT_expr_iter:_aa #1{\if +#1\expandafter\XINT_expr_iter:_A\else + \expandafter\XINT_expr_iter:_a\fi #1}% +\def\XINT_expr_iter:_a #1!#2#3{\XINT_expr_iter:_b {#3}{#2}#1,^,}% +\def\XINT_expr_iter:_b #1#2#3#4,{% + \if ,#3\xint_dothis\XINT_expr_iter:_noop\fi + \if ^#3\xint_dothis\XINT_expr_iter:_end\fi + \xint_orthat{\expandafter\XINT_expr_iter:_c}% + \csname.=#3#4\endcsname {#1}{#2}% +}% +\def\XINT_expr_iter:_noop\csname.=,#1\endcsname #2#3{\XINT_expr_iter:_b {#2}{#3}#1,}% +\def\XINT_expr_iter:_end \csname.=^\endcsname #1#2{\XINT_expr:_unlock #1}% +\def\XINT_expr_iter:_c #1#2#3% + {\expandafter\XINT_expr_iter:_d\romannumeral`&&@#3#1~#2{#3}}% +\def\XINT_expr_iter:_d #1{% + \if ^#1\xint_dothis\XINT_expr_iter:_abort\fi + \if ?#1\xint_dothis\XINT_expr_iter:_break\fi + \if !#1\xint_dothis\XINT_expr_iter:_omit\fi + \xint_orthat{\XINT_expr_iter:_goon #1}}% +\def\XINT_expr_iter:_goon #1!#2#3~#4#5% + {\expandafter\XINT_expr_iter:_b\romannumeral0\XINT_expr_lockit {#1}{#5}}% +\def\XINT_expr_iter:_omit #1!#2#3~{\XINT_expr_iter:_b }% +\def\XINT_expr_iter:_abort #1!#2#3~#4#5#6^,{\XINT_expr_unlock #4}% +\def\XINT_expr_iter:_break #1!#2#3~#4#5#6^,{#1}% +\def\XINT_expr_iter:_A +#1!#2#3{\XINT_expr_iter:_D #1#3{#2}}% +\def\XINT_expr_iter:_D #1#2#3% + {\expandafter\XINT_expr_iter:_E\romannumeral`&&@#3#1~#2{#3}}% +\def\XINT_expr_iter:_E #1{\if #1^\xint_dothis\XINT_expr_iter:_Abort\fi + \if #1?\xint_dothis\XINT_expr_iter:_Break\fi + \if #1!\xint_dothis\XINT_expr_iter:_Omit\fi + \xint_orthat{\XINT_expr_iter:_Goon #1}}% +\def\XINT_expr_iter:_Goon #1!#2#3~#4#5% + {\expandafter\XINT_expr_iter:_D + \csname.=\the\numexpr \XINT_expr_unlock#3+\xint_c_i\expandafter\endcsname + \romannumeral0\XINT_expr_lockit{#1}{#5}}% +\def\XINT_expr_iter:_Omit #1!#2#3~%#4#5% + {\expandafter\XINT_expr_iter:_D + \csname.=\the\numexpr \XINT_expr_unlock#3+\xint_c_i\endcsname }% +\def\XINT_expr_iter:_Abort #1!#2#3~#4#5{\XINT_expr:_unlock #4}% +\def\XINT_expr_iter:_Break #1!#2#3~#4#5{#1}% \def\XINT_expr_func_rrseq {\XINT_allexpr_rrseq \xintbareeval \xintthebareeval }% \def\XINT_flexpr_func_rrseq {\XINT_allexpr_rrseq \xintbarefloateval \xintthebarefloateval }% \def\XINT_iiexpr_func_rrseq {\XINT_allexpr_rrseq \xintbareiieval \xintthebareiieval }% @@ -1665,79 +1715,79 @@ \if #1?\xint_dothis\XINT_expr_rrseq:_Break\fi \if #1!\xint_dothis\XINT_expr_rrseq:_Omit\fi \xint_orthat{\XINT_expr_rrseq:_Goon #1}}% -\def\XINT_expr_func_iter {\XINT_allexpr_iter \xintbareeval \xintthebareeval }% -\def\XINT_flexpr_func_iter {\XINT_allexpr_iter \xintbarefloateval \xintthebarefloateval }% -\def\XINT_iiexpr_func_iter {\XINT_allexpr_iter \xintbareiieval \xintthebareiieval }% -\def\XINT_allexpr_iter #1#2#3% +\def\XINT_expr_func_iterr {\XINT_allexpr_iterr \xintbareeval \xintthebareeval }% +\def\XINT_flexpr_func_iterr {\XINT_allexpr_iterr \xintbarefloateval \xintthebarefloateval }% +\def\XINT_iiexpr_func_iterr {\XINT_allexpr_iterr \xintbareiieval \xintthebareiieval }% +\def\XINT_allexpr_iterr #1#2#3% {% - \expandafter\XINT_expr_iterx\expandafter #1\expandafter #2\expandafter + \expandafter\XINT_expr_iterrx\expandafter #1\expandafter #2\expandafter #3\romannumeral`&&@\XINT_expr_onlitteral_seq_a {}% }% -\def\XINT_expr_iterx #1#2#3#4#5% +\def\XINT_expr_iterrx #1#2#3#4#5% {% - \expandafter\XINT_expr_itery\romannumeral0#1(#5)\expandafter\relax + \expandafter\XINT_expr_iterry\romannumeral0#1(#5)\expandafter\relax \expandafter{\romannumeral0\xintapply \XINT_expr_lockit {\xintRevWithBraces{\xintCSVtoListNonStripped{\XINT_expr_unlock #3}}}}% #3#4#2% }% -\def\XINT_expr_itery #1#2#3#4#5#6% +\def\XINT_expr_iterry #1#2#3#4#5#6% {% \expandafter \XINT_expr_getop \csname .=% - \expandafter\XINT_expr_iter:_aa - \romannumeral`&&@\XINT_expr_unlock #1!{#6#5\relax !#4}{#2}\endcsname -}% -\def\XINT_expr_iter:_aa #1{\if +#1\expandafter\XINT_expr_iter:_A\else - \expandafter\XINT_expr_iter:_a\fi #1}% -\def\XINT_expr_iter:_a #1!#2#3{\XINT_expr_iter:_b {#3}{#2}#1,^,}% -\def\XINT_expr_iter:_b #1#2#3#4,{% - \if ,#3\xint_dothis\XINT_expr_iter:_noop\fi - \if ^#3\xint_dothis\XINT_expr_iter:_end\fi - \xint_orthat{\expandafter\XINT_expr_iter:_c}\csname.=#3#4\endcsname - {#1}{#2}% -}% -\def\XINT_expr_iter:_noop\csname.=,#1\endcsname #2#3{\XINT_expr_iter:_b {#2}{#3}#1,}% -\def\XINT_expr_iter:_end \csname.=^\endcsname #1#2% + \expandafter\XINT_expr_iterr:_aa + \romannumeral`&&@\XINT_expr_unlock #1!{#6#5\relax !#4}{#2}\endcsname +}% +\def\XINT_expr_iterr:_aa #1{\if +#1\expandafter\XINT_expr_iterr:_A\else + \expandafter\XINT_expr_iterr:_a\fi #1}% +\def\XINT_expr_iterr:_a #1!#2#3{\XINT_expr_iterr:_b {#3}{#2}#1,^,}% +\def\XINT_expr_iterr:_b #1#2#3#4,{% + \if ,#3\xint_dothis\XINT_expr_iterr:_noop\fi + \if ^#3\xint_dothis\XINT_expr_iterr:_end\fi + \xint_orthat{\expandafter\XINT_expr_iterr:_c}% + \csname.=#3#4\endcsname {#1}{#2}% +}% +\def\XINT_expr_iterr:_noop\csname.=,#1\endcsname #2#3{\XINT_expr_iterr:_b {#2}{#3}#1,}% +\def\XINT_expr_iterr:_end \csname.=^\endcsname #1#2% {\expandafter\xint_gobble_i\romannumeral0\xintapplyunbraced {,\XINT_expr:_unlock}{\xintReverseOrder{#1\space}}}% -\def\XINT_expr_iter:_c #1#2#3% - {\expandafter\XINT_expr_iter:_d\romannumeral`&&@#3#1~#2?{#3}}% -\def\XINT_expr_iter:_d #1{% - \if ^#1\xint_dothis\XINT_expr_iter:_abort\fi - \if ?#1\xint_dothis\XINT_expr_iter:_break\fi - \if !#1\xint_dothis\XINT_expr_iter:_omit\fi - \xint_orthat{\XINT_expr_iter:_goon #1}% -}% -\def\XINT_expr_iter:_goon #1!#2#3~#4?#5{\expandafter\XINT_expr_iter:_b\expandafter +\def\XINT_expr_iterr:_c #1#2#3% + {\expandafter\XINT_expr_iterr:_d\romannumeral`&&@#3#1~#2?{#3}}% +\def\XINT_expr_iterr:_d #1{% + \if ^#1\xint_dothis\XINT_expr_iterr:_abort\fi + \if ?#1\xint_dothis\XINT_expr_iterr:_break\fi + \if !#1\xint_dothis\XINT_expr_iterr:_omit\fi + \xint_orthat{\XINT_expr_iterr:_goon #1}% +}% +\def\XINT_expr_iterr:_goon #1!#2#3~#4?#5{\expandafter\XINT_expr_iterr:_b\expandafter {\romannumeral0\xinttrim{-1}{\XINT_expr_lockit{#1}#4}}{#5}}% -\def\XINT_expr_iter:_omit #1!#2#3~{\XINT_expr_iter:_b }% -\def\XINT_expr_iter:_abort #1!#2#3~#4?#5#6^,% +\def\XINT_expr_iterr:_omit #1!#2#3~{\XINT_expr_iterr:_b }% +\def\XINT_expr_iterr:_abort #1!#2#3~#4?#5#6^,% {\expandafter\xint_gobble_i\romannumeral0\xintapplyunbraced {,\XINT_expr:_unlock}{\xintReverseOrder{#4\space}}}% -\def\XINT_expr_iter:_break #1!#2#3~#4?#5#6^,% +\def\XINT_expr_iterr:_break #1!#2#3~#4?#5#6^,% {\expandafter\xint_gobble_iv\romannumeral0\xintapplyunbraced {,\XINT_expr:_unlock}{\xintReverseOrder{#4\space}},#1}% \def\XINT_expr:_unlock #1{\XINT_expr_unlock #1}% -\def\XINT_expr_iter:_A +#1!#2#3{\XINT_expr_iter:_D #1{#3}{#2}}% -\def\XINT_expr_iter:_D #1#2#3% - {\expandafter\XINT_expr_iter:_E\romannumeral`&&@#3#1~#2?{#3}}% -\def\XINT_expr_iter:_Goon #1!#2#3~#4?#5% - {\expandafter\XINT_expr_iter:_D +\def\XINT_expr_iterr:_A +#1!#2#3{\XINT_expr_iterr:_D #1{#3}{#2}}% +\def\XINT_expr_iterr:_D #1#2#3% + {\expandafter\XINT_expr_iterr:_E\romannumeral`&&@#3#1~#2?{#3}}% +\def\XINT_expr_iterr:_Goon #1!#2#3~#4?#5% + {\expandafter\XINT_expr_iterr:_D \csname.=\the\numexpr \XINT_expr_unlock#3+\xint_c_i\expandafter\endcsname \expandafter{\romannumeral0\xinttrim{-1}{\XINT_expr_lockit{#1}#4}}{#5}}% -\def\XINT_expr_iter:_Omit #1!#2#3~%#4?#5% - {\expandafter\XINT_expr_iter:_D +\def\XINT_expr_iterr:_Omit #1!#2#3~%#4?#5% + {\expandafter\XINT_expr_iterr:_D \csname.=\the\numexpr \XINT_expr_unlock#3+\xint_c_i\endcsname}% -\def\XINT_expr_iter:_Abort #1!#2#3~#4?#5% +\def\XINT_expr_iterr:_Abort #1!#2#3~#4?#5% {\expandafter\xint_gobble_i\romannumeral0\xintapplyunbraced {,\XINT_expr:_unlock}{\xintReverseOrder{#4\space}}}% -\def\XINT_expr_iter:_Break #1!#2#3~#4?#5% +\def\XINT_expr_iterr:_Break #1!#2#3~#4?#5% {\expandafter\xint_gobble_iv\romannumeral0\xintapplyunbraced {,\XINT_expr:_unlock}{\xintReverseOrder{#4\space}},#1}% -\def\XINT_expr_iter:_E #1{\if #1^\xint_dothis\XINT_expr_iter:_Abort\fi - \if #1?\xint_dothis\XINT_expr_iter:_Break\fi - \if #1!\xint_dothis\XINT_expr_iter:_Omit\fi - \xint_orthat{\XINT_expr_iter:_Goon #1}}% +\def\XINT_expr_iterr:_E #1{\if #1^\xint_dothis\XINT_expr_iterr:_Abort\fi + \if #1?\xint_dothis\XINT_expr_iterr:_Break\fi + \if #1!\xint_dothis\XINT_expr_iterr:_Omit\fi + \xint_orthat{\XINT_expr_iterr:_Goon #1}}% \catcode`? 11 \def\xintANDof:csv #1{\expandafter\XINT_andof:_a\romannumeral`&&@#1,,^}% \def\XINT_andof:_a #1{\if ,#1\expandafter\XINT_andof:_e @@ -2119,6 +2169,11 @@ }% \let\XINT_flexpr_func_ifsgn\XINT_expr_func_ifsgn \let\XINT_iiexpr_func_ifsgn\XINT_expr_func_ifsgn +\def\XINT_expr_func_len #1#2#3% + {\expandafter#1\expandafter#2% + \csname.=\xintLength:f:csv {\XINT_expr_unlock#3}\endcsname }% +\let\XINT_flexpr_func_len \XINT_expr_func_len +\let\XINT_iiexpr_func_len \XINT_expr_func_len \def\XINT_expr_func_first #1#2#3% {\expandafter #1\expandafter #2\csname.=\expandafter\XINT_expr_func_firsta \romannumeral`&&@\XINT_expr_unlock #3,^\endcsname }% @@ -2148,11 +2203,9 @@ \let\XINT_iiexpr_func_nuple\XINT_expr_func_nuple \def\XINT_expr_func_reversed #1#2#3% {\expandafter #1\expandafter #2\csname .=% - \xintReverse::csv {\XINT_expr_unlock #3}\endcsname }% + \xintReverse:f:csv {\XINT_expr_unlock #3}\endcsname }% \let\XINT_flexpr_func_reversed\XINT_expr_func_reversed \let\XINT_iiexpr_func_reversed\XINT_expr_func_reversed -\def\xintReverse::csv #1% should be done directly, of course - {\xintListWithSep,{\xintRevWithBraces {\xintCSVtoListNonStripped{#1}}}}% \def\xintSeqB:f:csv #1#2% {\expandafter\XINT_seqb:f:csv \expandafter{\romannumeral0\xintraw{#2}}{#1}}% \def\XINT_seqb:f:csv #1#2{\expandafter\XINT_seqb:f:csv_a\romannumeral`&&@#2#1!}% @@ -2425,8 +2478,8 @@ \expandafter{\the\toks0\expandafter\def\csname #1:csv\endcsname {~#1:csv}}% }% \toks0 \expandafter{\the\toks0 - \def\xintReverse::csv {~xintReverse::csv }% - \def\xintListSel::csv {~xintListSel::csv }% + \def\xintReverse:f:csv {~xintReverse:f:csv }% + \def\xintListSel:f:csv {~xintListSel:f:csv }% }% \odef\XINT_expr_redefinemacros {\the\toks0}% Not \edef ! (subtle) \def\XINT_expr_redefineprints diff --git a/Master/texmf-dist/tex/generic/xint/xintfrac.sty b/Master/texmf-dist/tex/generic/xint/xintfrac.sty index 39b9785986f..ab128c57272 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 1.2f 2016/03/12 +%% The xint bundle 1.2g 2016/03/19 %% Copyright (C) 2013-2016 by Jean-Francois Burnol %% xintfrac: Expandable operations on fractions %% --------------------------------------------------------------- @@ -70,7 +70,7 @@ \XINTsetupcatcodes% defined in xintkernel.sty \XINT_providespackage \ProvidesPackage{xintfrac}% - [2016/03/12 1.2f Expandable operations on fractions (JFB)]% + [2016/03/19 1.2g Expandable operations on fractions (JFB)]% \def\XINT_cntSgnFork #1% {% \ifcase #1\expandafter\xint_secondofthree @@ -596,7 +596,7 @@ }% \def\XINT_sgnfrac_N {% - \expandafter\xint_minus_thenstop\romannumeral0\XINT_sgnfrac_P + \expandafter-\romannumeral0\XINT_sgnfrac_P }% \def\xintFwOver {\romannumeral0\xintfwover }% \def\xintfwover #1% @@ -644,7 +644,7 @@ }% \def\XINT_sgnfwover_N {% - \expandafter\xint_minus_thenstop\romannumeral0\XINT_sgnfwover_P + \expandafter-\romannumeral0\XINT_sgnfwover_P }% \def\xintREZ {\romannumeral0\xintrez }% \def\xintrez @@ -664,7 +664,7 @@ \krof }% \def\XINT_rez_zero #1\Z #2#3{ 0/1[0]}% -\def\XINT_rez_neg {\expandafter\xint_minus_thenstop\romannumeral0\XINT_rez_B }% +\def\XINT_rez_neg {\expandafter-\romannumeral0\XINT_rez_B }% \def\XINT_rez_B #1\Z {% \expandafter\XINT_rez_C\romannumeral0\XINT_factortens {#1}% @@ -708,7 +708,7 @@ #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_thenstop}% +\def\XINT_irr_negative #1\Z #2{\XINT_irr_D #1\Z #2\Z -}% \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 {% @@ -775,7 +775,7 @@ #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_thenstop }% +\def\XINT_jrr_negative #1\Z #2{\XINT_jrr_D #1\Z #2\Z -}% \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 {% @@ -893,7 +893,7 @@ \krof }% \def\XINT_trunc_Fneg #1.#2{\expandafter\xint_firstoftwo_thenstop - \romannumeral0\XINT_div_prepare {#2}{#1}\Z \xint_minus_thenstop}% + \romannumeral0\XINT_div_prepare {#2}{#1}\Z -}% \def\XINT_trunc_Fpos #1.#2{\expandafter\xint_firstoftwo_thenstop \romannumeral0\XINT_div_prepare {#2}{#1}\Z \space }% \def\XINT_itrunc_G #1#2\Z #3#4% @@ -1607,7 +1607,7 @@ #1#5{#2/#3[#4]}{#6/#7[#8]}% }% \def\XINT_fmax_minusminus --% - {\expandafter\xint_minus_thenstop\romannumeral0\XINT_fmin_nonneg_b }% + {\expandafter-\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% @@ -1651,7 +1651,7 @@ #1#5{#2/#3[#4]}{#6/#7[#8]}% }% \def\XINT_fmin_minusminus --% - {\expandafter\xint_minus_thenstop\romannumeral0\XINT_fmax_nonneg_b }% + {\expandafter-\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% @@ -1773,21 +1773,94 @@ \expandafter\XINT_float_a\the\numexpr #1\expandafter.% \romannumeral0\XINT_infrac {#2}\XINT_float_Q }% -\def\XINT_float_a #1.#2#3% #1=P, #2=n, #3=A, #4=B +\def\XINT_float_a #1.#2#3#4% {% - \XINT_float_fork #3\Z {#1}{#2}% #1 = precision, #2=n + \if\romannumeral0\XINT_isone#4XY1\expandafter\XINT_float_sp + \else\expandafter\XINT_float_fork\fi #3.{#1}{#2}{#4}% }% -\def\XINT_float_fork #1% +\def\XINT_float_sp #1% +{% + \xint_UDzerominusfork + #1-\XINT_float_spzero + 0#1\XINT_float_spneg + 0-{\XINT_float_sppos #1}% + \krof +}% +\def\XINT_float_spzero .#1#2#3#4{ 0.e0}% +\def\XINT_float_spneg {\expandafter-\romannumeral0\XINT_float_sppos}% +\def\XINT_float_sppos #1.#2#3#4#5% +{% + \expandafter\XINT_float_sp_b\the\numexpr#2-\xintLength{#1}.#1.#2.#3.% +}% +\def\XINT_float_sp_b #1% {% \xint_UDzerominusfork - #1-\XINT_float_zero - 0#1\XINT_float_J - 0-{\XINT_float_K #1}% + #1-\XINT_float_sp_quick + 0#1\XINT_float_sp_c + 0-{\XINT_float_sp_addzeros #1}% \krof }% -\def\XINT_float_zero #1\Z #2#3#4#5{ 0.e0}% -\def\XINT_float_J {\expandafter\xint_minus_thenstop\romannumeral0\XINT_float_K }% -\def\XINT_float_K #1\Z #2% #1=A, #2=P, #3=n, #4=B +\def\XINT_float_sp_quick .#1.#2.#3.% +{% + \expandafter\XINT_float_sp_done\the\numexpr #3+#2-\xint_c_i.#1;% +}% +\def\XINT_float_sp_addzeros #1.#2.#3.#4.% +{% + \expandafter\XINT_float_sp_done + \the\numexpr #4-#1+#3-\xint_c_i\expandafter.% + \romannumeral0\XINT_dsx_addzerosnofuss {#1}{#2};% +}% +\def\XINT_float_sp_done #1.#2#3;{ #2.#3e#1}% +\def\XINT_float_sp_c #1.#2% +{% + \if #29\xint_dothis {\XINT_float_sp_d\XINT_float_Wb }\fi + \xint_orthat {\XINT_float_sp_d\XINT_float_sp_Wa }#1.#2% +}% +\def\XINT_float_sp_d #1#2.#3.#4.#5.% +{% + \expandafter\XINT_float_sp_e + \the\numexpr #5+#2+#4-\xint_c_i\expandafter.% + \romannumeral0\expandafter\XINT_split_fromleft_loop + \the\numexpr #4+\xint_c_i.{}#3\W\W\W\W\W\W\W\W\Z #1% +}% +\def\XINT_float_sp_e #1.#2.#3.% +{% + \expandafter\XINT_float_sp_f + \romannumeral0\XINT_rord_main {}#2% + \xint_relax + \xint_bye\xint_bye\xint_bye\xint_bye + \xint_bye\xint_bye\xint_bye\xint_bye + \xint_relax ;#1.% +}% +\def\XINT_float_sp_f #1% +{% + \ifnum #1<\xint_c_v + \expandafter\XINT_float_sp_ga\else\expandafter\XINT_float_sp_h\fi +}% +\def\XINT_float_sp_ga #1;#2.#3% +{% + \expandafter\XINT_float_sp_Wa + \romannumeral0\XINT_rord_main {}#1% + \xint_relax + \xint_bye\xint_bye\xint_bye\xint_bye + \xint_bye\xint_bye\xint_bye\xint_bye + \xint_relax e#2% +}% +\def\XINT_float_sp_h #1;#2.#3% +{% + \expandafter#3% + \romannumeral0\XINT_addm_A 0{}1000\W\X\Y\Z #1000\W\X\Y\Z e#2% +}% +\def\XINT_float_sp_Wa #1{ #1.}% +\def\XINT_float_fork #1% +{% + \xint_UDsignfork + #1\XINT_float_J + -{\XINT_float_K #1}% + \krof +}% +\def\XINT_float_J {\expandafter-\romannumeral0\XINT_float_K }% +\def\XINT_float_K #1.#2% {% \expandafter\XINT_float_L \the\numexpr\xintLength{#1}\expandafter.\the\numexpr #2+\xint_c_ii.{#1}{#2}% @@ -1820,9 +1893,9 @@ }% \def\XINT_float_N #1.#2.#3.% {% - \ifnum #1>#3 \xint_dothis\XINT_float_N_Blong\fi - \ifnum #1=\xint_c_i\xint_dothis\XINT_float_N_Bshort\fi - \xint_orthat{\XINT_float_P 0.}% + \ifnum #1>#3 + \expandafter\XINT_float_N_Blong + \else\expandafter\XINT_float_P\fi #1.#2.#3.% }% \def\XINT_float_N_Blong #1.#2.#3.#4% @@ -1831,27 +1904,12 @@ \the\numexpr #2-#1+#3\expandafter.% \romannumeral0\XINT_split_fromleft_loop #3.{}#4\W\W\W\W\W\W\W\W\Z {#3}% }% -\def\XINT_float_NaP #1.#2.#3.#4{\XINT_float_P 0.#4.#1.#4.{#2}}% -\def\XINT_float_N_Bshort 1.#1.#2.#3% -{% - \ifnum #3=\xint_c_i \xint_dothis{\XINT_float_P 1.}\fi - \xint_orthat{\XINT_float_P 0.}1.#1.#2.#3% -}% -\def\XINT_float_P #1.#2.#3.#4.#5#6#7#8#9% -{% - \expandafter #9\expandafter#1% - \the\numexpr #2-#6+#4-\xint_c_i.{#7}{#5}{#8}{#3}% -}% -\def\XINT_float_Q #1% +\def\XINT_float_NaP #1.#2.#3.#4{\XINT_float_P #4.#1.#4.{#2}}% +\def\XINT_float_P #1.#2.#3.#4#5#6#7#8% {% - \if 1#1\expandafter\XINT_float_Ri\else\expandafter\XINT_float_Rii\fi + \expandafter #8\the\numexpr #1-#5+#3-\xint_c_i.{#6}{#4}{#7}{#2}% }% -\def\XINT_float_Ri #1.#2#3% -{% - \expandafter\XINT_float_Sa - \romannumeral0\XINT_dsx_addzerosnofuss {#1}{#2}\Z {#1}% -}% -\def\XINT_float_Rii #1.#2#3% +\def\XINT_float_Q #1.#2#3% {% \expandafter\XINT_float_Sa \romannumeral0\xintiiquo{\XINT_dsx_addzerosnofuss {#1}{#2}}{#3}\Z {#1}% @@ -1908,71 +1966,61 @@ }% \def\XINT_float_Y #1.#2{ #2e#1}% \def\XINTinFloat {\romannumeral0\XINTinfloat }% -\def\XINTinfloat [#1]#2% +\def\XINTinfloat + {\expandafter\XINT_infloat_clean\romannumeral0\XINT_infloat}% +\def\XINT_infloat_clean #1% + {\if #1!\xint_dothis\XINT_infloat_clean_a\fi\xint_orthat{ }#1}% +\def\XINT_infloat_clean_a !#1.#2[#3]% {% - \expandafter\XINT_infloat\the\numexpr #1\expandafter.% - \romannumeral0\expandafter\XINT_infloat_in - \romannumeral`&&@#2/\XINT_W[\XINT_W\XINT_T\XINT_infloat_Q + \expandafter\XINT_infloat_sp_done + \the\numexpr #3-#1\expandafter.% + \romannumeral0\XINT_dsx_addzerosnofuss {#1}{#2};% }% -\def\XINT_infloat #1.#2{#2#1.}% -\def\XINT_infloat_in #1[#2% +\def\XINT_infloat_sp_done #1.#2;{ #2[#1]}% +\def\XINTinFloatS {\romannumeral0\XINTinfloatS}% +\def\XINTinfloatS + {\expandafter\XINT_infloatS_clean\romannumeral0\XINT_infloat}% +\def\XINT_infloatS_clean #1% + {\if #1!\xint_dothis\XINT_infloatS_clean_a\fi\xint_orthat{ }#1}% +\def\XINT_infloatS_clean_a !#1.{ }% +\def\XINT_infloat [#1]#2% {% - \xint_UDXINTWfork - #2\XINT_infloat_gen - \XINT_W\XINT_infloat_res_a - \krof - #1[#2% + \expandafter\XINT_infloat_a\the\numexpr #1\expandafter.% + \romannumeral0\XINT_infrac {#2}\XINT_infloat_Q }% -\edef\XINT_infloat_gen {\noexpand\expandafter\space\noexpand\expandafter - \noexpand\XINT_infloat_a - \noexpand\romannumeral0\noexpand\XINT_frac_gen }% -\def\XINT_infloat_res_a #1% +\def\XINT_infloat_a #1.#2#3#4% {% - \xint_gob_til_zero #1\XINT_infloat_res_zero 0\XINT_infloat_res_b #1% + \if\romannumeral0\XINT_isone#4XY1\expandafter\XINT_infloat_sp + \else\expandafter\XINT_float_fork\fi #3.{#1}{#2}{#4}% }% -\def\XINT_infloat_res_zero #1\XINT_infloat_Q { \XINT_infloat_sp_zero}% -\def\XINT_infloat_sp_zero #1.{ 0[0]}% -\def\XINT_infloat_res_b #1/#2% +\def\XINT_infloat_sp #1% {% - \xint_UDXINTWfork - #2\XINT_infloat_res_ca - \XINT_W\XINT_infloat_res_cb + \xint_UDzerominusfork + #1-\XINT_infloat_spzero + 0#1\XINT_infloat_spneg + 0-{\XINT_infloat_sppos #1}% \krof - #1/#2% -}% -\def\XINT_infloat_res_ca #1[#2]/\XINT_W[\XINT_W\XINT_T\XINT_infloat_Q - { \XINT_infloat_sp #1.#2.}% -\def\XINT_infloat_res_cb #1/#2[% - {\expandafter\XINT_infloat_res_cc\romannumeral`&&@#2~#1[}% -\edef\XINT_infloat_res_cc #1~#2[#3]/\XINT_W[\XINT_W\XINT_T - {\noexpand\expandafter\space\noexpand\expandafter - \noexpand\XINT_infloat_a\noexpand\expandafter - {\noexpand\the\numexpr #3}{#2}{#1}}% -\def\XINT_infloat_sp #1.#2% -{% - \if-#2\xint_dothis{\expandafter-\romannumeral0\XINT_infloat_sp_a {}}\fi - \xint_orthat{\XINT_infloat_sp_a #2}#1.% }% -\def\XINT_infloat_sp_a #1#2.#3.% +\def\XINT_infloat_spzero .#1#2#3#4{ 0[0]}% +\def\XINT_infloat_spneg + {\expandafter\XINT_infloat_spnegend\romannumeral0\XINT_infloat_sppos}% +\def\XINT_infloat_spnegend #1% + {\if#1!\expandafter\XINT_infloat_spneg_needzeros\fi -#1}% +\def\XINT_infloat_spneg_needzeros -!#1.{!#1.-}% +\def\XINT_infloat_sppos #1.#2#3#4#5% {% - \expandafter\XINT_infloat_sp_b\the\numexpr#2-\xintLength{#1#3}.#1#3.#2.% + \expandafter\XINT_infloat_sp_b\the\numexpr#2-\xintLength{#1}.#1.#2.#3.% }% \def\XINT_infloat_sp_b #1% {% \xint_UDzerominusfork #1-\XINT_infloat_sp_quick 0#1\XINT_infloat_sp_c - 0-{\XINT_infloat_sp_addzeroes #1}% + 0-{\XINT_infloat_sp_needzeros #1}% \krof }% \def\XINT_infloat_sp_quick .#1.#2.#3.{ #1[#3]}% -\def\XINT_infloat_sp_addzeroes #1.#2.#3.#4.% -{% - \expandafter\XINT_infloat_sp_done - \the\numexpr #4-#1\expandafter.% - \romannumeral0\XINT_dsx_addzerosnofuss {#1}{#2};% -}% -\def\XINT_infloat_sp_done #1.#2;{ #2[#1]}% +\def\XINT_infloat_sp_needzeros #1.#2.#3.#4.{!#1.#2[#4]}% \def\XINT_infloat_sp_c #1.#2% {% \if #29\xint_dothis {\XINT_infloat_sp_d\XINT_infloat_Wb }\fi @@ -2017,30 +2065,7 @@ {% \expandafter\XINT_infloat_sp_done\the\numexpr #1+#3+#4.#2;% }% -\def\XINT_infloat_a #1.#2#3% #1=P, #2=n, #3=A, #4=B -{% - \XINT_infloat_fork #3\Z {#1}{#2}% #1 = precision, #2=n -}% -\def\XINT_infloat_fork #1% -{% - \xint_UDzerominusfork - #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_J {\expandafter-\romannumeral0\XINT_float_K }% -\def\XINT_infloat_Q #1% -{% - \if 1#1\expandafter\XINT_infloat_Ri\else\expandafter\XINT_infloat_Rii\fi -}% -\def\XINT_infloat_Ri #1.#2#3% -{% - \expandafter\XINT_infloat_Sa - \romannumeral0\XINT_dsx_addzerosnofuss {#1}{#2}\Z {#1}% -}% -\def\XINT_infloat_Rii #1.#2#3% +\def\XINT_infloat_Q #1.#2#3% {% \expandafter\XINT_infloat_Sa \romannumeral0\xintiiquo{\XINT_dsx_addzerosnofuss {#1}{#2}}{#3}\Z {#1}% @@ -2126,8 +2151,7 @@ \krof }% \def\XINT_pfloat_zero #1;#2.{ 0.}% -\def\XINT_pfloat_neg - {\expandafter\xint_minus_thenstop\romannumeral0\XINT_pfloat_pos }% +\def\XINT_pfloat_neg {\expandafter-\romannumeral0\XINT_pfloat_pos }% \def\XINT_pfloat_pos #1e#2;#3.% {% \ifnum #2>\xint_c_v \xint_dothis\XINT_pfloat_no\fi @@ -2174,7 +2198,7 @@ \def\xintFloatAdd {\romannumeral0\xintfloatadd }% \def\xintfloatadd #1{\XINT_fladd_chkopt \xintfloat #1\xint_relax }% \def\XINTinFloatAdd {\romannumeral0\XINTinfloatadd }% -\def\XINTinfloatadd #1{\XINT_fladd_chkopt \XINTinfloat #1\xint_relax }% +\def\XINTinfloatadd #1{\XINT_fladd_chkopt \XINTinfloatS #1\xint_relax }% \def\XINT_fladd_chkopt #1#2% {% \ifx [#2\expandafter\XINT_fladd_opt @@ -2217,7 +2241,7 @@ \def\xintFloatSub {\romannumeral0\xintfloatsub }% \def\xintfloatsub #1{\XINT_flsub_chkopt \xintfloat #1\xint_relax }% \def\XINTinFloatSub {\romannumeral0\XINTinfloatsub }% -\def\XINTinfloatsub #1{\XINT_flsub_chkopt \XINTinfloat #1\xint_relax }% +\def\XINTinfloatsub #1{\XINT_flsub_chkopt \XINTinfloatS #1\xint_relax }% \def\XINT_flsub_chkopt #1#2% {% \ifx [#2\expandafter\XINT_flsub_opt @@ -2241,7 +2265,7 @@ \def\xintFloatMul {\romannumeral0\xintfloatmul }% \def\xintfloatmul #1{\XINT_flmul_chkopt \xintfloat #1\xint_relax }% \def\XINTinFloatMul {\romannumeral0\XINTinfloatmul }% -\def\XINTinfloatmul #1{\XINT_flmul_chkopt \XINTinfloat #1\xint_relax }% +\def\XINTinfloatmul #1{\XINT_flmul_chkopt \XINTinfloatS #1\xint_relax }% \def\XINT_flmul_chkopt #1#2% {% \ifx [#2\expandafter\XINT_flmul_opt @@ -2252,7 +2276,7 @@ {% #1[\XINTdigits]% {\expandafter\XINT_FL_mul_a - \romannumeral0\XINTinfloat[\XINTdigits]{#2}\XINTdigits.{#3}}% + \romannumeral0\XINTinfloatS[\XINTdigits]{#2}\XINTdigits.{#3}}% }% \def\XINT_flmul_opt #1[\xint_relax #2]%#3#4% {% @@ -2260,17 +2284,17 @@ }% \def\XINT_flmul_opt_a #1.#2#3#4% {% - #2[#1]{\expandafter\XINT_FL_mul_a\romannumeral0\XINTinfloat[#1]{#3}#1.{#4}}% + #2[#1]{\expandafter\XINT_FL_mul_a\romannumeral0\XINTinfloatS[#1]{#3}#1.{#4}}% }% \def\XINT_FL_mul_a #1[#2]#3.#4% {% - \expandafter\XINT_FL_mul_b\romannumeral0\XINTinfloat [#3]{#4}#1[#2]% + \expandafter\XINT_FL_mul_b\romannumeral0\XINTinfloatS[#3]{#4}#1[#2]% }% \def\XINT_FL_mul_b #1[#2]#3[#4]{\xintE{\xintiiMul {#3}{#1}}{#4+#2}}% \def\xintFloatDiv {\romannumeral0\xintfloatdiv }% \def\xintfloatdiv #1{\XINT_fldiv_chkopt \xintfloat #1\xint_relax }% \def\XINTinFloatDiv {\romannumeral0\XINTinfloatdiv }% -\def\XINTinfloatdiv #1{\XINT_fldiv_chkopt \XINTinfloat #1\xint_relax }% +\def\XINTinfloatdiv #1{\XINT_fldiv_chkopt \XINTinfloatS #1\xint_relax }% \def\XINT_fldiv_chkopt #1#2% {% \ifx [#2\expandafter\XINT_fldiv_opt @@ -2281,7 +2305,7 @@ {% #1[\XINTdigits]% {\expandafter\XINT_FL_div_a - \romannumeral0\XINTinfloat[\XINTdigits]{#2}\XINTdigits.{#3}}% + \romannumeral0\XINTinfloatS[\XINTdigits]{#2}\XINTdigits.{#3}}% }% \def\XINT_fldiv_opt #1[\xint_relax #2]%#3#4% {% @@ -2289,17 +2313,17 @@ }% \def\XINT_fldiv_opt_a #1.#2#3#4% {% - #2[#1]{\expandafter\XINT_FL_div_a\romannumeral0\XINTinfloat[#1]{#3}#1.{#4}}% + #2[#1]{\expandafter\XINT_FL_div_a\romannumeral0\XINTinfloatS[#1]{#3}#1.{#4}}% }% \def\XINT_FL_div_a #1[#2]#3.#4% {% - \expandafter\XINT_FL_div_b\romannumeral0\XINTinfloat[#3]{#4}#1[#2]% + \expandafter\XINT_FL_div_b\romannumeral0\XINTinfloatS[#3]{#4}#1[#2]% }% \def\XINT_FL_div_b #1[#2]#3[#4]{\xintE{#3/#1}{#4-#2}}% \def\xintFloatPow {\romannumeral0\xintfloatpow}% \def\xintfloatpow #1{\XINT_flpow_chkopt \xintfloat #1\xint_relax }% \def\XINTinFloatPow {\romannumeral0\XINTinfloatpow }% -\def\XINTinfloatpow #1{\XINT_flpow_chkopt \XINTinfloat #1\xint_relax }% +\def\XINTinfloatpow #1{\XINT_flpow_chkopt \XINTinfloatS #1\xint_relax }% \def\XINT_flpow_chkopt #1#2% {% \ifx [#2\expandafter\XINT_flpow_opt @@ -2452,11 +2476,11 @@ \def\xintFloatPower {\romannumeral0\xintfloatpower}% \def\xintfloatpower #1{\XINT_flpower_chkopt \xintfloat #1\xint_relax }% \def\XINTinFloatPower {\romannumeral0\XINTinfloatpower }% -\def\XINTinfloatpower #1{\XINT_flpower_chkopt \XINTinfloat #1\xint_relax }% +\def\XINTinfloatpower #1{\XINT_flpower_chkopt \XINTinfloatS #1\xint_relax }% \def\XINTinFloatPowerH {\romannumeral0\XINTinfloatpowerH }% \def\XINTinfloatpowerH #1#2% {\expandafter\XINT_flpowerh_a \romannumeral0\xinttrunc 1{#2}.0;% - \XINTdigits.{#1}{\XINTinfloat[\XINTdigits]}}% + \XINTdigits.{#1}{\XINTinfloatS[\XINTdigits]}}% \def\XINT_flpowerh_a #1.#2% {% \ifnum#2>\xint_c_iv\xint_dothis\XINT_flpowerh_b\fi @@ -2634,8 +2658,8 @@ 0-{\XINT_FL_fac_fork_b #1}% \krof }% -\def\XINT_FL_fac_iszero #1.#2#3#4#5{#5{1/1[0]}}% -\def\XINT_FL_fac_isneg #1.#2#3#4#5{\expandafter\xintError:FactorialOfNegative #5{0/1[0]}}% +\def\XINT_FL_fac_iszero #1.#2#3#4#5{#5{1[0]}}% +\def\XINT_FL_fac_isneg #1.#2#3#4#5{\expandafter\xintError:FactorialOfNegative #5{0[0]}}% \def\XINT_FL_fac_fork_b #1.% {% \ifnum #1>\xint_c_x^viii_mone\xint_dothis\XINT_FL_fac_toobig\fi @@ -2645,7 +2669,7 @@ \xint_orthat\XINT_FL_fac_small #1.% }% -\def\XINT_FL_fac_toobig #1.#2#3#4#5{\expandafter\xintError:TooBigFactorial #5{1/1[0]}}% +\def\XINT_FL_fac_toobig #1.#2#3#4#5{\expandafter\xintError:TooBigFactorial #5{1[0]}}% \def\XINT_FL_fac_vbig {\expandafter\XINT_FL_fac_vbigloop_a \the\numexpr \XINT_FL_fac_increaseP \xint_c_i }% @@ -2850,8 +2874,8 @@ \xint_dothis\XINT_FL_pfac_outofrange\fi \xint_orthat \XINT_FL_pfac_increaseP #1#2.#3.% }% -\def\XINT_FL_pfac_outofrange #1.#2.#3#4#5{\xintError:OutOfRangePFac #5{0/1[0]}}% -\def\XINT_FL_pfac_one #1.#2.#3#4#5{#5{1/1[0]}}% +\def\XINT_FL_pfac_outofrange #1.#2.#3#4#5{\xintError:OutOfRangePFac #5{0[0]}}% +\def\XINT_FL_pfac_one #1.#2.#3#4#5{#5{1[0]}}% \def\XINT_FL_pfac_increaseP #1.#2.#3#4% {% \expandafter\XINT_FL_pfac_a @@ -3021,8 +3045,8 @@ #1#2.#3#4.#5.% }% \def\XINT_FL_binom_outofrange #1.#2.#3.#4.#5% - {\xintError:OutOfRangeBinomial #5[#4]{0/1[0]}}% -\def\XINT_FL_binom_one #1.#2.#3.#4.#5{#5[#4]{1/1[0]}}% + {\xintError:OutOfRangeBinomial #5[#4]{0[0]}}% +\def\XINT_FL_binom_one #1.#2.#3.#4.#5{#5[#4]{1[0]}}% \def\XINT_FL_binom_aa #1.#2.#3.#4.#5% {% #5[#4]{\xintDiv{\XINT_FL_pfac_increaseP @@ -3107,7 +3131,11 @@ }% \def\XINT_flsqrt_finish #1#2.#3.#4.#5.#6.#7.#8{#8[#6]{#3#1[#7]}}% \def\XINT_flsqrt_f 5#1.% - {\xintiiifGt{\xintiNum{#1}}{2}{\XINT_flsqrt_finish 5.}{\XINT_flsqrt_again}}% + {\expandafter\XINT_flsqrt_g\romannumeral0\xintinum{#1}\relax.}% +\def\XINT_flsqrt_g #1#2#3.{\if\relax#2\xint_dothis{\XINT_flsqrt_h #1}\fi + \xint_orthat{\XINT_flsqrt_finish 5.}}% +\def\XINT_flsqrt_h #1{\ifnum #1<\xint_c_iii\xint_dothis{\XINT_flsqrt_again}\fi + \xint_orthat{\XINT_flsqrt_finish 5.}}% \def\XINT_flsqrt_again #1.#2.% {% \expandafter\XINT_flsqrt_again_a\the\numexpr #2+\xint_c_viii.% diff --git a/Master/texmf-dist/tex/generic/xint/xintgcd.sty b/Master/texmf-dist/tex/generic/xint/xintgcd.sty index 78537efcf48..fc4a69848d2 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 1.2f 2016/03/12 +%% The xint bundle 1.2g 2016/03/19 %% Copyright (C) 2013-2016 by Jean-Francois Burnol %% xintgcd: Euclidean algorithm with xint package %% --------------------------------------------------------------- @@ -70,7 +70,7 @@ \XINTsetupcatcodes% defined in xintkernel.sty \XINT_providespackage \ProvidesPackage{xintgcd}% - [2016/03/12 1.2f Euclide algorithm with xint package (JFB)]% + [2016/03/19 1.2g Euclide algorithm with xint package (JFB)]% \def\xintGCD {\romannumeral0\xintgcd }% \def\xintgcd #1% {% diff --git a/Master/texmf-dist/tex/generic/xint/xintkernel.sty b/Master/texmf-dist/tex/generic/xint/xintkernel.sty index 9a001625dae..2a5828c2bf1 100644 --- a/Master/texmf-dist/tex/generic/xint/xintkernel.sty +++ b/Master/texmf-dist/tex/generic/xint/xintkernel.sty @@ -21,7 +21,7 @@ %% same distribution. (The sources need not necessarily be %% in the same archive or directory.) %% --------------------------------------------------------------- -%% The xint bundle 1.2f 2016/03/12 +%% The xint bundle 1.2g 2016/03/19 %% Copyright (C) 2013-2016 by Jean-Francois Burnol %% xintkernel: Paraphernalia for the xint packages %% --------------------------------------------------------------- @@ -156,7 +156,7 @@ \fi \XINT_providespackage \ProvidesPackage {xintkernel}% - [2016/03/12 1.2f Paraphernalia for the xint packages (JFB)]% + [2016/03/19 1.2g Paraphernalia for the xint packages (JFB)]% \chardef\xint_c_ 0 \chardef\xint_c_i 1 \chardef\xint_c_ii 2 @@ -209,10 +209,10 @@ \long\def\xint_firstofone #1{#1}% \long\def\xint_firstoftwo #1#2{#1}% \long\def\xint_secondoftwo #1#2{#2}% +\long\def\xint_gobble_thenstop #1{ }% \long\def\xint_firstofone_thenstop #1{ #1}% \long\def\xint_firstoftwo_thenstop #1#2{ #1}% \long\def\xint_secondoftwo_thenstop #1#2{ #2}% -\def\xint_minus_thenstop { -}% \def\xint_exchangetwo_keepbraces #1#2{{#2}{#1}}% \long\def\xint_gob_til_R #1\R {}% \long\def\xint_gob_til_W #1\W {}% diff --git a/Master/texmf-dist/tex/generic/xint/xintseries.sty b/Master/texmf-dist/tex/generic/xint/xintseries.sty index b9523bf4231..d820b443a62 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 1.2f 2016/03/12 +%% The xint bundle 1.2g 2016/03/19 %% Copyright (C) 2013-2016 by Jean-Francois Burnol %% xintseries: Expandable partial sums with xint package %% --------------------------------------------------------------- @@ -70,7 +70,7 @@ \XINTsetupcatcodes% defined in xintkernel.sty \XINT_providespackage \ProvidesPackage{xintseries}% - [2016/03/12 1.2f Expandable partial sums with xint package (JFB)]% + [2016/03/19 1.2g 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 8fb291a28cd..0a21ba1e579 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 1.2f 2016/03/12 +%% The xint bundle 1.2g 2016/03/19 %% Copyright (C) 2013-2016 by Jean-Francois Burnol %% xinttools: Expandable and non-expandable utilities %% --------------------------------------------------------------- @@ -70,7 +70,7 @@ \XINTsetupcatcodes% defined in xintkernel.sty \XINT_providespackage \ProvidesPackage{xinttools}% - [2016/03/12 1.2f Expandable and non-expandable utilities (JFB)]% + [2016/03/19 1.2g Expandable and non-expandable utilities (JFB)]% \newtoks\XINT_toks \xint_firstofone{\let\XINT_sptoken= } %<- space here! \def\xintgodef {\global\xintodef }% @@ -231,58 +231,58 @@ \long\def\XINT_lws_end\xint_bye\XINT_lws_loop_b #1#2#3{ #1}% \def\xintNthElt {\romannumeral0\xintnthelt }% \def\xintNthEltNoExpand {\romannumeral0\xintntheltnoexpand }% -\def\xintnthelt #1#2% -{% - \expandafter\XINT_nthelt_a\the\numexpr #1\expandafter.% - \expandafter{\romannumeral`&&@#2}% -}% -\def\xintntheltnoexpand #1% -{% - \expandafter\XINT_nthelt_a\the\numexpr #1.% -}% -\def\XINT_nthelt_a #1#2.% +\long\def\xintnthelt #1#2{\expandafter\XINT_nthelt_a\the\numexpr #1\expandafter.% + \expandafter{\romannumeral`&&@#2}}% +\def\xintntheltnoexpand #1{\expandafter\XINT_nthelt_a\the\numexpr #1.}% +\def\XINT_nthelt_a #1% {% \xint_UDzerominusfork - #1-{\XINT_nthelt_bzero}% - 0#1{\XINT_nthelt_bneg {#2}}% - 0-{\XINT_nthelt_bpos {#1#2}}% + #1-{\XINT_nthelt_zero }% + 0#1{\XINT_nthelt_neg }% + 0-{\XINT_nthelt_pos #1}% \krof }% -\long\def\XINT_nthelt_bzero #1% +\def\XINT_nthelt_zero .{\xintlength }% +\long\def\XINT_nthelt_neg #1.#2% {% - \XINT_length_loop 0.#1\xint_relax\xint_relax\xint_relax\xint_relax - \xint_relax\xint_relax\xint_relax\xint_relax\xint_bye + \expandafter\XINT_nthelt_neg_a\the\numexpr + \XINT_length_loop + 0.#2\xint_relax\xint_relax\xint_relax\xint_relax + \xint_relax\xint_relax\xint_relax\xint_relax\xint_bye +\xint_c_i -#1.% + #2\xint_relax\xint_relax\xint_relax\xint_relax + \xint_relax\xint_relax\xint_relax\xint_relax\xint_bye }% -\long\def\XINT_nthelt_bneg #1#2% +\def\XINT_nthelt_neg_a #1% {% - \expandafter\XINT_nthelt_loop_a\expandafter {\the\numexpr #1\expandafter}% - \romannumeral0\xintrevwithbracesnoexpand {#2}% - \xint_relax\xint_relax\xint_relax\xint_relax - \xint_relax\xint_relax\xint_relax\xint_relax\xint_bye + \xint_UDzerominusfork + #1-{\XINT_nthelt_none }% + 0#1{\XINT_nthelt_none }% + 0-{\XINT_nthelt_loop_a #1}% + \krof }% -\long\def\XINT_nthelt_bpos #1#2% +\long\def\XINT_nthelt_none #1\xint_bye{ }% +\long\def\XINT_nthelt_pos #1.#2% {% - \XINT_nthelt_loop_a {#1}#2\xint_relax\xint_relax\xint_relax\xint_relax - \xint_relax\xint_relax\xint_relax\xint_relax\xint_bye + \XINT_nthelt_loop_a #1.% + #2\xint_relax\xint_relax\xint_relax\xint_relax + \xint_relax\xint_relax\xint_relax\xint_relax\xint_bye }% -\def\XINT_nthelt_loop_a #1% +\def\XINT_nthelt_loop_a #1.% {% \ifnum #1>\xint_c_viii \expandafter\XINT_nthelt_loop_b \else - \XINT_nthelt_getit - \fi - {#1}% + \expandafter\XINT_nthelt_getit + \fi #1.% }% -\long\def\XINT_nthelt_loop_b #1#2#3#4#5#6#7#8#9% +\long\def\XINT_nthelt_loop_b #1.#2#3#4#5#6#7#8#9% {% - \xint_gob_til_xint_relax #9\XINT_nthelt_silentend\xint_relax - \expandafter\XINT_nthelt_loop_a\expandafter{\the\numexpr #1-\xint_c_viii}% + \xint_gob_til_xint_relax #9\XINT_nthelt_none\xint_relax + \expandafter\XINT_nthelt_loop_a\the\numexpr #1-\xint_c_viii.% }% -\def\XINT_nthelt_silentend #1\xint_bye { }% -\def\XINT_nthelt_getit\fi #1% +\def\XINT_nthelt_getit #1.% {% - \fi\expandafter\expandafter\expandafter\XINT_nthelt_finish + \expandafter\expandafter\expandafter\XINT_nthelt_finish \csname xint_gobble_\romannumeral\numexpr#1-\xint_c_i\endcsname }% \long\edef\XINT_nthelt_finish #1#2\xint_bye @@ -290,58 +290,60 @@ \noexpand\xint_gobble_ii\xint_relax\space #1}% \def\xintKeep {\romannumeral0\xintkeep }% \def\xintKeepNoExpand {\romannumeral0\xintkeepnoexpand }% -\def\xintkeep #1#2% -{% - \expandafter\XINT_keep_a\the\numexpr #1\expandafter.% - \expandafter{\romannumeral`&&@#2}% -}% -\def\xintkeepnoexpand #1% -{% - \expandafter\XINT_keep_a\the\numexpr #1.% -}% -\def\XINT_keep_a #1#2.% +\long\def\xintkeep #1#2{\expandafter\XINT_keep_a\the\numexpr #1\expandafter.% + \expandafter{\romannumeral`&&@#2}}% +\def\xintkeepnoexpand #1{\expandafter\XINT_keep_a\the\numexpr #1.}% +\def\XINT_keep_a #1% {% \xint_UDzerominusfork - #1-{\expandafter\space\xint_gobble_i }% - 0#1{\XINT_keep_bneg_a {#2}}% - 0-{\XINT_keep_bpos {#1#2}}% + #1-{\XINT_keep_keepnone }% + 0#1{\XINT_keep_neg }% + 0-{\XINT_keep_pos #1}% \krof }% -\long\def\XINT_keep_bneg_a #1#2% +\long\def\XINT_keep_keepnone .#1{ }% +\long\def\XINT_keep_neg #1.#2% {% - \expandafter\XINT_keep_bneg_b \the\numexpr \xintLength{#2}-#1.{#2}% + \expandafter\XINT_keep_neg_a\the\numexpr + \XINT_length_loop + 0.#2\xint_relax\xint_relax\xint_relax\xint_relax + \xint_relax\xint_relax\xint_relax\xint_relax\xint_bye -#1.% + #2\xint_relax\xint_relax\xint_relax\xint_relax + \xint_relax\xint_relax\xint_relax\xint_relax\xint_bye }% -\def\XINT_keep_bneg_b #1#2.% +\def\XINT_keep_neg_a #1% {% \xint_UDzerominusfork - #1-{\xint_firstofone_thenstop }% - 0#1{\xint_firstofone_thenstop }% - 0-{\XINT_trim_bpos {#1#2}}% + #1-{\XINT_keep_keepall }% + 0#1{\XINT_keep_keepall }% + 0-{\XINT_trim_loop_a #1}% \krof }% -\long\def\XINT_keep_bpos #1#2% +\def\XINT_keep_keepall #1.{\XINT_keep_keepall_a \space}% +\def\XINT_keep_keepall_a #1\xint_relax #2\xint_bye {#1}% +\long\def\XINT_keep_pos #1.#2% {% - \XINT_keep_loop_a {#1}{}#2\xint_relax\xint_relax\xint_relax\xint_relax - \xint_relax\xint_relax\xint_relax\xint_bye + \XINT_keep_loop_a #1.% + {}#2\xint_relax\xint_relax\xint_relax\xint_relax + \xint_relax\xint_relax\xint_relax\xint_bye }% -\def\XINT_keep_loop_a #1% +\def\XINT_keep_loop_a #1.% {% \ifnum #1>\xint_c_vi \expandafter\XINT_keep_loop_b \else - \XINT_keep_finish + \expandafter\XINT_keep_finish \fi - {#1}% + #1.% }% -\long\def\XINT_keep_loop_b #1#2#3#4#5#6#7#8#9% +\long\def\XINT_keep_loop_b #1.#2#3#4#5#6#7#8#9% {% \xint_gob_til_xint_relax #9\XINT_keep_enda\xint_relax - \expandafter\XINT_keep_loop_c\expandafter{\the\numexpr #1-\xint_c_vii}% + \expandafter\XINT_keep_loop_c\the\numexpr #1-\xint_c_vii.% {{#3}{#4}{#5}{#6}{#7}{#8}{#9}}{#2}% }% -\long\def\XINT_keep_loop_c #1#2#3{\XINT_keep_loop_a {#1}{#3#2}}% -\long\def\XINT_keep_enda\xint_relax - \expandafter\XINT_keep_loop_c\expandafter #1#2#3#4\xint_bye +\long\def\XINT_keep_loop_c #1.#2#3{\XINT_keep_loop_a #1.{#3#2}}% +\long\def\XINT_keep_enda #1.#2#3#4\xint_bye {% \XINT_keep_endb #4\W\W\W\W\W\W\Z #2{#3}% }% @@ -357,205 +359,198 @@ \W\XINT_keep_endc_vi\Z }% \long\def\XINT_keep_endc_ #1\Z #2#3#4#5#6#7#8#9{ #9}% -\long\def\XINT_keep_endc_i #1\Z #2#3#4#5#6#7#8#9{ #9{#2}}% -\long\def\XINT_keep_endc_ii #1\Z #2#3#4#5#6#7#8#9{ #9{#2}{#3}}% -\long\def\XINT_keep_endc_iii #1\Z #2#3#4#5#6#7#8#9{ #9{#2}{#3}{#4}}% -\long\def\XINT_keep_endc_iv #1\Z #2#3#4#5#6#7#8#9{ #9{#2}{#3}{#4}{#5}}% -\long\def\XINT_keep_endc_v #1\Z #2#3#4#5#6#7#8#9{ #9{#2}{#3}{#4}{#5}{#6}}% -\long\def\XINT_keep_endc_vi\Z #1#2#3#4#5#6#7#8{ #8{#1}{#2}{#3}{#4}{#5}{#6}}% -\long\def\XINT_keep_finish\fi #1#2#3#4#5#6#7#8#9\xint_bye -{% - \fi\XINT_keep_finish_loop_a {#1}{}{#3}{#4}{#5}{#6}{#7}{#8}\Z {#2}% -}% -\def\XINT_keep_finish_loop_a #1% -{% - \xint_gob_til_zero #1\XINT_keep_finish_z0% - \expandafter\XINT_keep_finish_loop_b\expandafter {\the\numexpr #1-\xint_c_i}% -}% -\long\def\XINT_keep_finish_z0% - \expandafter\XINT_keep_finish_loop_b\expandafter #1#2#3\Z #4{ #4#2}% -\long\def\XINT_keep_finish_loop_b #1#2#3% -{% - \xint_gob_til_xint_relax #3\XINT_keep_finish_exit\xint_relax - \XINT_keep_finish_loop_c {#1}{#2}{#3}% -}% -\long\def\XINT_keep_finish_exit\xint_relax - \XINT_keep_finish_loop_c #1#2#3\Z #4{ #4#2}% -\long\def\XINT_keep_finish_loop_c #1#2#3% - {\XINT_keep_finish_loop_a {#1}{#2{#3}}}% +\long\def\XINT_keep_endc_i #1\Z #2#3#4#5#6#7#8#9{#9{#2}}% +\long\def\XINT_keep_endc_ii #1\Z #2#3#4#5#6#7#8#9{#9{#2}{#3}}% +\long\def\XINT_keep_endc_iii #1\Z #2#3#4#5#6#7#8#9{#9{#2}{#3}{#4}}% +\long\def\XINT_keep_endc_iv #1\Z #2#3#4#5#6#7#8#9{#9{#2}{#3}{#4}{#5}}% +\long\def\XINT_keep_endc_v #1\Z #2#3#4#5#6#7#8#9{#9{#2}{#3}{#4}{#5}{#6}}% +\long\def\XINT_keep_endc_vi\Z #1#2#3#4#5#6#7#8{#8{#1}{#2}{#3}{#4}{#5}{#6}}% +\long\def\XINT_keep_finish #1.#2#3#4#5#6#7#8#9\xint_bye +{% + \XINT_keep_finish_a #1.% + #3\xint_c_ #4\xint_c_i #5\xint_c_ii #6\xint_c_iii #7\xint_c_iv + #8\xint_c_v\xint_relax\xint_c_vi\xint_bye + {#3}{#4}{#5}{#6}{#7}{#8}\xint_bye {#2}% +}% +\long\def\XINT_keep_finish_a #1.#2\xint_relax #3#4\xint_bye +{% + \csname XINT_keep_finish_b\romannumeral\ifnum#1>#3#3\else#1\fi\endcsname +}% +\long\def\XINT_keep_finish_b #1\xint_bye #2{ #2}% +\long\def\XINT_keep_finish_bi #1#2\xint_bye #3{#3{#1}}% +\long\def\XINT_keep_finish_bii #1#2#3\xint_bye #4{#4{#1}{#2}}% +\long\def\XINT_keep_finish_biii#1#2#3#4\xint_bye #5{#5{#1}{#2}{#3}}% +\long\def\XINT_keep_finish_biv #1#2#3#4#5\xint_bye #6{#6{#1}{#2}{#3}{#4}}% +\long\def\XINT_keep_finish_bv #1#2#3#4#5#6\xint_bye #7{#7{#1}{#2}{#3}{#4}{#5}}% +\long\def\XINT_keep_finish_bvi #1\xint_bye #2{#2#1}% \def\xintKeepUnbraced {\romannumeral0\xintkeepunbraced }% \def\xintKeepUnbracedNoExpand {\romannumeral0\xintkeepunbracednoexpand }% -\def\xintkeepunbraced #1#2% -{% - \expandafter\XINT_keepunbraced_a\the\numexpr #1\expandafter.% - \expandafter{\romannumeral`&&@#2}% -}% -\def\xintkeepnoexpand #1% -{% - \expandafter\XINT_keepunbraced_a\the\numexpr #1.% -}% -\def\XINT_keepunbraced_a #1#2.% +\long\def\xintkeepunbraced #1#2% + {\expandafter\XINT_keepunbr_a\the\numexpr #1\expandafter.% + \expandafter{\romannumeral`&&@#2}}% +\def\xintkeepunbracednoexpand #1% + {\expandafter\XINT_keepunbr_a\the\numexpr #1.}% +\def\XINT_keepunbr_a #1% {% \xint_UDzerominusfork - #1-{\expandafter\space\xint_gobble_i }% - 0#1{\XINT_keep_bneg_a {#2}}% - 0-{\XINT_keepunbraced_bpos {#1#2}}% + #1-{\XINT_keep_keepnone }% + 0#1{\XINT_keep_neg }% + 0-{\XINT_keepunbr_pos #1}% \krof }% -\long\def\XINT_keepunbraced_bpos #1#2% +\long\def\XINT_keepunbr_pos #1.#2% {% - \XINT_keepunbraced_loop_a {#1}{}#2% - \xint_relax\xint_relax\xint_relax\xint_relax - \xint_relax\xint_relax\xint_relax\xint_bye + \XINT_keepunbr_loop_a #1.% + {}#2\xint_relax\xint_relax\xint_relax\xint_relax + \xint_relax\xint_relax\xint_relax\xint_bye }% -\def\XINT_keepunbraced_loop_a #1% +\def\XINT_keepunbr_loop_a #1.% {% \ifnum #1>\xint_c_vi - \expandafter\XINT_keepunbraced_loop_b + \expandafter\XINT_keepunbr_loop_b \else - \XINT_keepunbraced_finish + \expandafter\XINT_keepunbr_finish \fi - {#1}% + #1.% }% -\long\def\XINT_keepunbraced_loop_b #1#2#3#4#5#6#7#8#9% +\long\def\XINT_keepunbr_loop_b #1.#2#3#4#5#6#7#8#9% {% - \xint_gob_til_xint_relax #9\XINT_keepunbraced_enda\xint_relax - \expandafter\XINT_keepunbraced_loop_c\expandafter - {\the\numexpr #1-\xint_c_vii}{#3}{#4}{#5}{#6}{#7}{#8}{#9}.{#2}% + \xint_gob_til_xint_relax #9\XINT_keepunbr_enda\xint_relax + \expandafter\XINT_keepunbr_loop_c\the\numexpr #1-\xint_c_vii.% + {#3}{#4}{#5}{#6}{#7}{#8}{#9}.{#2}% }% -\long\def\XINT_keepunbraced_loop_c #1#2#3#4#5#6#7#8.#9% - {\XINT_keepunbraced_loop_a {#1}{#9#2#3#4#5#6#7#8}}% -\long\def\XINT_keepunbraced_enda\xint_relax - \expandafter\XINT_keepunbraced_loop_c\expandafter #1#2.#3#4\xint_bye +\long\def\XINT_keepunbr_loop_c #1.#2#3#4#5#6#7#8.#9% + {\XINT_keepunbr_loop_a #1.{#9#2#3#4#5#6#7#8}}% +\long\def\XINT_keepunbr_enda #1.#2.#3#4\xint_bye {% - \XINT_keepunbraced_endb #4\W\W\W\W\W\W\Z #2{#3}% + \XINT_keepunbr_endb #4\W\W\W\W\W\W\Z #2{#3}% }% -\def\XINT_keepunbraced_endb #1#2#3#4#5#6#7\Z +\def\XINT_keepunbr_endb #1#2#3#4#5#6#7\Z {% \xint_gob_til_W - #1\XINT_keepunbraced_endc_ - #2\XINT_keepunbraced_endc_i - #3\XINT_keepunbraced_endc_ii - #4\XINT_keepunbraced_endc_iii - #5\XINT_keepunbraced_endc_iv - #6\XINT_keepunbraced_endc_v - \W\XINT_keepunbraced_endc_vi\Z -}% -\long\def\XINT_keepunbraced_endc_ #1\Z #2#3#4#5#6#7#8#9{ #9}% -\long\def\XINT_keepunbraced_endc_i #1\Z #2#3#4#5#6#7#8#9{ #9#2}% -\long\def\XINT_keepunbraced_endc_ii #1\Z #2#3#4#5#6#7#8#9{ #9#2#3}% -\long\def\XINT_keepunbraced_endc_iii #1\Z #2#3#4#5#6#7#8#9{ #9#2#3#4}% -\long\def\XINT_keepunbraced_endc_iv #1\Z #2#3#4#5#6#7#8#9{ #9#2#3#4#5}% -\long\def\XINT_keepunbraced_endc_v #1\Z #2#3#4#5#6#7#8#9{ #9#2#3#4#5#6}% -\long\def\XINT_keepunbraced_endc_vi\Z #1#2#3#4#5#6#7#8{ #8#1#2#3#4#5#6}% -\long\def\XINT_keepunbraced_finish\fi #1#2#3#4#5#6#7#8#9\xint_bye -{% - \fi\XINT_keepunbraced_finish_loop_a {#1}{}{#3}{#4}{#5}{#6}{#7}{#8}\Z {#2}% -}% -\def\XINT_keepunbraced_finish_loop_a #1% -{% - \xint_gob_til_zero #1\XINT_keepunbraced_finish_z0% - \expandafter\XINT_keepunbraced_finish_loop_b\expandafter - {\the\numexpr #1-\xint_c_i}% -}% -\long\def\XINT_keepunbraced_finish_z0% - \expandafter\XINT_keepunbraced_finish_loop_b\expandafter #1#2#3\Z #4{ #4#2}% -\long\def\XINT_keepunbraced_finish_loop_b #1#2#3% -{% - \xint_gob_til_xint_relax #3\XINT_keepunbraced_finish_exit\xint_relax - \XINT_keepunbraced_finish_loop_c {#1}{#2}{#3}% -}% -\long\def\XINT_keepunbraced_finish_exit\xint_relax - \XINT_keepunbraced_finish_loop_c #1#2#3\Z #4{ #4#2}% -\long\def\XINT_keepunbraced_finish_loop_c #1#2#3% - {\XINT_keepunbraced_finish_loop_a {#1}{#2#3}}% + #1\XINT_keepunbr_endc_ + #2\XINT_keepunbr_endc_i + #3\XINT_keepunbr_endc_ii + #4\XINT_keepunbr_endc_iii + #5\XINT_keepunbr_endc_iv + #6\XINT_keepunbr_endc_v + \W\XINT_keepunbr_endc_vi\Z +}% +\long\def\XINT_keepunbr_endc_ #1\Z #2#3#4#5#6#7#8#9{ #9}% +\long\def\XINT_keepunbr_endc_i #1\Z #2#3#4#5#6#7#8#9{ #9#2}% +\long\def\XINT_keepunbr_endc_ii #1\Z #2#3#4#5#6#7#8#9{ #9#2#3}% +\long\def\XINT_keepunbr_endc_iii #1\Z #2#3#4#5#6#7#8#9{ #9#2#3#4}% +\long\def\XINT_keepunbr_endc_iv #1\Z #2#3#4#5#6#7#8#9{ #9#2#3#4#5}% +\long\def\XINT_keepunbr_endc_v #1\Z #2#3#4#5#6#7#8#9{ #9#2#3#4#5#6}% +\long\def\XINT_keepunbr_endc_vi\Z #1#2#3#4#5#6#7#8{ #8#1#2#3#4#5#6}% +\long\def\XINT_keepunbr_finish #1.#2#3#4#5#6#7#8#9\xint_bye +{% + \XINT_keepunbr_finish_a #1.% + #3\xint_c_ #4\xint_c_i #5\xint_c_ii #6\xint_c_iii #7\xint_c_iv + #8\xint_c_v\xint_relax\xint_c_vi\xint_bye + {#3}{#4}{#5}{#6}{#7}{#8}\xint_bye {#2}% +}% +\long\def\XINT_keepunbr_finish_a #1.#2\xint_relax #3#4\xint_bye +{% + \csname XINT_keepunbr_finish_b\romannumeral\ifnum#1>#3#3\else#1\fi\endcsname +}% +\long\def\XINT_keepunbr_finish_b #1\xint_bye #2{ #2}% +\long\def\XINT_keepunbr_finish_bi #1#2\xint_bye #3{ #3#1}% +\long\def\XINT_keepunbr_finish_bii #1#2#3\xint_bye #4{ #4#1#2}% +\long\def\XINT_keepunbr_finish_biii#1#2#3#4\xint_bye #5{ #5#1#2#3}% +\long\def\XINT_keepunbr_finish_biv #1#2#3#4#5\xint_bye #6{ #6#1#2#3#4}% +\long\def\XINT_keepunbr_finish_bv #1#2#3#4#5#6\xint_bye #7{ #7#1#2#3#4#5}% +\long\def\XINT_keepunbr_finish_bvi #1#2#3#4#5#6\xint_bye #7{ #7#1#2#3#4#5#6}% \def\xintTrim {\romannumeral0\xinttrim }% \def\xintTrimNoExpand {\romannumeral0\xinttrimnoexpand }% -\def\xinttrim #1#2% -{% - \expandafter\XINT_trim_a\the\numexpr #1\expandafter.% - \expandafter{\romannumeral`&&@#2}% -}% -\def\xinttrimnoexpand #1% -{% - \expandafter\XINT_trim_a\the\numexpr #1.% -}% -\def\XINT_trim_a #1#2.% +\long\def\xinttrim #1#2{\expandafter\XINT_trim_a\the\numexpr #1\expandafter.% + \expandafter{\romannumeral`&&@#2}}% +\def\xinttrimnoexpand #1{\expandafter\XINT_trim_a\the\numexpr #1.}% +\def\XINT_trim_a #1% {% \xint_UDzerominusfork - #1-{\xint_firstofone_thenstop }% - 0#1{\XINT_trim_bneg_a {#2}}% - 0-{\XINT_trim_bpos {#1#2}}% + #1-{\XINT_trim_trimnone }% + 0#1{\XINT_trim_neg }% + 0-{\XINT_trim_pos #1}% \krof }% -\long\def\XINT_trim_bneg_a #1#2% +\long\def\XINT_trim_trimnone .#1{ #1}% +\long\def\XINT_trim_neg #1.#2% {% - \expandafter\XINT_trim_bneg_b \the\numexpr \xintLength{#2}-#1.{#2}% + \expandafter\XINT_trim_neg_a\the\numexpr + \XINT_length_loop + 0.#2\xint_relax\xint_relax\xint_relax\xint_relax + \xint_relax\xint_relax\xint_relax\xint_relax\xint_bye -#1.% + {}#2\xint_relax\xint_relax\xint_relax\xint_relax + \xint_relax\xint_relax\xint_relax\xint_bye }% -\def\XINT_trim_bneg_b #1#2.% +\def\XINT_trim_neg_a #1% {% \xint_UDzerominusfork - #1-{\expandafter\space\xint_gobble_i }% - 0#1{\expandafter\space\xint_gobble_i }% - 0-{\XINT_keep_bpos {#1#2}}% + #1-{\XINT_trim_trimall }% + 0#1{\XINT_trim_trimall }% + 0-{\XINT_keep_loop_a #1}% \krof }% -\long\def\XINT_trim_bpos #1#2% +\long\def\XINT_trim_trimall #1\xint_bye { }% +\long\def\XINT_trim_pos #1.#2% {% - \XINT_trim_loop_a {#1}#2\xint_relax\xint_relax\xint_relax\xint_relax - \xint_relax\xint_relax\xint_relax\xint_relax\xint_bye + \XINT_trim_loop_a #1.% + #2\xint_relax\xint_relax\xint_relax\xint_relax + \xint_relax\xint_relax\xint_relax\xint_relax\xint_bye }% -\def\XINT_trim_loop_a #1% +\def\XINT_trim_loop_a #1.% {% \ifnum #1>\xint_c_vii \expandafter\XINT_trim_loop_b \else - \XINT_trim_finish + \expandafter\XINT_trim_finish \fi - {#1}% + #1.% }% -\long\def\XINT_trim_loop_b #1#2#3#4#5#6#7#8#9% +\long\def\XINT_trim_loop_b #1.#2#3#4#5#6#7#8#9% {% \xint_gob_til_xint_relax #9\XINT_trim_silentend\xint_relax - \expandafter\XINT_trim_loop_a\expandafter{\the\numexpr #1-\xint_c_viii}% + \expandafter\XINT_trim_loop_a\the\numexpr #1-\xint_c_viii.% }% \def\XINT_trim_silentend #1\xint_bye { }% -\def\XINT_trim_finish\fi #1% +\def\XINT_trim_finish #1.% {% - \fi\expandafter\expandafter\expandafter\XINT_trim_finish_a + \expandafter\expandafter\expandafter\XINT_trim_finish_a \expandafter\expandafter\expandafter\space % avoids brace removal \csname xint_gobble_\romannumeral\numexpr#1\endcsname }% \long\def\XINT_trim_finish_a #1\xint_relax #2\xint_bye {#1}% \def\xintTrimUnbraced {\romannumeral0\xinttrimunbraced }% \def\xintTrimUnbracedNoExpand {\romannumeral0\xinttrimunbracednoexpand }% -\def\xinttrimunbraced #1#2% -{% - \expandafter\XINT_trimunbraced_a\the\numexpr #1\expandafter.% - \expandafter{\romannumeral`&&@#2}% -}% +\long\def\xinttrimunbraced #1#2% + {\expandafter\XINT_trimunbr_a\the\numexpr #1\expandafter.% + \expandafter{\romannumeral`&&@#2}}% \def\xinttrimunbracednoexpand #1% -{% - \expandafter\XINT_trimunbraced_a\the\numexpr #1.% -}% -\def\XINT_trimunbraced_a #1#2.% + {\expandafter\XINT_trimunbr_a\the\numexpr #1.}% +\def\XINT_trimunbr_a #1% {% \xint_UDzerominusfork - #1-{\xint_firstofone_thenstop }% - 0#1{\XINT_trimunbraced_bneg_a {#2}}% - 0-{\XINT_trim_bpos {#1#2}}% + #1-{\XINT_trim_trimnone }% + 0#1{\XINT_trimunbr_neg }% + 0-{\XINT_trim_pos #1}% \krof }% -\long\def\XINT_trimunbraced_bneg_a #1#2% +\long\def\XINT_trimunbr_neg #1.#2% {% - \expandafter\XINT_trimunbraced_bneg_b \the\numexpr \xintLength{#2}-#1.{#2}% + \expandafter\XINT_trimunbr_neg_a\the\numexpr + \XINT_length_loop + 0.#2\xint_relax\xint_relax\xint_relax\xint_relax + \xint_relax\xint_relax\xint_relax\xint_relax\xint_bye -#1.% + {}#2\xint_relax\xint_relax\xint_relax\xint_relax + \xint_relax\xint_relax\xint_relax\xint_bye }% -\def\XINT_trimunbraced_bneg_b #1#2.% +\def\XINT_trimunbr_neg_a #1% {% \xint_UDzerominusfork - #1-{\expandafter\space\xint_gobble_i }% - 0#1{\expandafter\space\xint_gobble_i }% - 0-{\XINT_keepunbraced_bpos {#1#2}}% + #1-{\XINT_trim_trimall }% + 0#1{\XINT_trim_trimall }% + 0-{\XINT_keepunbr_loop_a #1}% \krof }% \def\xintApply {\romannumeral0\xintapply }% @@ -1183,6 +1178,263 @@ }% }% \let\xintDigitsOf\xintAssignArray +\def\xintTrim:f:csv {\romannumeral0\xinttrim:f:csv }% +\def\xinttrim:f:csv #1#2% +{% + \expandafter\XINT_trim:f:csv_a\the\numexpr #1\expandafter.% + \romannumeral`&&@#2\xint_relax,\xint_relax,\xint_relax,\xint_relax,% + \xint_relax,\xint_relax,\xint_relax,\xint_relax,\xint_bye +}% +\def\XINT_trim:f:csv_a #1% +{% + \xint_UDzerominusfork + #1-{\XINT_trim:f:csv_zero }% + 0#1{\XINT_trim:f:csv_neg }% + 0-{\XINT_trim:f:csv_loop_a #1}% + \krof +}% +\def\XINT_trim:f:csv_zero .#1\xint_relax #2\xint_bye{ #1}% +\def\XINT_trim:f:csv_neg #1.#2\xint_relax% +{% + \expandafter\XINT_trim:f:csv_neg_b + \the\numexpr\expandafter\XINT_length:f:csv_a\romannumeral`&&@#2% + \xint_relax,\xint_relax,\xint_relax,\xint_relax,% + \xint_relax,\xint_relax,\xint_relax,\xint_relax,\xint_bye + -#1.#2\xint_relax +}% +\def\XINT_trim:f:csv_neg_b #1% +{% + \xint_UDzerominusfork + #1-{\expandafter\space\xint_bye }% + 0#1{\expandafter\space\xint_bye }% + 0-{\XINT_keep:f:csv_pos #1}% + \krof +}% +\def\XINT_trim:f:csv_loop_a #1.% +{% + \ifnum #1>\xint_c_vii + \expandafter\XINT_trim:f:csv_loop_b + \else + \expandafter\XINT_trim:f:csv_finish + \fi + #1.% +}% +\def\XINT_trim:f:csv_loop_b #1.#2,#3,#4,#5,#6,#7,#8,#9,% +{% + \xint_gob_til_xint_relax #9\XINT_trim:f:csv_silentend\xint_relax + \expandafter\XINT_trim:f:csv_loop_a\the\numexpr #1-\xint_c_viii.% +}% +\def\XINT_trim:f:csv_silentend #1\xint_bye { }% +\def\XINT_trim:f:csv_finish #1.% +{% + \expandafter\XINT_trim:f:csv_finish_a + \romannumeral`&&@\csname xint_gobble:csv_\romannumeral\numexpr#1\endcsname +}% +\def\xint_gobble:csv_ {}% +\def\xint_gobble:csv_i #1,{}% +\def\xint_gobble:csv_ii #1,#2,{}% +\def\xint_gobble:csv_iii #1,#2,#3,{}% +\def\xint_gobble:csv_iv #1,#2,#3,#4,{}% +\def\xint_gobble:csv_v #1,#2,#3,#4,#5,{}% +\def\xint_gobble:csv_vi #1,#2,#3,#4,#5,#6,{}% +\def\xint_gobble:csv_vii #1,#2,#3,#4,#5,#6,#7,{}% +\def\XINT_trim:f:csv_finish_a #1\xint_relax #2\xint_bye { #1}% +\def\xintKeep:f:csv {\romannumeral0\xintkeep:f:csv }% +\def\xintkeep:f:csv #1#2% +{% + \expandafter\XINT_keep:f:csv_a\the\numexpr #1\expandafter.% + \romannumeral`&&@#2\xint_relax,\xint_relax,\xint_relax,\xint_relax,% + \xint_relax,\xint_relax,\xint_relax,\xint_relax,\xint_bye +}% +\def\XINT_keep:f:csv_a #1% +{% + \xint_UDzerominusfork + #1-{\XINT_keep:f:csv_zero }% + 0#1{\XINT_keep:f:csv_neg }% + 0-{\XINT_keep:f:csv_pos #1}% + \krof +}% +\def\XINT_keep:f:csv_zero .#1\xint_bye{ }% +\def\XINT_keep:f:csv_neg #1.#2\xint_relax% +{% + \expandafter\XINT_keep:f:csv_neg_b + \the\numexpr\expandafter\XINT_length:f:csv_a\romannumeral`&&@#2% + \xint_relax,\xint_relax,\xint_relax,\xint_relax,% + \xint_relax,\xint_relax,\xint_relax,\xint_relax,\xint_bye + -#1.#2\xint_relax +}% +\def\XINT_keep:f:csv_neg_b #1% +{% + \xint_UDzerominusfork + #1-{\XINT_keep:f:csv_all }% + 0#1{\XINT_keep:f:csv_all }% + 0-{\XINT_trim:f:csv_loop_a #1}% + \krof +}% +\def\XINT_keep:f:csv_all #1.#2\xint_relax #3\xint_bye { #2}% +\def\XINT_keep:f:csv_pos #1.{\expandafter\xint_gobble_thenstop + \romannumeral`&&@\XINT_keep:f:csv_loop_a #1.{}}% +\def\XINT_keep:f:csv_loop_a #1.% +{% + \ifnum #1>\xint_c_vi + \expandafter\XINT_keep:f:csv_loop_b + \else + \expandafter\XINT_keep:f:csv_finish + \fi + #1.% +}% +\def\XINT_keep:f:csv_loop_b #1.#2#3,#4,#5,#6,#7,#8,#9,% +{% + \xint_gob_til_xint_relax #9\XINT_keep:f:csv_enda\xint_relax + \expandafter\XINT_keep:f:csv_loop_c\the\numexpr #1-\xint_c_vii.% + {,#3,#4,#5,#6,#7,#8,#9}{#2}% +}% +\def\XINT_keep:f:csv_loop_c #1.#2#3{\XINT_keep:f:csv_loop_a #1.{#3#2}}% +\def\XINT_keep:f:csv_enda #1.#2#3#4\xint_bye +{% + \XINT_keep:f:csv_endb #2\xint_bye {#3}% +}% +\def\XINT_keep:f:csv_endb #1\xint_relax #2\xint_bye #3{ #3#1}% +\def\XINT_keep:f:csv_finish #1.#2#3,#4,#5,#6,#7,#8,#9\xint_bye +{% + \csname XINT_keep:f:csv_finish_\romannumeral#1\endcsname + ,#3,#4,#5,#6,#7,#8,\Z {#2}% +}% +\def\XINT_keep:f:csv_finish_ #1\Z #2{#2}% +\def\XINT_keep:f:csv_finish_i ,#1,#2\Z + {\XINT_keep:f:csv_finish_f ,#1\xint_relax\Z}% +\def\XINT_keep:f:csv_finish_ii ,#1,#2,#3\Z + {\XINT_keep:f:csv_finish_f ,#1,#2\xint_relax\Z}% +\def\XINT_keep:f:csv_finish_iii ,#1,#2,#3,#4\Z + {\XINT_keep:f:csv_finish_f ,#1,#2,#3\xint_relax\Z}% +\def\XINT_keep:f:csv_finish_iv ,#1,#2,#3,#4,#5\Z + {\XINT_keep:f:csv_finish_f ,#1,#2,#3,#4\xint_relax\Z}% +\def\XINT_keep:f:csv_finish_v ,#1,#2,#3,#4,#5,#6\Z + {\XINT_keep:f:csv_finish_f ,#1,#2,#3,#4,#5\xint_relax\Z}% +\def\XINT_keep:f:csv_finish_vi ,#1,#2,#3,#4,#5,#6,#7\Z + {\XINT_keep:f:csv_finish_f ,#1,#2,#3,#4,#5,#6\xint_relax\Z}% +\def\XINT_keep:f:csv_finish_f #1\xint_relax #2\Z #3{#3#1}% +\def\xintNthEltPy:f:csv {\romannumeral0\xintntheltpy:f:csv }% +\def\xintntheltpy:f:csv #1{\expandafter\XINT_ntheltpy:f:csv\the\numexpr #1.}% +\def\XINT_ntheltpy:f:csv #1% +{% + \xint_UDsignfork + #1{\XINT_nthelt:f:csv_neg }% + -{\XINT_nthelt:f:csv_pos #1}% + \krof +}% +\long\def\XINT_nthelt:f:csv_neg #1.#2% +{% + \expandafter\XINT_nthelt:f:csv_neg_a + \the\numexpr\expandafter\XINT_length:f:csv_a\romannumeral`&&@#2% + \xint_relax,\xint_relax,\xint_relax,\xint_relax,% + \xint_relax,\xint_relax,\xint_relax,\xint_relax,\xint_bye + -#1+\xint_c_i\expandafter.\romannumeral`&&@#2% + \xint_relax,\xint_relax,\xint_relax,\xint_relax,% + \xint_relax,\xint_relax,\xint_relax,\xint_relax,\xint_bye +}% +\def\XINT_nthelt:f:csv_neg_a #1% +{% + \xint_UDzerominusfork + #1-{\XINT_nthelt:f:csv_none }% + 0#1{\XINT_nthelt:f:csv_none }% + 0-{\XINT_nthelt:f:csv_loop_a #1}% + \krof +}% +\def\XINT_nthelt:f:csv_none #1\xint_bye { }% +\long\def\XINT_nthelt:f:csv_pos #1.#2% +{% + \expandafter\XINT_nthelt:f:csv_loop_a\the\numexpr #1+\xint_c_i\expandafter.% + \romannumeral`&&@#2% + \xint_relax,\xint_relax,\xint_relax,\xint_relax,% + \xint_relax,\xint_relax,\xint_relax,\xint_relax,\xint_bye +}% +\def\XINT_nthelt:f:csv_loop_a #1.% +{% + \ifnum #1>\xint_c_viii + \expandafter\XINT_nthelt:f:csv_loop_b + \else + \expandafter\XINT_nthelt:f:csv_getit + \fi #1.% +}% +\long\def\XINT_nthelt:f:csv_loop_b #1.#2,#3,#4,#5,#6,#7,#8,#9,% +{% + \xint_gob_til_xint_relax #9\XINT_nthelt:f:csv_none\xint_relax + \expandafter\XINT_nthelt:f:csv_loop_a\the\numexpr #1-\xint_c_viii.% +}% +\def\XINT_nthelt:f:csv_getit #1.% +{% + \expandafter\XINT_nthelt:f:csv_finish + \romannumeral`&&@\csname xint_gobble:csv_\romannumeral + \numexpr#1-\xint_c_i\endcsname +}% +\def\XINT_nthelt:f:csv_finish #1,#2\xint_bye +{% + \XINT_nthelt:f:csv_finishb #1\xint_relax\xint_bye +}% +\def\XINT_nthelt:f:csv_finishb #1\xint_relax #2\xint_bye { #1}% +\def\xintReverse:f:csv {\romannumeral0\xintreverse:f:csv }% +\def\xintreverse:f:csv #1% +{% + \expandafter\XINT_reverse:f:csv_loop + \expandafter{\expandafter}\romannumeral`&&@#1,% + \xint_relax,% + \xint_bye,\xint_bye,\xint_bye,\xint_bye,% + \xint_bye,\xint_bye,\xint_bye,\xint_bye,% + \xint_relax +}% +\def\XINT_reverse:f:csv_loop #1#2,#3,#4,#5,#6,#7,#8,#9,% +{% + \xint_bye #9\XINT_reverse:f:csv_cleanup\xint_bye + \XINT_reverse:f:csv_loop {,#9,#8,#7,#6,#5,#4,#3,#2#1}% +}% +\def\XINT_reverse:f:csv_cleanup\xint_bye\XINT_reverse:f:csv_loop #1#2\xint_relax +{% + \XINT_reverse:f:csv_finish #1% +}% +\def\XINT_reverse:f:csv_finish #1\xint_relax,{ }% +\def\xintLength:f:csv {\romannumeral0\xintlength:f:csv }% +\def\xintlength:f:csv #1% +{% + \expandafter\XINT_length:f:csv_a + \romannumeral`&&@#1\xint_relax,\xint_relax,\xint_relax,\xint_relax,% + \xint_relax,\xint_relax,\xint_relax,\xint_relax,\xint_bye +}% +\def\XINT_length:f:csv_a #1% +{% + \xint_gob_til_xint_relax #1\XINT_length:f:csv_empty\xint_relax + \XINT_length:f:csv_loop 0.#1% +}% +\def\XINT_length:f:csv_empty #1\xint_bye { 0}% +\def\XINT_length:f:csv_loop #1.#2,#3,#4,#5,#6,#7,#8,#9,% +{% + \xint_gob_til_xint_relax #9\XINT_length:f:csv_finish_a\xint_relax + \expandafter\XINT_length:f:csv_loop\the\numexpr #1+\xint_c_viii.% +}% +\def\XINT_length:f:csv_finish_a\xint_relax + \expandafter\XINT_length:f:csv_loop\the\numexpr #1+\xint_c_viii.#2\xint_bye +{% + \XINT_length:f:csv_finish_b #2\W,\W,\W,\W,\W,\W,\W,\Z {#1}% +}% +\def\XINT_length:f:csv_finish_b #1,#2,#3,#4,#5,#6,#7,#8\Z +{% + \xint_gob_til_W + #1\XINT_length:f:csv_finish_c \xint_c_i + #2\XINT_length:f:csv_finish_c \xint_c_ii + #3\XINT_length:f:csv_finish_c \xint_c_iii + #4\XINT_length:f:csv_finish_c \xint_c_iv + #5\XINT_length:f:csv_finish_c \xint_c_v + #6\XINT_length:f:csv_finish_c \xint_c_vi + #7\XINT_length:f:csv_finish_c \xint_c_vii + \W\XINT_length:f:csv_finish_c \xint_c_viii\Z +}% +\edef\XINT_length:f:csv_finish_c #1#2\Z #3% + {\noexpand\expandafter\space\noexpand\the\numexpr #3+#1\relax}% +\let\xintCSVTrim \xintTrim:f:csv +\let\xintCSVKeep \xintKeep:f:csv +\let\xintCSVNthEltPy \xintNthEltPy:f:csv +\let\xintCSVReverse \xintReverse:f:csv +\let\xintCSVLength \xintLength:f:csv \let\XINT_tmpa\relax \let\XINT_tmpb\relax \let\XINT_tmpc\relax \XINT_restorecatcodes_endinput% \endinput |