summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/xint
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2017-01-07 23:38:44 +0000
committerKarl Berry <karl@freefriends.org>2017-01-07 23:38:44 +0000
commit59d321e899ed5a0ba1607c5c2ffc39192feea615 (patch)
treea2da6664231860296e14fff8d6609e580a276aba /Master/texmf-dist/tex/generic/xint
parent989cfdb299c13ca826bf94eb4cf7b31dd1301a57 (diff)
xint (8jan17)
git-svn-id: svn://tug.org/texlive/trunk@42892 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/xint')
-rw-r--r--Master/texmf-dist/tex/generic/xint/xint.sty31
-rw-r--r--Master/texmf-dist/tex/generic/xint/xintbinhex.sty6
-rw-r--r--Master/texmf-dist/tex/generic/xint/xintcfrac.sty6
-rw-r--r--Master/texmf-dist/tex/generic/xint/xintcore.sty46
-rw-r--r--Master/texmf-dist/tex/generic/xint/xintexpr.sty123
-rw-r--r--Master/texmf-dist/tex/generic/xint/xintfrac.sty581
-rw-r--r--Master/texmf-dist/tex/generic/xint/xintgcd.sty6
-rw-r--r--Master/texmf-dist/tex/generic/xint/xintkernel.sty17
-rw-r--r--Master/texmf-dist/tex/generic/xint/xintseries.sty6
-rw-r--r--Master/texmf-dist/tex/generic/xint/xinttools.sty30
10 files changed, 427 insertions, 425 deletions
diff --git a/Master/texmf-dist/tex/generic/xint/xint.sty b/Master/texmf-dist/tex/generic/xint/xint.sty
index f462fd3c81b..5373d135d0c 100644
--- a/Master/texmf-dist/tex/generic/xint/xint.sty
+++ b/Master/texmf-dist/tex/generic/xint/xint.sty
@@ -21,8 +21,8 @@
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%% ---------------------------------------------------------------
-%% The xint bundle 1.2j 2016/12/22
-%% Copyright (C) 2013-2016 by Jean-Francois Burnol
+%% The xint bundle 1.2k 2017/01/06
+%% Copyright (C) 2013-2017 by Jean-Francois Burnol
%% xint: Expandable operations on big integers
%% ---------------------------------------------------------------
\begingroup\catcode61\catcode48\catcode32=10\relax%
@@ -70,7 +70,7 @@
\XINTsetupcatcodes% defined in xintkernel.sty (loaded by xintcore.sty)
\XINT_providespackage
\ProvidesPackage{xint}%
- [2016/12/22 1.2j Expandable operations on big integers (JFB)]%
+ [2017/01/06 1.2k 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}%
@@ -99,8 +99,8 @@
\unless\if#11\xint_dothis{ 0}\fi
\xint_orthat{ 1}%
}%
-\def\XINT_isOne #1{\XINT_iSone#1XY}%
-\def\XINT_iSone #1#2#3Y%
+\def\XINT_isOne #1{\XINT_is_one#1XY}%
+\def\XINT_is_one #1#2#3Y%
{%
\unless\if#2X\xint_dothis0\fi
\unless\if#11\xint_dothis0\fi
@@ -108,19 +108,18 @@
}%
\let\xintRev\xintReverseDigits
\def\xintLen {\romannumeral0\xintlen }%
-\def\xintlen #1%
+\def\xintlen #1{\def\xintlen ##1%
{%
- \expandafter\XINT_len_fork
- \romannumeral0\xintnum{#1}\xint_relax\xint_relax\xint_relax\xint_relax
+ \expandafter#1\the\numexpr
+ \expandafter\XINT_len_fork\romannumeral0\xintnum{##1}%
+ \xint_relax\xint_relax\xint_relax\xint_relax
\xint_relax\xint_relax\xint_relax\xint_relax\xint_relax
\xint_c_viii\xint_c_vii\xint_c_vi\xint_c_v
\xint_c_iv\xint_c_iii\xint_c_ii\xint_c_i\xint_c_\xint_bye\relax
-}%
-\edef\XINT_len_fork #1%
+}}\xintlen{ }%
+\def\XINT_len_fork #1%
{%
- \noexpand\expandafter\space
- \unexpanded{\the\numexpr\expandafter
- \XINT_length_loop\xint_UDsignfork#1{}-{#1}\krof}%
+ \expandafter\XINT_length_loop\xint_UDsignfork#1{}-#1\krof
}%
\def\xintBool #1{\romannumeral`&&@%
\csname if#1\endcsname\expandafter1\else\expandafter0\fi }%
@@ -1108,8 +1107,10 @@
\def\xintiiSqrtR {\romannumeral0\xintiisqrtr }%
\def\xintiiSquareRoot {\romannumeral0\xintiisquareroot }%
\def\xintiSqrt {\romannumeral0\xintisqrt }%
+\def\xintiSqrtR {\romannumeral0\xintisqrtr }%
\def\xintiSquareRoot {\romannumeral0\xintisquareroot }%
\def\xintisqrt {\expandafter\XINT_sqrt_post\romannumeral0\xintisquareroot }%
+\def\xintisqrtr {\expandafter\XINT_sqrtr_post\romannumeral0\xintisquareroot }%
\def\xintiisqrt {\expandafter\XINT_sqrt_post\romannumeral0\xintiisquareroot }%
\def\xintiisqrtr {\expandafter\XINT_sqrtr_post\romannumeral0\xintiisquareroot }%
\def\XINT_sqrt_post #1#2{\XINT_dec #1\XINT_dec_bye234567890\xint_bye}%
@@ -1126,8 +1127,8 @@
0-{\XINT_sqrt #1}%
\krof
}%
-\def\XINT_sqrt_iszero #1\xint_relax { 11}%
-\edef\XINT_sqrt_isneg #1\xint_relax {\noexpand\xintError:RootOfNegative\space 11}%
+\def\XINT_sqrt_iszero #1\xint_relax {{1}{1}}%
+\def\XINT_sqrt_isneg #1\xint_relax {\xintError:RootOfNegative{1}{1}}%
\def\XINT_sqrt #1\xint_relax
{%
\expandafter\XINT_sqrt_start\romannumeral0\xintlength {#1}.#1.%
diff --git a/Master/texmf-dist/tex/generic/xint/xintbinhex.sty b/Master/texmf-dist/tex/generic/xint/xintbinhex.sty
index b804b8707a2..f3eeb9a387f 100644
--- a/Master/texmf-dist/tex/generic/xint/xintbinhex.sty
+++ b/Master/texmf-dist/tex/generic/xint/xintbinhex.sty
@@ -21,8 +21,8 @@
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%% ---------------------------------------------------------------
-%% The xint bundle 1.2j 2016/12/22
-%% Copyright (C) 2013-2016 by Jean-Francois Burnol
+%% The xint bundle 1.2k 2017/01/06
+%% Copyright (C) 2013-2017 by Jean-Francois Burnol
%% xintbinhex: Expandable binary and hexadecimal conversions
%% ---------------------------------------------------------------
\begingroup\catcode61\catcode48\catcode32=10\relax%
@@ -70,7 +70,7 @@
\XINTsetupcatcodes% defined in xintkernel.sty
\XINT_providespackage
\ProvidesPackage{xintbinhex}%
- [2016/12/22 1.2j Expandable binary and hexadecimal conversions (JFB)]%
+ [2017/01/06 1.2k 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
diff --git a/Master/texmf-dist/tex/generic/xint/xintcfrac.sty b/Master/texmf-dist/tex/generic/xint/xintcfrac.sty
index 97ad2f88153..21ccae4f1f4 100644
--- a/Master/texmf-dist/tex/generic/xint/xintcfrac.sty
+++ b/Master/texmf-dist/tex/generic/xint/xintcfrac.sty
@@ -21,8 +21,8 @@
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%% ---------------------------------------------------------------
-%% The xint bundle 1.2j 2016/12/22
-%% Copyright (C) 2013-2016 by Jean-Francois Burnol
+%% The xint bundle 1.2k 2017/01/06
+%% Copyright (C) 2013-2017 by Jean-Francois Burnol
%% xintcfrac: Expandable continued fractions with xint package
%% ---------------------------------------------------------------
\begingroup\catcode61\catcode48\catcode32=10\relax%
@@ -70,7 +70,7 @@
\XINTsetupcatcodes% defined in xintkernel.sty
\XINT_providespackage
\ProvidesPackage{xintcfrac}%
- [2016/12/22 1.2j Expandable continued fractions with xint package (JFB)]%
+ [2017/01/06 1.2k 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 e9f2062a267..5dea1c7f6bf 100644
--- a/Master/texmf-dist/tex/generic/xint/xintcore.sty
+++ b/Master/texmf-dist/tex/generic/xint/xintcore.sty
@@ -21,8 +21,8 @@
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%% ---------------------------------------------------------------
-%% The xint bundle 1.2j 2016/12/22
-%% Copyright (C) 2013-2016 by Jean-Francois Burnol
+%% The xint bundle 1.2k 2017/01/06
+%% Copyright (C) 2013-2017 by Jean-Francois Burnol
%% xintcore: Expandable arithmetic on big integers
%% ---------------------------------------------------------------
\begingroup\catcode61\catcode48\catcode32=10\relax%
@@ -70,7 +70,7 @@
\XINTsetupcatcodes% defined in xintkernel.sty
\XINT_providespackage
\ProvidesPackage{xintcore}%
- [2016/12/22 1.2j Expandable arithmetic on big integers (JFB)]%
+ [2017/01/06 1.2k 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
@@ -406,8 +406,16 @@
\def\XINT_ldg_cbye #1\XINT_ldg_c{}%
\def\XINT_ldg_d#1#2\xint_bye{#1}%
\def\xintDouble {\romannumeral0\xintdouble}%
-\def\xintdouble #1{\expandafter\XINT_dbl\romannumeral`&&@#1%
+\def\xintdouble #1{\expandafter\XINT_dbl_fork\romannumeral`&&@#1%
\xint_bye2345678\xint_bye*\xint_c_ii\relax}%
+\def\XINT_dbl_fork #1%
+{%
+ \xint_UDsignfork
+ #1\XINT_dbl_neg
+ -\XINT_dbl
+ \krof #1%
+}%
+\def\XINT_dbl_neg-{\expandafter-\romannumeral0\XINT_dbl}%
\def\XINT_dbl #1#2#3#4#5#6#7#8%
{\expandafter\space\the\numexpr#1#2#3#4#5#6#7#8\XINT_dbl_a}%
\def\XINT_dbl_a #1#2#3#4#5#6#7#8%
@@ -421,10 +429,10 @@
{%
\xint_UDsignfork
#1\XINT_half_neg
- -{\XINT_half #1}%
- \krof
+ -\XINT_half
+ \krof #1%
}%
-\def\XINT_half_neg{\xintiiopp\XINT_half}%
+\def\XINT_half_neg-{\xintiiopp\XINT_half}%
\def\XINT_half #1#2#3#4#5#6#7#8%
{\expandafter\space\the\numexpr(#1#2#3#4#5#6#7#8\XINT_half_a}%
\def\XINT_half_a#1{\xint_Bye#1\xint_bye\XINT_half_b#1}%
@@ -438,10 +446,10 @@
{%
\xint_UDsignfork
#1\XINT_inc_neg
- -{\XINT_inc #1}%
- \krof
+ -\XINT_inc
+ \krof #1%
}%
-\def\XINT_inc_neg #1\xint_bye#2\relax
+\def\XINT_inc_neg-#1\xint_bye#2\relax
{\xintiiopp\XINT_dec #1\XINT_dec_bye234567890\xint_bye}%
\def\XINT_inc #1#2#3#4#5#6#7#8#9%
{\expandafter\space\the\numexpr#1#2#3#4#5#6#7#8#9\XINT_inc_a}%
@@ -455,10 +463,10 @@
{%
\xint_UDsignfork
#1\XINT_dec_neg
- -{\XINT_dec #1}%
- \krof
+ -\XINT_dec
+ \krof #1%
}%
-\def\XINT_dec_neg #1\XINT_dec_bye#2\xint_bye
+\def\XINT_dec_neg-#1\XINT_dec_bye#2\xint_bye
{\expandafter-%
\romannumeral0\XINT_inc #1\xint_bye23456789\xint_bye+\xint_c_i\relax}%
\def\XINT_dec #1#2#3#4#5#6#7#8#9%
@@ -480,10 +488,10 @@
{%
\xint_UDsignfork
#1\XINT_dsr_neg
- -{\XINT_dsr #1}%
- \krof
+ -\XINT_dsr
+ \krof #1%
}%
-\def\XINT_dsr_neg{\xintiiopp\XINT_dsr}%
+\def\XINT_dsr_neg-{\xintiiopp\XINT_dsr}%
\def\XINT_dsr #1#2#3#4#5#6#7#8#9%
{\expandafter\space\the\numexpr(#1#2#3#4#5#6#7#8#9\XINT_dsr_a}%
\def\XINT_dsr_a#1{\xint_Bye#1\xint_bye\XINT_dsr_b#1}%
@@ -497,10 +505,10 @@
{%
\xint_UDsignfork
#1\XINT_dsrr_neg
- -{\XINT_dsrr #1}%
- \krof
+ -\XINT_dsrr
+ \krof #1%
}%
-\def\XINT_dsrr_neg{\xintiiopp\XINT_dsrr}%
+\def\XINT_dsrr_neg-{\xintiiopp\XINT_dsrr}%
\def\XINT_dsrr #1#2#3#4#5#6#7#8#9%
{\expandafter\space\the\numexpr#1#2#3#4#5#6#7#8#9\XINT_dsrr_a}%
\def\XINT_dsrr_a#1{\xint_Bye#1\xint_bye\XINT_dsrr_b#1}%
diff --git a/Master/texmf-dist/tex/generic/xint/xintexpr.sty b/Master/texmf-dist/tex/generic/xint/xintexpr.sty
index f53aa7b1e4e..91354f0a86e 100644
--- a/Master/texmf-dist/tex/generic/xint/xintexpr.sty
+++ b/Master/texmf-dist/tex/generic/xint/xintexpr.sty
@@ -21,8 +21,8 @@
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%% ---------------------------------------------------------------
-%% The xint bundle 1.2j 2016/12/22
-%% Copyright (C) 2013-2016 by Jean-Francois Burnol
+%% The xint bundle 1.2k 2017/01/06
+%% Copyright (C) 2013-2017 by Jean-Francois Burnol
%% xintexpr: Expandable expression parser
%% ---------------------------------------------------------------
\begingroup\catcode61\catcode48\catcode32=10\relax%
@@ -81,7 +81,7 @@
\XINTsetupcatcodes%
\XINT_providespackage
\ProvidesPackage{xintexpr}%
- [2016/12/22 1.2j Expandable expression parser (JFB)]%
+ [2017/01/06 1.2k 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
@@ -980,18 +980,58 @@
\let\XINT_flexpr_op_][: \XINT_expr_op_][:
\let\XINT_iiexpr_op_][: \XINT_expr_op_][:
\catcode`[ 12 \catcode`] 12
-\def\xintListSel:f:csv #1%
+\def\xintListSel:x:csv #1%
{%
- \if ]\noexpand#1\xint_dothis{\expandafter\XINT_listsel:_s\romannumeral`&&@}\fi
- \if :\noexpand#1\xint_dothis{\XINT_listsel:_:}\fi
+ \if ]\noexpand#1\xint_dothis\XINT_listsel:_s\fi
+ \if :\noexpand#1\xint_dothis\XINT_listxsel:_:\fi
\xint_orthat {\XINT_listsel:_nth #1}%
}%
-\def\XINT_listsel:_nth #1;#2;{\xintNthEltPy:f:csv {\xintNum{#1}}{#2}}%
\def\XINT_listsel:_s #1#2;#3;%
{%
\if-#1\expandafter\xintKeep:f:csv\else\expandafter\xintTrim:f:csv\fi
{#1#2}{#3}%
}%
+\def\XINT_listsel:_nth #1;#2;{\xintNthEltPy:f:csv {\xintNum{#1}}{#2}}%
+\def\XINT_listxsel:_: #1#2;#3#4;%
+{%
+ \xint_UDsignsfork
+ #1#3\XINT_listxsel:_N:N
+ #1-\XINT_listxsel:_N:P
+ -#3\XINT_listxsel:_P:N
+ --\XINT_listxsel:_P:P
+ \krof #1#2;#3#4;%
+}%
+\def\XINT_listxsel:_P:P #1;#2;#3;%
+{%
+ \unless\ifnum #1<#2 \expandafter\xint_gobble_iii\fi
+ \xintKeep:x:csv{#2-#1}{\xintTrim:f:csv{#1}{#3}}%
+}%
+\def\XINT_listxsel:_N:N #1;#2;#3;%
+{%
+ \expandafter\XINT_listxsel:_N:N_a
+ \the\numexpr #2-#1\expandafter;\the\numexpr#1+\xintLength:f:csv{#3};#3;%
+}%
+\def\XINT_listxsel:_N:N_a #1;#2;#3;%
+{%
+ \unless\ifnum #1>\xint_c_ \expandafter\xint_gobble_iii\fi
+ \xintKeep:x:csv{#1}{\xintTrim:f:csv{\ifnum#2<\xint_c_\xint_c_\else#2\fi}{#3}}%
+}%
+\def\XINT_listxsel:_N:P #1;#2;#3;{\expandafter\XINT_listxsel:_N:P_a
+ \the\numexpr #1+\xintLength:f:csv{#3};#2;#3;}%
+\def\XINT_listxsel:_N:P_a #1#2;%
+ {\if -#1\expandafter\XINT_listxsel:_O:P\fi\XINT_listxsel:_P:P #1#2;}%
+\def\XINT_listxsel:_O:P\XINT_listxsel:_P:P #1;{\XINT_listxsel:_P:P 0;}%
+\def\XINT_listxsel:_P:N #1;#2;#3;{\expandafter\XINT_listxsel:_P:N_a
+ \the\numexpr #2+\xintLength:f:csv{#3};#1;#3;}%
+\def\XINT_listxsel:_P:N_a #1#2;#3;%
+ {\if -#1\expandafter\XINT_listxsel:_P:O\fi\XINT_listxsel:_P:P #3;#1#2;}%
+\def\XINT_listxsel:_P:O\XINT_listxsel:_P:P #1;#2;{\XINT_listxsel:_P:P #1;0;}%
+\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}%
+}%
\def\XINT_listsel:_: #1;#2;%
{%
\expandafter\XINT_listsel:_:a
@@ -1032,46 +1072,6 @@
\def\XINT_listsel:_P:N_a #1#2;#3;%
{\if -#1\expandafter\XINT_listsel:_P:O\fi\XINT_listsel:_P:P #3;#1#2;}%
\def\XINT_listsel:_P:O\XINT_listsel:_P:P #1;#2;{\XINT_listsel:_P:P #1;0;}%
-\def\xintListSel:x:csv #1%
-{%
- \if ]\noexpand#1\xint_dothis\XINT_listsel:_s\fi
- \if :\noexpand#1\xint_dothis\XINT_listxsel:_:\fi
- \xint_orthat {\XINT_listsel:_nth #1}%
-}%
-\def\XINT_listxsel:_: #1#2;#3#4;%
-{%
- \xint_UDsignsfork
- #1#3\XINT_listxsel:_N:N
- #1-\XINT_listxsel:_N:P
- -#3\XINT_listxsel:_P:N
- --\XINT_listxsel:_P:P
- \krof #1#2;#3#4;%
-}%
-\def\XINT_listxsel:_P:P #1;#2;#3;%
-{%
- \unless\ifnum #1<#2 \expandafter\xint_gobble_iii\fi
- \xintKeep:x:csv{#2-#1}{\xintTrim:f:csv{#1}{#3}}%
-}%
-\def\XINT_listxsel:_N:N #1;#2;#3;%
-{%
- \expandafter\XINT_listxsel:_N:N_a
- \the\numexpr #2-#1\expandafter;\the\numexpr#1+\xintLength:f:csv{#3};#3;%
-}%
-\def\XINT_listxsel:_N:N_a #1;#2;#3;%
-{%
- \unless\ifnum #1>\xint_c_ \expandafter\xint_gobble_iii\fi
- \xintKeep:x:csv{#1}{\xintTrim:f:csv{\ifnum#2<\xint_c_\xint_c_\else#2\fi}{#3}}%
-}%
-\def\XINT_listxsel:_N:P #1;#2;#3;{\expandafter\XINT_listxsel:_N:P_a
- \the\numexpr #1+\xintLength:f:csv{#3};#2;#3;}%
-\def\XINT_listxsel:_N:P_a #1#2;%
- {\if -#1\expandafter\XINT_listxsel:_O:P\fi\XINT_listxsel:_P:P #1#2;}%
-\def\XINT_listxsel:_O:P\XINT_listxsel:_P:P #1;{\XINT_listxsel:_P:P 0;}%
-\def\XINT_listxsel:_P:N #1;#2;#3;{\expandafter\XINT_listxsel:_P:N_a
- \the\numexpr #2+\xintLength:f:csv{#3};#1;#3;}%
-\def\XINT_listxsel:_P:N_a #1#2;#3;%
- {\if -#1\expandafter\XINT_listxsel:_P:O\fi\XINT_listxsel:_P:P #3;#1#2;}%
-\def\XINT_listxsel:_P:O\XINT_listxsel:_P:P #1;#2;{\XINT_listxsel:_P:P #1;0;}%
\def\xintKeep:x:csv #1#2%
{%
\expandafter\xint_gobble_i
@@ -1444,9 +1444,9 @@
\edef\XINT_expr_tmpa {\xint_zapspaces_o\XINT_expr_tmpa}%
\ifcsname XINT_expr_var_\XINT_expr_tmpa\endcsname
\ifnum\expandafter\xintLength\expandafter{\XINT_expr_tmpa}=\@ne
- \expandafter\XINT_expr_makedummy \XINT_expr_tmpa
- \ifxintverbose\xintMessage {xintexpr}{Info}
- {Character \XINT_expr_tmpa\space usable as dummy variable (if letter).}%
+ \expandafter\XINT_expr_makedummy\XINT_expr_tmpa
+ \ifxintverbose\xintMessage {xintexpr}{Info}%
+ {Character \XINT_expr_tmpa\space usable as dummy variable (if with catcode letter).}%
\fi
\else
\expandafter\edef\csname XINT_expr_var_\XINT_expr_tmpa\endcsname
@@ -1473,6 +1473,12 @@
}%
\xintApplyUnbraced \XINT_expr_makedummy {abcdefghijklmnopqrstuvwxyz}%
\xintApplyUnbraced \XINT_expr_makedummy {ABCDEFGHIJKLMNOPQRSTUVWXYZ}%
+\def\xintnewdummy #1{%
+ \XINT_expr_makedummy{#1}%
+ \ifxintverbose\xintMessage {xintexpr}{Info}%
+ {Character #1 now usable as dummy variable (if with catcode letter).}%
+ \fi
+}%
\edef\XINT_expr_var_nil {\expandafter\noexpand\csname .= \endcsname}%
\edef\XINT_expr_onlitteral_nil
{\XINT_expr_precedence_*** *\expandafter\noexpand\csname .= \endcsname (}%
@@ -2294,16 +2300,13 @@
\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 }%
-\def\XINT_expr_func_firsta #1,#2^{#1}%
+ {\expandafter #1\expandafter #2\csname.=%
+ \xintFirstItem:f:csv{\XINT_expr_unlock #3}\endcsname}%
\let\XINT_flexpr_func_first\XINT_expr_func_first
\let\XINT_iiexpr_func_first\XINT_expr_func_first
-\def\XINT_expr_func_last #1#2#3% will not work in \xintNewExpr if macro param involved
- {\expandafter #1\expandafter #2\csname.=\expandafter\XINT_expr_func_lasta
- \romannumeral`&&@\XINT_expr_unlock #3,^\endcsname }%
-\def\XINT_expr_func_lasta #1,#2%
- {\if ^#2 #1\expandafter\xint_gobble_ii\fi \XINT_expr_func_lasta #2}%
+\def\XINT_expr_func_last #1#2#3%
+ {\expandafter #1\expandafter #2\csname.=%
+ \xintLastItem:f:csv{\XINT_expr_unlock #3}\endcsname}%
\let\XINT_flexpr_func_last\XINT_expr_func_last
\let\XINT_iiexpr_func_last\XINT_expr_func_last
\def\XINT_expr_func_odd #1#2#3%
@@ -2636,7 +2639,8 @@
\romannumeral`&&@##2!{~XINTinFloatFac[##1]}{XINTinFloatFac}{}{[##1]}}%
}%
\xintFor #1 in {ANDof,ORof,XORof,iiMaxof,iiMinof,iiSum,iiPrd,
- GCDof,LCMof,Sum,Prd,Maxof,Minof}\do
+ GCDof,LCMof,Sum,Prd,Maxof,Minof,
+ Reverse:f,FirstItem:f,LastItem:f}\do
{\toks0
\expandafter{\the\toks0\expandafter\def\csname xint#1:csv\endcsname {~xint#1:csv}}%
}%
@@ -2646,7 +2650,6 @@
\expandafter{\the\toks0\expandafter\def\csname #1:csv\endcsname {~#1:csv}}%
}%
\toks0 \expandafter{\the\toks0
- \def\xintReverse:f:csv {~xintReverse:f:csv }%
\def\xintListSel:x:csv {~xintListSel:f:csv }%
}%
\odef\XINT_expr_redefinemacros {\the\toks0}% Not \edef ! (subtle)
diff --git a/Master/texmf-dist/tex/generic/xint/xintfrac.sty b/Master/texmf-dist/tex/generic/xint/xintfrac.sty
index 7228abe0198..eed97cde276 100644
--- a/Master/texmf-dist/tex/generic/xint/xintfrac.sty
+++ b/Master/texmf-dist/tex/generic/xint/xintfrac.sty
@@ -21,8 +21,8 @@
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%% ---------------------------------------------------------------
-%% The xint bundle 1.2j 2016/12/22
-%% Copyright (C) 2013-2016 by Jean-Francois Burnol
+%% The xint bundle 1.2k 2017/01/06
+%% Copyright (C) 2013-2017 by Jean-Francois Burnol
%% xintfrac: Expandable operations on fractions
%% ---------------------------------------------------------------
\begingroup\catcode61\catcode48\catcode32=10\relax%
@@ -70,7 +70,7 @@
\XINTsetupcatcodes% defined in xintkernel.sty
\XINT_providespackage
\ProvidesPackage{xintfrac}%
- [2016/12/22 1.2j Expandable operations on fractions (JFB)]%
+ [2017/01/06 1.2k Expandable operations on fractions (JFB)]%
\def\XINT_cntSgnFork #1%
{%
\ifcase #1\expandafter\xint_secondofthree
@@ -83,16 +83,16 @@
{%
\expandafter\XINT_flen\romannumeral0\XINT_infrac {#1}%
}%
-\def\XINT_flen #1#2#3%
+\def\XINT_flen#1{\def\XINT_flen ##1##2##3%
{%
- \expandafter\space
- \the\numexpr \XINT_abs#1+\XINT_length_loop
- #2#3\xint_relax\xint_relax\xint_relax\xint_relax
+ \expandafter#1%
+ \the\numexpr \XINT_abs##1+%
+ \XINT_len_fork ##2##3\xint_relax\xint_relax\xint_relax\xint_relax
\xint_relax\xint_relax\xint_relax\xint_relax\xint_relax
\xint_c_viii\xint_c_vii\xint_c_vi\xint_c_v
\xint_c_iv\xint_c_iii\xint_c_ii\xint_c_i\xint_c_\xint_bye-\xint_c_i
\relax
-}%
+}}\XINT_flen{ }%
\def\XINT_outfrac #1#2#3%
{%
\ifcase\XINT_cntSgn #3\Z
@@ -733,7 +733,7 @@
\def\XINT_trunc_a #1#2#3#4.#5%
{%
\if0\XINT_Sgn#2\Z\xint_dothis\XINT_trunc_zero\fi
- \if1\XINT_iSone#3XY\xint_dothis\XINT_trunc_sp_b\fi
+ \if1\XINT_is_one#3XY\xint_dothis\XINT_trunc_sp_b\fi
\xint_orthat\XINT_trunc_b #1+#4.{#2}{#3}#5#4.%
}%
\def\XINT_trunc_zero #1.#2.{ 0}%
@@ -852,7 +852,7 @@
\def\XINT_round_a #1#2#3#4.%
{%
\if0\XINT_Sgn#2\Z\xint_dothis\XINT_trunc_zero\fi
- \if1\XINT_iSone#3XY\xint_dothis\XINT_trunc_sp_b\fi
+ \if1\XINT_is_one#3XY\xint_dothis\XINT_trunc_sp_b\fi
\xint_orthat\XINT_trunc_b #1+#4.{#2}{#3}%
}%
\def\XINT_round_A{\expandafter\XINT_trunc_G\romannumeral0\XINT_round_B}%
@@ -1659,176 +1659,33 @@
}%
\def\XINT_float_noopt #1\xint_relax
{%
- \expandafter\XINT_float_a\expandafter\XINTdigits\expandafter.%
- \romannumeral0\XINT_infrac {#1}\XINT_float_Q
-}%
-\def\XINT_float_opt [\xint_relax #1]#2%
-{%
- \expandafter\XINT_float_a\the\numexpr #1\expandafter.%
- \romannumeral0\XINT_infrac {#2}\XINT_float_Q
-}%
-\def\XINT_float_a #1.#2#3#4%
-{%
- \if1\XINT_iSone#4XY\expandafter\XINT_float_sp
- \else\expandafter\XINT_float_fork\fi #3.{#1}{#2}{#4}%
+ \expandafter\XINT_float_post
+ \romannumeral0\XINTinfloat[\XINTdigits]{#1}\XINTdigits.%
}%
-\def\XINT_float_sp #1%
+\def\XINT_float_opt [\xint_relax #1]%
{%
- \xint_UDzerominusfork
- #1-\XINT_float_spzero
- 0#1\XINT_float_spneg
- 0-{\XINT_float_sppos #1}%
- \krof
+ \expandafter\XINT_float_opt_a\the\numexpr #1.%
}%
-\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%
+\def\XINT_float_opt_a #1.#2%
{%
- \expandafter\XINT_float_sp_b\the\numexpr#2-\xintLength{#1}.#1.#2.#3.%
+ \expandafter\XINT_float_post
+ \romannumeral0\XINTinfloat[#1]{#2}#1.%
}%
-\def\XINT_float_sp_b #1%
+\def\XINT_float_post #1%
{%
\xint_UDzerominusfork
- #1-\XINT_float_sp_quick
- 0#1\XINT_float_sp_c
- 0-{\XINT_float_sp_addzeros #1}%
- \krof
-}%
-\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_addzeros {#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_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\XINT_split_fromleft
- (\xint_c_i+#4).#3\xint_bye2345678\xint_bye..#1%
-}%
-\def\XINT_float_sp_e #1.#2.#3.#4%
-{%
- \expandafter#4\romannumeral0\XINT_dsrr#2%
- \xint_bye\xint_Bye3456789\xint_bye/\xint_c_x\relax e#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}%
-}%
-\def\XINT_float_L #1.#2.%
-{%
- \ifnum #1>#2
- \expandafter\XINT_float_Ma
- \else
- \expandafter\XINT_float_Mb
- \fi #1.#2.%
-}%
-\def\XINT_float_Ma #1.#2.#3%
-{%
- \expandafter\XINT_float_MatoN
- \the\numexpr #1-#2\expandafter.%
- \romannumeral0\XINT_split_fromleft#2.#3\xint_bye2345678\xint_bye..{#2}%
-}%
-\def\XINT_float_MatoN #1.#2.#3.#4#5#6#7%
-{%
- \expandafter\XINT_float_N
- \the\numexpr\xintLength{#7}\expandafter.\the\numexpr #1+#6.#4.%
- {#7}{#4}{#2}{#5}%
-}%
-\def\XINT_float_Mb #1.#2.#3#4#5#6%
-{%
- \expandafter\XINT_float_N
- \romannumeral0\xintlength{#6}.#5.#2.{#6}{#1}{#3}{#4}%
-}%
-\def\XINT_float_N #1.#2.#3.%
-{%
- \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%
-{%
- \expandafter\XINT_float_NaP
- \the\numexpr #2-#1+#3\expandafter.%
- \romannumeral0\XINT_split_fromleft#3.#4\xint_bye2345678\xint_bye..{#3}%
-}%
-\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%
-{%
- \expandafter #8\the\numexpr #1-#5+#3-\xint_c_i.{#6}{#4}{#7}{#2}%
-}%
-\def\XINT_float_Q #1.#2#3%
-{%
- \expandafter\XINT_float_Sa
- \romannumeral0\xintiiquo{\XINT_dsx_addzeros {#1}#2;}{#3}\Z {#1}%
-}%
-\def\XINT_float_Sa #1%
-{%
- \if #19\xint_dothis {\XINT_float_Sb\XINT_float_Wb }\fi
- \xint_orthat {\XINT_float_Sb\XINT_float_Wa }#1%
-}%
-\def\XINT_float_Sb #1#2\Z #3#4%
-{%
- \expandafter\XINT_float_T
- \the\numexpr\XINT_length_loop
- #2\xint_relax\xint_relax\xint_relax\xint_relax
- \xint_relax\xint_relax\xint_relax\xint_relax\xint_relax
- \xint_c_viii\xint_c_vii\xint_c_vi\xint_c_v
- \xint_c_iv\xint_c_iii\xint_c_ii\xint_c_i\xint_c_\xint_bye-#4.%
- {#2}#1{#3}{#4}%
-}%
-\def\XINT_float_T #1.%
-{%
- \if2#1\expandafter\XINT_float_Ub\else\expandafter\XINT_float_Ua\fi
-}%
-\def\XINT_float_Ua #1#2%
-{%
- \expandafter\XINT_float_Xa
- \romannumeral0\expandafter#2%
- \romannumeral0\XINT_dsrr
- #1\xint_bye\xint_Bye3456789\xint_bye/\xint_c_x\relax;%
-}%
-\def\XINT_float_Ub #1#2%
-{%
- \expandafter\XINT_float_Xb
- \romannumeral0\expandafter#2%
- \romannumeral0\expandafter\XINT_dsrr
- \romannumeral0\XINT_dsr
- #1\xint_bye\xint_Bye3456789\xint_bye+\xint_c_v)/\xint_c_x-\xint_c_i\relax
- \xint_bye\xint_Bye3456789\xint_bye/\xint_c_x\relax;%
-}%
-\def\XINT_float_Wa #1{ #1.}%
-\def\XINT_float_Wb #1#2{\if #11\xint_dothis{ 10.}\fi\xint_orthat{ #1.#2}}%
-\def\XINT_float_Xa #1;#2#3#4%
-{%
- \expandafter\XINT_float_Y\the\numexpr #3+#4-#2.{#1}%
-}%
-\def\XINT_float_Xb #1;#2#3#4%
+ #1-\XINT_float_zero
+ 0#1\XINT_float_neg
+ 0-\XINT_float_pos
+ \krof #1%
+}%[
+\def\XINT_float_zero #1]#2.{ 0.e0}%
+\def\XINT_float_neg-{\expandafter-\romannumeral0\XINT_float_pos}%
+\def\XINT_float_pos #1#2[#3]#4.%
{%
- \expandafter\XINT_float_Y\the\numexpr #3+#4+\xint_c_i-#2.{#1}%
+ \expandafter\XINT_float_pos_done\the\numexpr#3+#4-\xint_c_i.#1.#2;%
}%
-\def\XINT_float_Y #1.#2{ #2e#1}%
+\def\XINT_float_pos_done #1.#2;{ #2e#1}%
\def\XINTinFloat {\romannumeral0\XINTinfloat }%
\def\XINTinfloat
{\expandafter\XINT_infloat_clean\romannumeral0\XINT_infloat}%
@@ -1850,28 +1707,30 @@
\def\XINT_infloat [#1]#2%
{%
\expandafter\XINT_infloat_a\the\numexpr #1\expandafter.%
- \romannumeral0\XINT_infrac {#2}\XINT_infloat_Q
+ \romannumeral0\XINT_infrac {#2}%
}%
\def\XINT_infloat_a #1.#2#3#4%
{%
- \if1\XINT_iSone#4XY\expandafter\XINT_infloat_sp
- \else\expandafter\XINT_float_fork\fi #3.{#1}{#2}{#4}%
+ \if1\XINT_is_one#4XY%
+ \expandafter\XINT_infloat_sp
+ \else\expandafter\XINT_infloat_fork
+ \fi #3.{#1}{#2}{#4}%
}%
\def\XINT_infloat_sp #1%
{%
\xint_UDzerominusfork
#1-\XINT_infloat_spzero
0#1\XINT_infloat_spneg
- 0-{\XINT_infloat_sppos #1}%
- \krof
+ 0-\XINT_infloat_sppos
+ \krof #1%
}%
-\def\XINT_infloat_spzero .#1#2#3#4{ 0[0]}%
-\def\XINT_infloat_spneg
+\def\XINT_infloat_spzero 0.#1#2#3{ 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%
+\def\XINT_infloat_sppos #1.#2#3#4%
{%
\expandafter\XINT_infloat_sp_b\the\numexpr#2-\xintLength{#1}.#1.#2.#3.%
}%
@@ -1880,70 +1739,154 @@
\xint_UDzerominusfork
#1-\XINT_infloat_sp_quick
0#1\XINT_infloat_sp_c
- 0-{\XINT_infloat_sp_needzeros #1}%
- \krof
+ 0-\XINT_infloat_sp_needzeros
+ \krof #1%
}%
-\def\XINT_infloat_sp_quick .#1.#2.#3.{ #1[#3]}%
+\def\XINT_infloat_sp_quick 0.#1.#2.#3.{ #1[#3]}%
\def\XINT_infloat_sp_needzeros #1.#2.#3.#4.{!#1.#2[#4]}%
-\def\XINT_infloat_sp_c #1.#2%
+\def\XINT_infloat_sp_c -#1.#2#3.#4.#5.%
{%
- \if #29\xint_dothis {\XINT_infloat_sp_d\XINT_infloat_Wb }\fi
- \xint_orthat {\XINT_infloat_sp_d .}#1.#2%
+ \expandafter\XINT_infloat_Y
+ \the\numexpr #5+#1\expandafter.%
+ \romannumeral0\expandafter\XINT_infloat_sp_round
+ \romannumeral0\XINT_split_fromleft
+ (\xint_c_i+#4).#2#3\xint_bye2345678\xint_bye..#2%
}%
-\def\XINT_infloat_sp_d #1#2.#3.#4.%#5.%
+\def\XINT_infloat_sp_round #1.#2.%
{%
- \expandafter\XINT_infloat_sp_e
- \romannumeral0\XINT_split_fromleft
- (\xint_c_i+#4).#3\xint_bye2345678\xint_bye..#1#2.%
+ \XINT_dsrr#1\xint_bye\xint_Bye3456789\xint_bye/\xint_c_x\relax.%
}%
-\def\XINT_infloat_sp_e #1.#2.#3#4.#5.%
+\def\XINT_infloat_fork #1%
{%
- \expandafter\XINT_infloat_done
- \the\numexpr#4+#5\expandafter#3\romannumeral0\XINT_dsrr
- #1\xint_bye\xint_Bye3456789\xint_bye/\xint_c_x\relax;%
+ \xint_UDsignfork
+ #1\XINT_infloat_J
+ -\XINT_infloat_K
+ \krof #1%
}%
-\def\XINT_infloat_Q #1.#2#3%
+\def\XINT_infloat_J-{\expandafter-\romannumeral0\XINT_infloat_K }%
+\def\XINT_infloat_K #1.#2%
{%
- \expandafter\XINT_infloat_Sa
- \romannumeral0\xintiiquo{\XINT_dsx_addzeros {#1}#2;}{#3}\Z {#1}%
+ \expandafter\XINT_infloat_L
+ \the\numexpr\xintLength{#1}\expandafter.\the\numexpr #2+\xint_c_iv.{#1}{#2}%
}%
-\def\XINT_infloat_Sa #1%
+\def\XINT_infloat_L #1.#2.%
{%
- \if #19\xint_dothis {\XINT_infloat_Sb\XINT_infloat_Wb }\fi
- \xint_orthat {\XINT_infloat_Sb .}#1%
+ \ifnum #1>#2
+ \expandafter\XINT_infloat_Ma
+ \else
+ \expandafter\XINT_infloat_Mb
+ \fi #1.#2.%
}%
-\def\XINT_infloat_Sb #1#2\Z #3#4%
+\def\XINT_infloat_Ma #1.#2.#3%
{%
- \expandafter\XINT_infloat_T
- \the\numexpr\XINT_length_loop
- #2\xint_relax\xint_relax\xint_relax\xint_relax
- \xint_relax\xint_relax\xint_relax\xint_relax\xint_relax
- \xint_c_viii\xint_c_vii\xint_c_vi\xint_c_v
- \xint_c_iv\xint_c_iii\xint_c_ii\xint_c_i\xint_c_\xint_bye-#4.%
- {#2}#1{#3}%
+ \expandafter\XINT_infloat_MtoN\expandafter-\expandafter0\expandafter.%
+ \romannumeral0\XINT_split_fromleft#2.#3\xint_bye2345678\xint_bye..%
+ #2.#1.{#3}%
}%
-\def\XINT_infloat_T #1.%
+\def\XINT_infloat_Mb #1.#2.#3%
{%
- \if2#1\expandafter\XINT_infloat_Ub\else\expandafter\XINT_infloat_Ua\fi
+ \expandafter\XINT_infloat_MtoN\the\numexpr#2-#1.%
+ #3..#2.#1.{#3}%
}%
-\def\XINT_infloat_Ua #1#2#3#4%
+\def\XINT_infloat_MtoN #1.#2.#3.#4.#5.#6#7#8#9%
{%
- \expandafter\XINT_infloat_done
- \the\numexpr\xint_c_i+#4-#3\romannumeral0\expandafter#2%
- \romannumeral0\XINT_dsrr
- #1\xint_bye\xint_Bye3456789\xint_bye/\xint_c_x\relax;%
+ \expandafter\XINT_infloat_N
+ \the\numexpr\xintLength{#9}.#4.{#9}#1.#2.#7.#5.#8.{#6}{#9}%
}%
-\def\XINT_infloat_Ub #1#2#3#4%
+\def\XINT_infloat_N #1.#2.%
{%
- \expandafter\XINT_infloat_done
- \the\numexpr\xint_c_ii+#4-#3\romannumeral0\expandafter#2%
- \romannumeral0\expandafter\XINT_dsrr
- \romannumeral0\XINT_dsr
- #1\xint_bye\xint_Bye3456789\xint_bye+\xint_c_v)/\xint_c_x-\xint_c_i\relax
- \xint_bye\xint_Bye3456789\xint_bye/\xint_c_x\relax;%
-}%
-\def\XINT_infloat_Wb #1#2%
- {\if #11\xint_dothis{+\xint_c_i.1}\fi\xint_orthat{.#1#2}}%
+ \ifnum #1>#2
+ \expandafter\XINT_infloat_Oa
+ \else
+ \expandafter\XINT_infloat_Ob
+ \fi #1.#2.%
+}%
+\def\XINT_infloat_Oa #1.#2.#3%
+{%
+ \expandafter\XINT_infloat_P\expandafter-\expandafter0\expandafter.%
+ \romannumeral0\XINT_split_fromleft#2.#3\xint_bye2345678\xint_bye..%
+ #1.%
+}%
+\def\XINT_infloat_Ob #1.#2.#3%
+{%
+ \expandafter\XINT_infloat_P\the\numexpr#2-#1.#3..#1.%
+}%
+\def\XINT_infloat_P #1#2.#3.#4.#5.#6#7.#8.#9.%
+{%
+ \csname XINT_infloat_Q\if-#1\else\if-#6\else q\fi\fi\expandafter\endcsname
+ \romannumeral0\xintiiquo
+ {\romannumeral0\XINT_dsx_addzerosnofuss
+ {#6#7-#1#2+#9+\xint_c_iii\if-#1\else\if-#6\else-\xint_c_ii\fi\fi}#8;}%
+ {#3}.#9.#5.%
+}%
+\def\XINT_infloat_Qq #1.#2.%
+{%
+ \expandafter\XINT_infloat_Rq
+ \romannumeral0\XINT_split_fromleft#2.#1\xint_bye2345678\xint_bye..#2.%
+}%
+\def\XINT_infloat_Rq #1.#2#3.%
+{%
+ \ifnum#2<\xint_c_v
+ \expandafter\XINT_infloat_SEq
+ \else\expandafter\XINT_infloat_SUp
+ \fi
+ {\if.#3.\xint_c_\else\xint_c_i\fi}#1.%
+}%
+\def\XINT_infloat_Q #1.#2.%
+{%
+ \expandafter\XINT_infloat_R
+ \romannumeral0\XINT_split_fromleft#2.#1\xint_bye2345678\xint_bye..#2.%
+}%
+\def\XINT_infloat_R #1.#2#3#4#5.%
+{%
+ \if.#5.\expandafter\XINT_infloat_Sa\else\expandafter\XINT_infloat_Sb\fi
+ #2#3#4#5.#1.%
+}%
+\def\XINT_infloat_Sa #1.%
+{%
+ \ifnum#1>500 \xint_dothis\XINT_infloat_SUp\fi
+ \ifnum#1<499 \xint_dothis\XINT_infloat_SEq\fi
+ \xint_orthat\XINT_infloat_X\xint_c_
+}%
+\def\XINT_infloat_Sb #1.%
+{%
+ \ifnum#1>5009 \xint_dothis\XINT_infloat_SUp\fi
+ \ifnum#1<4990 \xint_dothis\XINT_infloat_SEq\fi
+ \xint_orthat\XINT_infloat_X\xint_c_i
+}%
+\def\XINT_infloat_SEq #1#2.#3.#4.#5.#6.#7#8%
+{%
+ \expandafter\XINT_infloat_SY
+ \the\numexpr #6+#5-#4-#3+#1.#2.%
+}%
+\def\XINT_infloat_SY #1.#2.{ #2[#1]}%
+\def\XINT_infloat_SUp #1#2#3.#4.#5.#6.#7.#8#9%
+{%
+ \expandafter\XINT_infloat_Y
+ \the\numexpr#7+#6-#5-#4+#1\expandafter.%
+ \romannumeral0\xintinc{#2#3}.#2%
+}%
+\def\XINT_infloat_X #1#2#3.#4.#5.#6.#7.#8#9%
+{%
+ \expandafter\XINT_infloat_Y
+ \the\numexpr #7+#6-#5-#4+#1\expandafter.%
+ \romannumeral`&&@\romannumeral0\xintiiiflt
+ {\xintDSH{#6-#5-#4+#1}{\xintDouble{#8}}}%
+ {\xintiiMul{\xintInc{\xintDouble{#2#3}}}{#9}}%
+ \xint_firstofone
+ \xintinc{#2#3}.#2%
+}%
+\def\XINT_infloat_Y #1{%
+\def\XINT_infloat_Y ##1.##2##3.##4%
+{%
+ \if##49\if##21\expandafter\expandafter\expandafter\XINT_infloat_Z\fi\fi
+ #1##2##3[##1]%
+}}\XINT_infloat_Y{ }%
+\def\XINT_infloat_Z #1#2#3[#4]%
+{%
+ \expandafter\XINT_infloat_ZZ\the\numexpr#4+\xint_c_i.#3.%
+}%
+\def\XINT_infloat_ZZ #1.#2.{ 1#2[#1]}%
\def\xintPFloat {\romannumeral0\xintpfloat }%
\def\xintpfloat #1{\XINT_pfloat_chkopt #1\xint_relax }%
\def\XINT_pfloat_chkopt #1%
@@ -1957,7 +1900,7 @@
\expandafter\XINT_pfloat_a
\romannumeral0\xintfloat [\XINTdigits]{#1};\XINTdigits.%
}%
-\def\XINT_pfloat_opt [\xint_relax #1]%#2%
+\def\XINT_pfloat_opt [\xint_relax #1]%
{%
\expandafter\XINT_pfloat_opt_a \the\numexpr #1.%
}%
@@ -1970,48 +1913,48 @@
\xint_UDzerominusfork
#1-\XINT_pfloat_zero
0#1\XINT_pfloat_neg
- 0-{\XINT_pfloat_pos #1}%
- \krof
+ 0-\XINT_pfloat_pos
+ \krof #1%
}%
\def\XINT_pfloat_zero #1;#2.{ 0.}%
-\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
- \ifnum #2<-\xint_c_v \xint_dothis\XINT_pfloat_no\fi
- \ifnum #2<\xint_c_ \xint_dothis\XINT_pfloat_N\fi
- \ifnum #2>\numexpr #3-\xint_c_i\relax \xint_dothis\XINT_pfloat_Ps\fi
- \xint_orthat\XINT_pfloat_P #1e#2;%
-}%
-\def\XINT_pfloat_no #1;{ #1}%
-\def\XINT_pfloat_N #1#2.#3e#4;%
-{%
- \csname XINT_pfloat_N\romannumeral-#4\endcsname #2#10.#3;%
-}%
-\def\XINT_pfloat_Ni #1#2#3.#4;{ #2.#1#4}%
-\def\XINT_pfloat_Nii #1#2#3.#4;{ 0.#2#1#4}%
-\def\XINT_pfloat_Niii#1#2#3.#4;{ 0.0#2#1#4}%
-\def\XINT_pfloat_Niv #1#2#3.#4;{ 0.00#2#1#4}%
-\def\XINT_pfloat_Nv #1#2#3.#4;{ 0.000#2#1#4}%
-\def\XINT_pfloat_P #1#2.#3e#4;%
-{%
- \csname XINT_pfloat_P_\romannumeral#4\endcsname #3.#1#2;%
-}%
-\def\XINT_pfloat_P_ #1.#2;{ #2.#1}%
-\def\XINT_pfloat_P_i #1#2.#3;{ #3#1.#2}%
-\def\XINT_pfloat_P_ii #1#2#3.#4;{ #4#1#2.#3}%
-\def\XINT_pfloat_P_iii#1#2#3#4.#5;{ #5#1#2#3.#4}%
-\def\XINT_pfloat_P_iv #1#2#3#4#5.#6;{ #6#1#2#3#4.#5}%
-\def\XINT_pfloat_P_v #1#2#3#4#5#6.#7;{ #7#1#2#3#4#5.#6}%
-\def\XINT_pfloat_Ps #1#2.#3e#4;%
-{%
- \csname XINT_pfloat_Ps\romannumeral#4\endcsname #300000.#1#2;%
-}%
-\def\XINT_pfloat_Psi #1#2.#3;{ #3#1.}%
-\def\XINT_pfloat_Psii #1#2#3.#4;{ #4#1#2.}%
-\def\XINT_pfloat_Psiii#1#2#3#4.#5;{ #5#1#2#3.}%
-\def\XINT_pfloat_Psiv #1#2#3#4#5.#6;{ #6#1#2#3#4.}%
-\def\XINT_pfloat_Psv #1#2#3#4#5#6.#7;{ #7#1#2#3#4#5.}%
+\def\XINT_pfloat_neg-{\expandafter-\romannumeral0\XINT_pfloat_pos }%
+\def\XINT_pfloat_pos #1.#2e#3;#4.%
+{%
+ \ifnum #3>\xint_c_v \xint_dothis\XINT_pfloat_no\fi
+ \ifnum #3<-\xint_c_v \xint_dothis\XINT_pfloat_no\fi
+ \ifnum #3<\xint_c_ \xint_dothis\XINT_pfloat_N\fi
+ \ifnum #3>\numexpr #4-\xint_c_i\relax \xint_dothis\XINT_pfloat_Ps\fi
+ \xint_orthat\XINT_pfloat_P #1#2e#3;%
+}%
+\def\XINT_pfloat_no #1#2;{ #1.#2}%
+\def\XINT_pfloat_N #1e-#2;%
+{%
+ \csname XINT_pfloat_N_\romannumeral#2\endcsname #1%
+}%
+\def\XINT_pfloat_N_i { 0.}%
+\def\XINT_pfloat_N_ii { 0.0}%
+\def\XINT_pfloat_N_iii{ 0.00}%
+\def\XINT_pfloat_N_iv { 0.000}%
+\def\XINT_pfloat_N_v { 0.0000}%
+\def\XINT_pfloat_P #1e#2;%
+{%
+ \csname XINT_pfloat_P_\romannumeral#2\endcsname #1%
+}%
+\def\XINT_pfloat_P_ #1{ #1.}%
+\def\XINT_pfloat_P_i #1#2{ #1#2.}%
+\def\XINT_pfloat_P_ii #1#2#3{ #1#2#3.}%
+\def\XINT_pfloat_P_iii#1#2#3#4{ #1#2#3#4.}%
+\def\XINT_pfloat_P_iv #1#2#3#4#5{ #1#2#3#4#5.}%
+\def\XINT_pfloat_P_v #1#2#3#4#5#6{ #1#2#3#4#5#6.}%
+\def\XINT_pfloat_Ps #1e#2;%
+{%
+ \csname XINT_pfloat_Ps\romannumeral#2\endcsname #100000;%
+}%
+\def\XINT_pfloat_Psi #1#2#3;{ #1#2.}%
+\def\XINT_pfloat_Psii #1#2#3#4;{ #1#2#3.}%
+\def\XINT_pfloat_Psiii#1#2#3#4#5;{ #1#2#3#4.}%
+\def\XINT_pfloat_Psiv #1#2#3#4#5#6;{ #1#2#3#4#5.}%
+\def\XINT_pfloat_Psv #1#2#3#4#5#6#7;{ #1#2#3#4#5#6.}%
\def\XINTinFloatFracdigits {\romannumeral0\XINTinfloatfracdigits }%
\def\XINTinfloatfracdigits #1%
{%
@@ -2046,7 +1989,7 @@
{%
\xint_gob_til_zero #1\XINT_FL_add_zero 0\XINT_FL_add_b #1%
}%
-\def\XINT_FL_add_zero #1.#2{#2}%
+\def\XINT_FL_add_zero #1.#2{#2}%[[
\def\XINT_FL_add_b #1]#2.#3%
{%
\expandafter\XINT_FL_add_c\romannumeral0\XINTinfloat[#2]{#3}#2.#1]%
@@ -2113,7 +2056,7 @@
{%
\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\XINT_FL_mul_b #1[#2]#3[#4]{\xintiiMul{#3}{#1}/1[#4+#2]}%
\def\xintFloatDiv {\romannumeral0\xintfloatdiv }%
\def\xintfloatdiv #1{\XINT_fldiv_chkopt \xintfloat #1\xint_relax }%
\def\XINTinFloatDiv {\romannumeral0\XINTinfloatdiv }%
@@ -2128,7 +2071,7 @@
{%
#1[\XINTdigits]%
{\expandafter\XINT_FL_div_a
- \romannumeral0\XINTinfloatS[\XINTdigits]{#2}\XINTdigits.{#3}}%
+ \romannumeral0\XINTinfloatS[\XINTdigits]{#3}\XINTdigits.{#2}}%
}%
\def\XINT_fldiv_opt #1[\xint_relax #2]%#3#4%
{%
@@ -2136,13 +2079,13 @@
}%
\def\XINT_fldiv_opt_a #1.#2#3#4%
{%
- #2[#1]{\expandafter\XINT_FL_div_a\romannumeral0\XINTinfloatS[#1]{#3}#1.{#4}}%
+ #2[#1]{\expandafter\XINT_FL_div_a\romannumeral0\XINTinfloatS[#1]{#4}#1.{#3}}%
}%
\def\XINT_FL_div_a #1[#2]#3.#4%
{%
- \expandafter\XINT_FL_div_b\romannumeral0\XINTinfloatS[#3]{#4}#1[#2]%
+ \expandafter\XINT_FL_div_b\romannumeral0\XINTinfloatS[#3]{#4}/#1e#2%
}%
-\def\XINT_FL_div_b #1[#2]#3[#4]{\xintE{#3/#1}{#4-#2}}%
+\def\XINT_FL_div_b #1[#2]{#1e#2}%
\def\xintFloatPow {\romannumeral0\xintfloatpow}%
\def\xintfloatpow #1{\XINT_flpow_chkopt \xintfloat #1\xint_relax }%
\def\XINTinFloatPow {\romannumeral0\XINTinfloatpow }%
@@ -2290,7 +2233,7 @@
{%
\expandafter\XINT_flpow_IIIend
\xint_UDsignfork
- #5{{\xintNum{1/#3[\xint_c_ii*#4-\xint_c_i]}[\xint_c_i-\xint_c_ii*#4-#2]}}%
+ #5{{1/#3[-#2]}}%
-{{#3[#2]}}%
\krof #1%
}%
@@ -2300,34 +2243,43 @@
\def\xintfloatpower #1{\XINT_flpower_chkopt \xintfloat #1\xint_relax }%
\def\XINTinFloatPower {\romannumeral0\XINTinfloatpower }%
\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}{\XINTinfloatS[\XINTdigits]}}%
-\def\XINT_flpowerh_a #1.#2%
+\def\XINTinFloatPowerH {\romannumeral0\XINTinfloatpowerh }%
+\def\XINTinfloatpowerh #1#2%
+{%
+ \expandafter\XINT_flpowerh_a\romannumeral0\xintitrunc1{#2};%
+ \XINTdigits.{#1}{\XINTinfloatS[\XINTdigits]}%
+}%
+\def\XINT_flpowerh_a #1;%
{%
- \ifnum#2>\xint_c_iv\xint_dothis\XINT_flpowerh_b\fi
- \xint_orthat\XINT_flpowerh_i #1.#2%
+ \if0\xintiiLDg{#1}\expandafter\XINT_flpowerh_int
+ \else\expandafter\XINT_flpowerh_b
+ \fi #1.%
}%
-\def\XINT_flpowerh_i #1.#2;%
- {\expandafter\XINT_flpower_checkB_a\romannumeral0\xintinum{#1}.}%
-\def\XINT_flpowerh_b #1%
+\def\XINT_flpowerh_int #1%
{%
- \if#1-\xint_dothis\XINT_flpowerh_bneg\fi
- \xint_orthat{\XINT_flpowerh_bpos #1}%
+ \if0#1\expandafter\XINT_flpower_BisZero
+ \else\expandafter\XINT_flpowerh_i
+ \fi #1%
}%
-\def\XINT_flpowerh_bpos #1.#2;\XINTdigits.#3#4%
+\def\XINT_flpowerh_i #10.{\expandafter\XINT_flpower_checkB_a#1.}%
+\def\XINT_flpowerh_b #1.%
{%
- \expandafter\XINT_flpower_checkB_a
- \romannumeral0\xintinc{\xintDouble{#1}}.%
- \XINTdigits.{#3}{\XINTinfloatsqrt[\XINTdigits]}%
+ \expandafter\XINT_flpowerh_c\romannumeral0\xintdsrr{\xintDouble{#1}}.%
}%
-\def\XINT_flpowerh_bneg #1.#2;\XINTdigits.#3#4%
+\def\XINT_flpowerh_c #1.%
{%
- \expandafter\XINT_flpower_checkB_a
- \expandafter-\romannumeral0\xintinc{\xintDouble{#1}}.%
- \XINTdigits.{#3}{\XINTinfloatsqrt[\XINTdigits]}%
+ \ifodd\xintiiLDg{#1} %<- intentional space
+ \expandafter\XINT_flpowerh_d\else\expandafter\XINT_flpowerh_e
+ \fi #1.%
}%
+\def\XINT_flpowerh_d #1.\XINTdigits.#2#3%
+{%
+ \XINT_flpower_checkB_a #1.\XINTdigits.{#2}\XINT_flpowerh_finish
+}%
+\def\XINT_flpowerh_finish #1%
+ {\XINTinfloatS[\XINTdigits]{\XINTinFloatSqrt[\XINTdigits+\xint_c_iii]{#1}}}%
+\def\XINT_flpowerh_e #1.%
+ {\expandafter\XINT_flpower_checkB_a\romannumeral0\xinthalf{#1}.}%
\def\XINT_flpower_chkopt #1#2%
{%
\ifx [#2\expandafter\XINT_flpower_opt
@@ -2352,12 +2304,12 @@
\def\XINT_flpower_checkB_a #1%
{%
\xint_UDzerominusfork
- #1-\XINT_flpower_BisZero
+ #1-{\XINT_flpower_BisZero 0}%
0#1{\XINT_flpower_checkB_b -}%
0-{\XINT_flpower_checkB_b {}#1}%
\krof
}%
-\def\XINT_flpower_BisZero .#1.#2#3{#3{1[0]}}%
+\def\XINT_flpower_BisZero 0.#1.#2#3{#3{1[0]}}%
\def\XINT_flpower_checkB_b #1#2.#3.%
{%
\expandafter\XINT_flpower_checkB_c
@@ -2393,8 +2345,9 @@
\def\XINT_flpower_loopI #1.%
{%
\if1\XINT_isOne {#1}\xint_dothis\XINT_flpower_ItoIII\fi
- \if1\xintiiOdd {#1}\xint_dothis{\expandafter\XINT_flpower_loopI_odd}\fi
- \xint_orthat{\expandafter\XINT_flpower_loopI_even}%
+ \ifodd\xintiiLDg{#1} %<- intentional space
+ \xint_dothis{\expandafter\XINT_flpower_loopI_odd}\fi
+ \xint_orthat{\expandafter\XINT_flpower_loopI_even}%
\romannumeral0\XINT_half
#1\xint_bye\xint_Bye345678\xint_bye
*\xint_c_v+\xint_c_v)/\xint_c_x-\xint_c_i\relax.%
@@ -2421,8 +2374,9 @@
\def\XINT_flpower_loopII #1.%
{%
\if1\XINT_isOne{#1}\xint_dothis\XINT_flpower_IItoIII\fi
- \if1\xintiiOdd{#1}\xint_dothis{\expandafter\XINT_flpower_loopII_odd}\fi
- \xint_orthat{\expandafter\XINT_flpower_loopII_even}%
+ \ifodd\xintiiLDg{#1} %<- intentional space
+ \xint_dothis{\expandafter\XINT_flpower_loopII_odd}\fi
+ \xint_orthat{\expandafter\XINT_flpower_loopII_even}%
\romannumeral0\XINT_half#1\xint_bye\xint_Bye345678\xint_bye
*\xint_c_v+\xint_c_v)/\xint_c_x-\xint_c_i\relax.%
}%
@@ -2994,22 +2948,35 @@
}%
\def\XINT_floate_noopt #1\xint_relax
{%
- \expandafter\XINT_floate_a\expandafter\XINTdigits
- \romannumeral0\XINT_infrac {#1}%
+ \expandafter\XINT_floate_post
+ \romannumeral0\XINTinfloat[\XINTdigits]{#1}\XINTdigits.%
+}%
+\def\XINT_floate_opt [\xint_relax #1]%
+{%
+ \expandafter\XINT_floate_opt_a\the\numexpr #1.%
}%
-\def\XINT_floate_opt [\xint_relax #1]#2%
+\def\XINT_floate_opt_a #1.#2%
{%
- \expandafter\XINT_floate_a\expandafter
- {\the\numexpr #1\expandafter}\romannumeral0\XINT_infrac {#2}%
+ \expandafter\XINT_floate_post
+ \romannumeral0\XINTinfloat[#1]{#2}#1.%
}%
-\def\XINT_floate_a #1#2#3#4#5%
+\def\XINT_floate_post #1%
+{%
+ \xint_UDzerominusfork
+ #1-\XINT_floate_zero
+ 0#1\XINT_floate_neg
+ 0-\XINT_floate_pos
+ \krof #1%
+}%[
+\def\XINT_floate_zero #1]#2.#3{ 0.e0}%
+\def\XINT_floate_neg-{\expandafter-\romannumeral0\XINT_floate_pos}%
+\def\XINT_floate_pos #1#2[#3]#4.#5%
{%
- \expandafter\XINT_float_a\the\numexpr#1\expandafter.%
- \expandafter{\the\numexpr #2+#5}{#3}{#4}\XINT_float_Q
+ \expandafter\XINT_float_pos_done\the\numexpr#3+#4+#5-\xint_c_i.#1.#2;%
}%
\def\XINTinFloatE {\romannumeral0\XINTinfloate }%
\def\XINTinfloate
- {\expandafter\XINT_infloate\romannumeral0\XINTinfloat [\XINTdigits]}%
+ {\expandafter\XINT_infloate\romannumeral0\XINTinfloat[\XINTdigits]}%
\def\XINT_infloate #1[#2]#3%
{\expandafter\XINT_infloate_end\the\numexpr #3+#2.{#1}}%
\def\XINT_infloate_end #1.#2{ #2[#1]}%
diff --git a/Master/texmf-dist/tex/generic/xint/xintgcd.sty b/Master/texmf-dist/tex/generic/xint/xintgcd.sty
index 4073ffd4660..2d6c491df14 100644
--- a/Master/texmf-dist/tex/generic/xint/xintgcd.sty
+++ b/Master/texmf-dist/tex/generic/xint/xintgcd.sty
@@ -21,8 +21,8 @@
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%% ---------------------------------------------------------------
-%% The xint bundle 1.2j 2016/12/22
-%% Copyright (C) 2013-2016 by Jean-Francois Burnol
+%% The xint bundle 1.2k 2017/01/06
+%% Copyright (C) 2013-2017 by Jean-Francois Burnol
%% xintgcd: Euclidean algorithm with xint package
%% ---------------------------------------------------------------
\begingroup\catcode61\catcode48\catcode32=10\relax%
@@ -70,7 +70,7 @@
\XINTsetupcatcodes% defined in xintkernel.sty
\XINT_providespackage
\ProvidesPackage{xintgcd}%
- [2016/12/22 1.2j Euclide algorithm with xint package (JFB)]%
+ [2017/01/06 1.2k 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 5e430f90f7d..b710be4d9c1 100644
--- a/Master/texmf-dist/tex/generic/xint/xintkernel.sty
+++ b/Master/texmf-dist/tex/generic/xint/xintkernel.sty
@@ -21,8 +21,8 @@
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%% ---------------------------------------------------------------
-%% The xint bundle 1.2j 2016/12/22
-%% Copyright (C) 2013-2016 by Jean-Francois Burnol
+%% The xint bundle 1.2k 2017/01/06
+%% Copyright (C) 2013-2017 by Jean-Francois Burnol
%% xintkernel: Paraphernalia for the xint packages
%% ---------------------------------------------------------------
\begingroup\catcode61\catcode48\catcode32=10\relax%
@@ -156,7 +156,7 @@
\fi
\XINT_providespackage
\ProvidesPackage {xintkernel}%
- [2016/12/22 1.2j Paraphernalia for the xint packages (JFB)]%
+ [2017/01/06 1.2k Paraphernalia for the xint packages (JFB)]%
\chardef\xint_c_ 0
\chardef\xint_c_i 1
\chardef\xint_c_ii 2
@@ -276,16 +276,15 @@
\noexpand\expandafter\space\noexpand\xint_gob_til_xint_relax #1%
}%
\def\xintLength {\romannumeral0\xintlength }%
-\long\edef\xintlength #1%
+\def\xintlength #1{\long\def\xintlength ##1%
{%
- \noexpand\expandafter\space
- \noexpand\the\numexpr\noexpand\XINT_length_loop
- #1\xint_relax\xint_relax\xint_relax\xint_relax
+ \expandafter#1\the\numexpr\XINT_length_loop
+ ##1\xint_relax\xint_relax\xint_relax\xint_relax
\xint_relax\xint_relax\xint_relax\xint_relax\xint_relax
\xint_c_viii\xint_c_vii\xint_c_vi\xint_c_v
- \xint_c_iv\xint_c_iii\xint_c_ii\xint_c_i\xint_c_\noexpand\xint_bye
+ \xint_c_iv\xint_c_iii\xint_c_ii\xint_c_i\xint_c_\xint_bye
\relax
-}%
+}}\xintlength{ }%
\long\def\XINT_length_loop #1#2#3#4#5#6#7#8#9%
{%
\xint_gob_til_xint_relax #9\XINT_length_finish_a\xint_relax
diff --git a/Master/texmf-dist/tex/generic/xint/xintseries.sty b/Master/texmf-dist/tex/generic/xint/xintseries.sty
index 870ff7767de..cadb5bae7de 100644
--- a/Master/texmf-dist/tex/generic/xint/xintseries.sty
+++ b/Master/texmf-dist/tex/generic/xint/xintseries.sty
@@ -21,8 +21,8 @@
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%% ---------------------------------------------------------------
-%% The xint bundle 1.2j 2016/12/22
-%% Copyright (C) 2013-2016 by Jean-Francois Burnol
+%% The xint bundle 1.2k 2017/01/06
+%% Copyright (C) 2013-2017 by Jean-Francois Burnol
%% xintseries: Expandable partial sums with xint package
%% ---------------------------------------------------------------
\begingroup\catcode61\catcode48\catcode32=10\relax%
@@ -70,7 +70,7 @@
\XINTsetupcatcodes% defined in xintkernel.sty
\XINT_providespackage
\ProvidesPackage{xintseries}%
- [2016/12/22 1.2j Expandable partial sums with xint package (JFB)]%
+ [2017/01/06 1.2k 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 cd5269ac268..732a24d643f 100644
--- a/Master/texmf-dist/tex/generic/xint/xinttools.sty
+++ b/Master/texmf-dist/tex/generic/xint/xinttools.sty
@@ -21,8 +21,8 @@
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%% ---------------------------------------------------------------
-%% The xint bundle 1.2j 2016/12/22
-%% Copyright (C) 2013-2016 by Jean-Francois Burnol
+%% The xint bundle 1.2k 2017/01/06
+%% Copyright (C) 2013-2017 by Jean-Francois Burnol
%% xinttools: Expandable and non-expandable utilities
%% ---------------------------------------------------------------
\begingroup\catcode61\catcode48\catcode32=10\relax%
@@ -70,7 +70,7 @@
\XINTsetupcatcodes% defined in xintkernel.sty
\XINT_providespackage
\ProvidesPackage{xinttools}%
- [2016/12/22 1.2j Expandable and non-expandable utilities (JFB)]%
+ [2017/01/06 1.2k Expandable and non-expandable utilities (JFB)]%
\newtoks\XINT_toks
\xint_firstofone{\let\XINT_sptoken= } %<- space here!
\def\xintgodef {\global\xintodef }%
@@ -1409,11 +1409,35 @@
\XINT_reverse:f:csv_finish #1%
}%
\long\def\XINT_reverse:f:csv_finish #1\xint_relax,{ }%
+\def\xintFirstItem:f:csv {\romannumeral0\xintfirstitem:f:csv}%
+\long\def\xintfirstitem:f:csv #1%
+{%
+ \expandafter\XINT_first:f:csv_a\romannumeral`&&@#1,\xint_bye
+}%
+\long\def\XINT_first:f:csv_a #1,#2\xint_bye{ #1}%
+\def\xintLastItem:f:csv {\romannumeral0\xintlastitem:f:csv}%
+\long\def\xintlastitem:f:csv #1%
+{%
+ \expandafter\XINT_last:f:csv_loop\expandafter{\expandafter}\expandafter.%
+ \romannumeral`&&@#1,%
+ \xint_relax\XINT_last_loop_enda,\xint_relax\XINT_last_loop_endb,%
+ \xint_relax\XINT_last_loop_endc,\xint_relax\XINT_last_loop_endd,%
+ \xint_relax\XINT_last_loop_ende,\xint_relax\XINT_last_loop_endf,%
+ \xint_relax\XINT_last_loop_endg,\xint_relax\XINT_last_loop_endh,\xint_bye
+}%
+\long\def\XINT_last:f:csv_loop #1.#2,#3,#4,#5,#6,#7,#8,#9,%
+{%
+ \xint_gob_til_xint_relax #9%
+ {#8}{#7}{#6}{#5}{#4}{#3}{#2}{#1}\xint_relax
+ \XINT_last:f:csv_loop {#9}.%
+}%
\let\xintCSVLength \xintLength:f:csv
\let\xintCSVKeep \xintKeep:f:csv
\let\xintCSVTrim \xintTrim:f:csv
\let\xintCSVNthEltPy \xintNthEltPy:f:csv
\let\xintCSVReverse \xintReverse:f:csv
+\let\xintCSVFirstItem\xintFirstItem:f:csv
+\let\xintCSVLastItem \xintLastItem:f:csv
\let\XINT_tmpa\relax \let\XINT_tmpb\relax \let\XINT_tmpc\relax
\XINT_restorecatcodes_endinput%
\endinput