summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/xint
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2014-01-09 23:59:41 +0000
committerKarl Berry <karl@freefriends.org>2014-01-09 23:59:41 +0000
commitaf91cefd8b0ad8fe98e9ef318d337636b3f54a19 (patch)
tree6b68c531657de5b211fa117d8b08836300bc5583 /Master/texmf-dist/tex/generic/xint
parent3e2f1017cfd105d03e88036cae3a040a59d1c3b5 (diff)
xint (9jan14)
git-svn-id: svn://tug.org/texlive/trunk@32618 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/xint')
-rw-r--r--Master/texmf-dist/tex/generic/xint/xint.sty1023
-rw-r--r--Master/texmf-dist/tex/generic/xint/xintbinhex.sty28
-rw-r--r--Master/texmf-dist/tex/generic/xint/xintcfrac.sty12
-rw-r--r--Master/texmf-dist/tex/generic/xint/xintexpr.sty86
-rw-r--r--Master/texmf-dist/tex/generic/xint/xintfrac.sty775
-rw-r--r--Master/texmf-dist/tex/generic/xint/xintgcd.sty32
-rw-r--r--Master/texmf-dist/tex/generic/xint/xintseries.sty12
-rw-r--r--Master/texmf-dist/tex/generic/xint/xinttools.sty58
8 files changed, 1119 insertions, 907 deletions
diff --git a/Master/texmf-dist/tex/generic/xint/xint.sty b/Master/texmf-dist/tex/generic/xint/xint.sty
index d51548b4f59..5064a290659 100644
--- a/Master/texmf-dist/tex/generic/xint/xint.sty
+++ b/Master/texmf-dist/tex/generic/xint/xint.sty
@@ -21,9 +21,9 @@
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%%----------------------------------------------------------------
-%% The xint bundle (version 1.09i of December 18, 2013)
+%% The xint bundle (version 1.09j of January 9, 2014)
%% xint: Expandable operations on long numbers
-%% Copyright (C) 2013 by Jean-Francois Burnol
+%% Copyright (C) 2013-2014 by Jean-Francois Burnol
%%----------------------------------------------------------------
\begingroup\catcode61\catcode48\catcode32=10\relax%
\catcode13=5 % ^^M
@@ -53,8 +53,7 @@
\else
\ifx\x\relax % plain-TeX, first loading of xint.sty
\ifx\w\relax % but xinttools.sty not yet loaded.
- \y{xint}{Package xinttools is required}%
- \y{xint}{Will try \string\input\space xinttools.sty}%
+ \y{xint}{now issuing \string\input\space xinttools.sty}%
\def\z{\endgroup\input xinttools.sty\relax}%
\fi
\else
@@ -62,8 +61,7 @@
\ifx\x\empty % LaTeX, first loading,
% variable is initialized, but \ProvidesPackage not yet seen
\ifx\w\relax % xinttools.sty not yet loaded.
- \y{xint}{Package xinttools is required}%
- \y{xint}{Will try \string\RequirePackage{xinttools}}%
+ \y{xint}{now issuing \string\RequirePackage{xinttools}}%
\def\z{\endgroup\RequirePackage{xinttools}}%
\fi
\else
@@ -103,13 +101,13 @@
\XINTsetupcatcodes%
\XINT_providespackage
\ProvidesPackage{xint}%
- [2013/12/18 v1.09i Expandable operations on long numbers (jfB)]%
+ [2014/01/09 v1.09j Expandable operations on long numbers (jfB)]%
\long\def\xint_firstofthree #1#2#3{#1}%
\long\def\xint_secondofthree #1#2#3{#2}%
\long\def\xint_thirdofthree #1#2#3{#3}%
-\long\def\xint_firstofthree_afterstop #1#2#3{ #1}% 1.09i
-\long\def\xint_secondofthree_afterstop #1#2#3{ #2}%
-\long\def\xint_thirdofthree_afterstop #1#2#3{ #3}%
+\long\def\xint_firstofthree_thenstop #1#2#3{ #1}% 1.09i
+\long\def\xint_secondofthree_thenstop #1#2#3{ #2}%
+\long\def\xint_thirdofthree_thenstop #1#2#3{ #3}%
\def\xint_gob_til_zero #10{}%
\def\xint_gob_til_zeros_iii #1000{}%
\def\xint_gob_til_zeros_iv #10000{}%
@@ -118,7 +116,7 @@
\def\xint_gob_til_minus #1-{}%
\def\xint_gob_til_relax #1\relax {}%
\def\xint_exchangetwo_keepbraces #1#2{{#2}{#1}}%
-\def\xint_exchangetwo_keepbraces_afterstop #1#2{ {#2}{#1}}%
+\def\xint_exchangetwo_keepbraces_thenstop #1#2{ {#2}{#1}}%
\def\xint_UDzerofork #10#2#3\krof {#2}%
\def\xint_UDsignfork #1-#2#3\krof {#2}%
\def\xint_UDwfork #1\W#2#3\krof {#2}%
@@ -131,8 +129,12 @@
\chardef\xint_c_iii 3
\chardef\xint_c_iv 4
\chardef\xint_c_v 5
-\chardef\xint_c_ix 9
-\chardef\xint_c_x 10
+\chardef\xint_c_ix 9
+\chardef\xint_c_x 10
+\chardef\xint_c_ii^v 32 % not used in xint, common to xintfrac and xintbinhex
+\chardef\xint_c_ii^vi 64
+\mathchardef\xint_c_ixixixix 9999
+\mathchardef\xint_c_x^iv 10000
\newcount\xint_c_x^viii \xint_c_x^viii 100000000
\def\xintRev {\romannumeral0\xintrev }%
\def\xintrev #1%
@@ -146,7 +148,7 @@
\def\XINT_rev_fork #1%
{%
\xint_UDsignfork
- #1{\expandafter\xint_minus_afterstop\romannumeral0\XINT_rord_main {}}%
+ #1{\expandafter\xint_minus_thenstop\romannumeral0\XINT_rord_main {}}%
-{\XINT_rord_main {}#1}%
\krof
}%
@@ -260,7 +262,7 @@
{%
\noexpand\expandafter\space\noexpand\the\numexpr #1#2#3#4\relax
}%
-\def\xint_cleanupzeros_nospace #1#2#3#4%
+\def\xint_cleanupzeros_nostop #1#2#3#4%
{%
\the\numexpr #1#2#3#4\relax
}%
@@ -381,7 +383,7 @@
0-{1}%
\krof
}%
-\def\XINT__Sgn #1#2\Z
+\def\XINT_cntSgn #1#2\Z
{%
\xint_UDzerominusfork
#1-\z@
@@ -395,12 +397,12 @@
\def\xintSgnFork {\romannumeral0\xintsgnfork }%
\def\xintsgnfork #1%
{%
- \ifcase #1 \expandafter\xint_secondofthree_afterstop
- \or\expandafter\xint_thirdofthree_afterstop
- \else\expandafter\xint_firstofthree_afterstop
+ \ifcase #1 \expandafter\xint_secondofthree_thenstop
+ \or\expandafter\xint_thirdofthree_thenstop
+ \else\expandafter\xint_firstofthree_thenstop
\fi
}%
-\def\XINT__SgnFork #1%
+\def\XINT_cntSgnFork #1%
{%
\ifcase #1\expandafter\xint_secondofthree
\or\expandafter\xint_thirdofthree
@@ -411,36 +413,36 @@
\def\xintifsgn #1%
{%
\ifcase \romannumeral0\xintsgn{#1}
- \expandafter\xint_secondofthree_afterstop
- \or\expandafter\xint_thirdofthree_afterstop
- \else\expandafter\xint_firstofthree_afterstop
+ \expandafter\xint_secondofthree_thenstop
+ \or\expandafter\xint_thirdofthree_thenstop
+ \else\expandafter\xint_firstofthree_thenstop
\fi
}%
\def\xintifZero {\romannumeral0\xintifzero }%
\def\xintifzero #1%
{%
\if0\xintSgn{#1}%
- \expandafter\xint_firstoftwo_afterstop
+ \expandafter\xint_firstoftwo_thenstop
\else
- \expandafter\xint_secondoftwo_afterstop
+ \expandafter\xint_secondoftwo_thenstop
\fi
}%
\def\xintifNotZero {\romannumeral0\xintifnotzero }%
\def\xintifnotzero #1%
{%
\if0\xintSgn{#1}%
- \expandafter\xint_secondoftwo_afterstop
+ \expandafter\xint_secondoftwo_thenstop
\else
- \expandafter\xint_firstoftwo_afterstop
+ \expandafter\xint_firstoftwo_thenstop
\fi
}%
\def\xintifOne {\romannumeral0\xintifone }%
\def\xintifone #1%
{%
\if1\xintIsOne{#1}%
- \expandafter\xint_firstoftwo_afterstop
+ \expandafter\xint_firstoftwo_thenstop
\else
- \expandafter\xint_secondoftwo_afterstop
+ \expandafter\xint_secondoftwo_thenstop
\fi
}%
\let\xintifTrueAelseB\xintifNotZero
@@ -451,42 +453,42 @@
\def\xintifcmp #1#2%
{%
\ifcase\xintCmp {#1}{#2}
- \expandafter\xint_secondofthree_afterstop
- \or\expandafter\xint_thirdofthree_afterstop
- \else\expandafter\xint_firstofthree_afterstop
+ \expandafter\xint_secondofthree_thenstop
+ \or\expandafter\xint_thirdofthree_thenstop
+ \else\expandafter\xint_firstofthree_thenstop
\fi
}%
\def\xintifEq {\romannumeral0\xintifeq }%
\def\xintifeq #1#2%
{%
\if0\xintCmp{#1}{#2}%
- \expandafter\xint_firstoftwo_afterstop
- \else\expandafter\xint_secondoftwo_afterstop
+ \expandafter\xint_firstoftwo_thenstop
+ \else\expandafter\xint_secondoftwo_thenstop
\fi
}%
\def\xintifGt {\romannumeral0\xintifgt }%
\def\xintifgt #1#2%
{%
\if1\xintCmp{#1}{#2}%
- \expandafter\xint_firstoftwo_afterstop
- \else\expandafter\xint_secondoftwo_afterstop
+ \expandafter\xint_firstoftwo_thenstop
+ \else\expandafter\xint_secondoftwo_thenstop
\fi
}%
\def\xintifLt {\romannumeral0\xintiflt }%
\def\xintiflt #1#2%
{%
\ifnum\xintCmp{#1}{#2}<\xint_c_
- \expandafter\xint_firstoftwo_afterstop
- \else \expandafter\xint_secondoftwo_afterstop
+ \expandafter\xint_firstoftwo_thenstop
+ \else \expandafter\xint_secondoftwo_thenstop
\fi
}%
\def\xintifOdd {\romannumeral0\xintifodd }%
\def\xintifodd #1%
{%
\if\xintOdd{#1}1%
- \expandafter\xint_firstoftwo_afterstop
+ \expandafter\xint_firstoftwo_thenstop
\else
- \expandafter\xint_secondoftwo_afterstop
+ \expandafter\xint_secondoftwo_thenstop
\fi
}%
\def\xintiiOpp {\romannumeral0\xintiiopp }%
@@ -890,7 +892,7 @@
\def\XINT_add_firstiszero #1#2#3#4{ #3#1}%
\def\XINT_add_minusminus #1#2#3#4%
{%
- \expandafter\xint_minus_afterstop%
+ \expandafter\xint_minus_thenstop%
\romannumeral0\XINT_add_pre {#2}{#1}%
}%
\def\XINT_add_minusplus #1#2#3#4%
@@ -969,7 +971,7 @@
\def\xint_sub_mp0\XINT_add_pre #1#2{ #2}%
\def\XINT_sub_plusminus #1#2#3#4%
{%
- \xint_gob_til_zero #3\xint_sub_pm0\expandafter\xint_minus_afterstop%
+ \xint_gob_til_zero #3\xint_sub_pm0\expandafter\xint_minus_thenstop%
\romannumeral0\XINT_add_pre {#2}{#3#1}%
}%
\def\xint_sub_pm #1\XINT_add_pre #2#3{ -#2}%
@@ -1100,7 +1102,7 @@
\krof
{#3}%
}%
-\def\XINT_sub_DD {\expandafter\xint_minus_afterstop\romannumeral0\XINT_sub_D }%
+\def\XINT_sub_DD {\expandafter\xint_minus_thenstop\romannumeral0\XINT_sub_D }%
\def\XINT_sub_Fdec #1#2#3#4#5#6%
{%
\xint_gob_til_W #3\xint_sub_Fdec_finish\W
@@ -1116,7 +1118,7 @@
}%
\def\xint_sub_Fdec_finish\W\XINT_sub_Fdec_onestep #1#2%
{%
- \expandafter\xint_minus_afterstop\romannumeral0\XINT_cuz
+ \expandafter\xint_minus_thenstop\romannumeral0\XINT_cuz
}%
\def\XINT_sub_Finc #1#2#3#4#5#6%
{%
@@ -1134,7 +1136,8 @@
\def\xint_sub_Finc_finish\W\XINT_sub_Finc_onestep #1#2#3%
{%
\xint_UDzerofork
- #1{\expandafter\xint_minus_afterstop\xint_cleanupzeros_nospace}%
+ #1{\expandafter\expandafter\expandafter
+ \xint_minus_thenstop\xint_cleanupzeros_nostop}%
0{ -1}%
\krof
#3%
@@ -1173,7 +1176,7 @@
}%
\def\xint_sub_KK_finish\W\XINT_sub_KK_onestep #1#2#3%
{%
- \expandafter\xint_minus_afterstop
+ \expandafter\xint_minus_thenstop
\romannumeral0\XINT_cuz_loop #3\W\W\W\W\W\W\W\Z
}%
\def\xintCmp {\romannumeral0\xintcmp }%
@@ -1296,16 +1299,6 @@
\let\xintIsTrue\xintIsNotZero
\let\xintNot\xintIsZero
\let\xintIsFalse\xintIsZero
-\def\xintIsTrue:csv #1{\expandafter\XINT_istrue:_a\romannumeral-`0#1,,^}%
-\def\XINT_istrue:_a {\XINT_istrue:_b {}}%
-\def\XINT_istrue:_b #1#2,%
- {\expandafter\XINT_istrue:_c\romannumeral-`0#2,{#1}}%
-\def\XINT_istrue:_c #1{\if #1,\expandafter\XINT_:_f
- \else\expandafter\XINT_istrue:_d\fi #1}%
-\def\XINT_istrue:_d #1,%
- {\expandafter\XINT_istrue:_e\romannumeral0\xintisnotzero {#1},}%
-\def\XINT_istrue:_e #1,#2{\XINT_istrue:_b {#2,#1}}%
-\def\XINT_:_f ,#1#2^{\xint_gobble_i #1}%
\def\xintAND {\romannumeral0\xintand }%
\def\xintand #1#2{\if0\xintSgn{#1}\expandafter\xint_firstoftwo
\else\expandafter\xint_secondoftwo\fi
@@ -1326,13 +1319,6 @@
{\xintifTrueAelseB {#1}{\XINT_andof_a}{\XINT_andof_no}}%
\def\XINT_andof_no #1\relax { 0}%
\def\XINT_andof_e #1\Z { 1}%
-\def\xintANDof:csv #1{\expandafter\XINT_andof:_a\romannumeral-`0#1,,^}%
-\def\XINT_andof:_a {\expandafter\XINT_andof:_b\romannumeral-`0}%
-\def\XINT_andof:_b #1{\if #1,\expandafter\XINT_andof:_e
- \else\expandafter\XINT_andof:_c\fi #1}%
-\def\XINT_andof:_c #1,{\xintifTrueAelseB {#1}{\XINT_andof:_a}{\XINT_andof:_no}}%
-\def\XINT_andof:_no #1^{0}%
-\def\XINT_andof:_e #1^{1}%
\def\xintORof {\romannumeral0\xintorof }%
\def\xintorof #1{\expandafter\XINT_orof_a\romannumeral-`0#1\relax }%
\def\XINT_orof_a #1{\expandafter\XINT_orof_b\romannumeral-`0#1\Z }%
@@ -1342,13 +1328,6 @@
{\xintifTrueAelseB {#1}{\XINT_orof_yes}{\XINT_orof_a}}%
\def\XINT_orof_yes #1\relax { 1}%
\def\XINT_orof_e #1\Z { 0}%
-\def\xintORof:csv #1{\expandafter\XINT_orof:_a\romannumeral-`0#1,,^}%
-\def\XINT_orof:_a {\expandafter\XINT_orof:_b\romannumeral-`0}%
-\def\XINT_orof:_b #1{\if #1,\expandafter\XINT_orof:_e
- \else\expandafter\XINT_orof:_c\fi #1}%
-\def\XINT_orof:_c #1,{\xintifTrueAelseB{#1}{\XINT_orof:_yes}{\XINT_orof:_a}}%
-\def\XINT_orof:_yes #1^{1}%
-\def\XINT_orof:_e #1^{0}%
\def\xintXORof {\romannumeral0\xintxorof }%
\def\xintxorof #1{\expandafter\XINT_xorof_a\expandafter
0\romannumeral-`0#1\relax }%
@@ -1361,17 +1340,6 @@
{\XINT_xorof_a #2}%
}%
\def\XINT_xorof_e #1\Z #2{ #2}%
-\def\xintXORof:csv #1{\expandafter\XINT_xorof:_a\expandafter
- 0\romannumeral-`0#1,,^}%
-\def\XINT_xorof:_a #1#2,{\expandafter\XINT_xorof:_b\romannumeral-`0#2,#1}%
-\def\XINT_xorof:_b #1{\if #1,\expandafter\XINT_:_e
- \else\expandafter\XINT_xorof:_c\fi #1}%
-\def\XINT_xorof:_c #1,#2%
- {\xintifTrueAelseB {#1}{\if #20\xint_afterfi{\XINT_xorof:_a 1}%
- \else\xint_afterfi{\XINT_xorof:_a 0}\fi}%
- {\XINT_xorof:_a #2}%
- }%
-\def\XINT_:_e ,#1#2^{#1}% allows empty list
\def\xintGeq {\romannumeral0\xintgeq }%
\def\xintgeq #1%
{%
@@ -1473,25 +1441,25 @@
\krof
{#2}{#4}#1#3%
}%
-\def\XINT_max_zerozero #1#2#3#4{\xint_firstoftwo_afterstop }%
-\def\XINT_max_zeroplus #1#2#3#4{\xint_firstoftwo_afterstop }%
-\def\XINT_max_pluszero #1#2#3#4{\xint_secondoftwo_afterstop }%
-\def\XINT_max_minusplus #1#2#3#4{\xint_firstoftwo_afterstop }%
-\def\XINT_max_plusminus #1#2#3#4{\xint_secondoftwo_afterstop }%
+\def\XINT_max_zerozero #1#2#3#4{\xint_firstoftwo_thenstop }%
+\def\XINT_max_zeroplus #1#2#3#4{\xint_firstoftwo_thenstop }%
+\def\XINT_max_pluszero #1#2#3#4{\xint_secondoftwo_thenstop }%
+\def\XINT_max_minusplus #1#2#3#4{\xint_firstoftwo_thenstop }%
+\def\XINT_max_plusminus #1#2#3#4{\xint_secondoftwo_thenstop }%
\def\XINT_max_plusplus #1#2#3#4%
{%
\ifodd\XINT_Geq {#4#2}{#3#1}
- \expandafter\xint_firstoftwo_afterstop
+ \expandafter\xint_firstoftwo_thenstop
\else
- \expandafter\xint_secondoftwo_afterstop
+ \expandafter\xint_secondoftwo_thenstop
\fi
}%
\def\XINT_max_minusminus #1#2#3#4%
{%
\ifodd\XINT_Geq {#1}{#2}
- \expandafter\xint_firstoftwo_afterstop
+ \expandafter\xint_firstoftwo_thenstop
\else
- \expandafter\xint_secondoftwo_afterstop
+ \expandafter\xint_secondoftwo_thenstop
\fi
}%
\def\xintiMaxof {\romannumeral0\xintimaxof }%
@@ -1505,12 +1473,6 @@
{\expandafter\XINT_imaxof_b\romannumeral0\xintimax {#1}}%
\def\XINT_imaxof_e #1\Z #2\Z { #2}%
\let\xintMaxof\xintiMaxof \let\xintmaxof\xintimaxof
-\def\xintiMaxof:csv #1{\expandafter\XINT_imaxof:_b\romannumeral-`0#1,,}%
-\def\XINT_imaxof:_b #1,#2,{\expandafter\XINT_imaxof:_c\romannumeral-`0#2,{#1},}%
-\def\XINT_imaxof:_c #1{\if #1,\expandafter\XINT_of:_e
- \else\expandafter\XINT_imaxof:_d\fi #1}%
-\def\XINT_imaxof:_d #1,{\expandafter\XINT_imaxof:_b\romannumeral0\xintimax {#1}}%
-\def\XINT_of:_e ,#1,{#1}%
\def\xintiMin {\romannumeral0\xintimin }%
\def\xintimin #1%
{%
@@ -1538,25 +1500,25 @@
\krof
{#2}{#4}#1#3%
}%
-\def\XINT_min_zerozero #1#2#3#4{\xint_firstoftwo_afterstop }%
-\def\XINT_min_zeroplus #1#2#3#4{\xint_secondoftwo_afterstop }%
-\def\XINT_min_pluszero #1#2#3#4{\xint_firstoftwo_afterstop }%
-\def\XINT_min_minusplus #1#2#3#4{\xint_secondoftwo_afterstop }%
-\def\XINT_min_plusminus #1#2#3#4{\xint_firstoftwo_afterstop }%
+\def\XINT_min_zerozero #1#2#3#4{\xint_firstoftwo_thenstop }%
+\def\XINT_min_zeroplus #1#2#3#4{\xint_secondoftwo_thenstop }%
+\def\XINT_min_pluszero #1#2#3#4{\xint_firstoftwo_thenstop }%
+\def\XINT_min_minusplus #1#2#3#4{\xint_secondoftwo_thenstop }%
+\def\XINT_min_plusminus #1#2#3#4{\xint_firstoftwo_thenstop }%
\def\XINT_min_plusplus #1#2#3#4%
{%
\ifodd\XINT_Geq {#4#2}{#3#1}
- \expandafter\xint_secondoftwo_afterstop
+ \expandafter\xint_secondoftwo_thenstop
\else
- \expandafter\xint_firstoftwo_afterstop
+ \expandafter\xint_firstoftwo_thenstop
\fi
}%
\def\XINT_min_minusminus #1#2#3#4%
{%
\ifodd\XINT_Geq {#1}{#2}
- \expandafter\xint_secondoftwo_afterstop
+ \expandafter\xint_secondoftwo_thenstop
\else
- \expandafter\xint_firstoftwo_afterstop
+ \expandafter\xint_firstoftwo_thenstop
\fi
}%
\def\xintiMinof {\romannumeral0\xintiminof }%
@@ -1570,11 +1532,6 @@
{\expandafter\XINT_iminof_b\romannumeral0\xintimin {#1}}%
\def\XINT_iminof_e #1\Z #2\Z { #2}%
\let\xintMinof\xintiMinof \let\xintminof\xintiminof
-\def\xintiMinof:csv #1{\expandafter\XINT_iminof:_b\romannumeral-`0#1,,}%
-\def\XINT_iminof:_b #1,#2,{\expandafter\XINT_iminof:_c\romannumeral-`0#2,{#1},}%
-\def\XINT_iminof:_c #1{\if #1,\expandafter\XINT_of:_e
- \else\expandafter\XINT_iminof:_d\fi #1}%
-\def\XINT_iminof:_d #1,{\expandafter\XINT_iminof:_b\romannumeral0\xintimin {#1}}%
\def\xintiiSum {\romannumeral0\xintiisum }%
\def\xintiisum #1{\xintiisumexpr #1\relax }%
\def\xintiiSumExpr {\romannumeral0\xintiisumexpr }%
@@ -1617,13 +1574,6 @@
\W\X\Y\Z #3\W\X\Y\Z }{#2}%
}%
\def\XINT_sum_NN #1#2{\XINT_sum_loop {#2}{#1}}%
-\def\xintiiSum:csv #1{\expandafter\XINT_iisum:_a\romannumeral-`0#1,,^}%
-\def\XINT_iisum:_a {\XINT_iisum:_b {0}}%
-\def\XINT_iisum:_b #1#2,{\expandafter\XINT_iisum:_c\romannumeral-`0#2,{#1}}%
-\def\XINT_iisum:_c #1{\if #1,\expandafter\XINT_:_e
- \else\expandafter\XINT_iisum:_d\fi #1}%
-\def\XINT_iisum:_d #1,#2{\expandafter\XINT_iisum:_b\expandafter
- {\romannumeral0\xintiiadd {#2}{#1}}}%
\def\xintiiMul {\romannumeral0\xintiimul }%
\def\xintiimul #1%
{%
@@ -1667,14 +1617,14 @@
}%
\def\XINT_mul_minusplus #1#2#3%
{%
- \expandafter\xint_minus_afterstop\romannumeral0\expandafter
+ \expandafter\xint_minus_thenstop\romannumeral0\expandafter
\XINT_mul_choice_a
\expandafter{\romannumeral0\xintlength {#1#3}}%
{\romannumeral0\xintlength {#2}}{#2}{#1#3}%
}%
\def\XINT_mul_plusminus #1#2#3%
{%
- \expandafter\xint_minus_afterstop\romannumeral0\expandafter
+ \expandafter\xint_minus_thenstop\romannumeral0\expandafter
\XINT_mul_choice_a
\expandafter{\romannumeral0\xintlength {#3}}%
{\romannumeral0\xintlength {#1#2}}{#1#2}{#3}%
@@ -2029,26 +1979,12 @@
\let\xintprdexpr\xintiiprdexpr
\def\XINT_prdexpr {\XINT_prod_loop_a 1\Z }%
\def\XINT_prod_loop_a #1\Z #2%
-{%
- \expandafter\XINT_prod_loop_b \romannumeral-`0#2\Z #1\Z \Z
-}%
+ {\expandafter\XINT_prod_loop_b \romannumeral-`0#2\Z #1\Z \Z}%
\def\XINT_prod_loop_b #1%
-{%
- \xint_gob_til_relax #1\XINT_prod_finished\relax
- \XINT_prod_loop_c #1%
-}%
+ {\xint_gob_til_relax #1\XINT_prod_finished\relax\XINT_prod_loop_c #1}%
\def\XINT_prod_loop_c
-{%
- \expandafter\XINT_prod_loop_a\romannumeral0\XINT_mul_fork
-}%
+ {\expandafter\XINT_prod_loop_a\romannumeral0\XINT_mul_fork }%
\def\XINT_prod_finished #1\Z #2\Z \Z { #2}%
-\def\xintiiPrd:csv #1{\expandafter\XINT_iiprd:_a\romannumeral-`0#1,,^}%
-\def\XINT_iiprd:_a {\XINT_iiprd:_b {1}}%
-\def\XINT_iiprd:_b #1#2,{\expandafter\XINT_iiprd:_c\romannumeral-`0#2,{#1}}%
-\def\XINT_iiprd:_c #1{\if #1,\expandafter\XINT_:_e
- \else\expandafter\XINT_iiprd:_d\fi #1}%
-\def\XINT_iiprd:_d #1,#2{\expandafter\XINT_iiprd:_b\expandafter
- {\romannumeral0\xintiimul {#2}{#1}}}%
\def\xintiFac {\romannumeral0\xintifac }%
\def\xintifac #1%
{%
@@ -2057,7 +1993,7 @@
\let\xintFac\xintiFac \let\xintfac\xintifac
\def\XINT_fac_fork #1%
{%
- \ifcase\XINT__Sgn #1\Z
+ \ifcase\XINT_cntSgn #1\Z
\xint_afterfi{\expandafter\space\expandafter 1\xint_gobble_i }%
\or
\expandafter\XINT_fac_checklength
@@ -2069,11 +2005,11 @@
}%
\def\XINT_fac_checklength #1%
{%
- \ifnum #1>999999
+ \ifnum #1>100000
\xint_afterfi{\expandafter\xintError:FactorialOfTooBigNumber
\expandafter\space\expandafter 1\xint_gobble_i }%
\else
- \xint_afterfi{\ifnum #1>9999
+ \xint_afterfi{\ifnum #1>\xint_c_ixixixix
\expandafter\XINT_fac_big_loop
\else
\expandafter\XINT_fac_loop
@@ -2184,7 +2120,7 @@
\def\XINT_pow_AisOne #1#2{ 1}%
\def\XINT_pow_AisZero #1#2%
{%
- \ifcase\XINT__Sgn #1\Z
+ \ifcase\XINT_cntSgn #1\Z
\xint_afterfi { 1}%
\or
\xint_afterfi { 0}%
@@ -2194,7 +2130,7 @@
}%
\def\XINT_pow_AatleastTwo #1%
{%
- \ifcase\XINT__Sgn #1\Z
+ \ifcase\XINT_cntSgn #1\Z
\expandafter\XINT_pow_BisZero
\or
\expandafter\XINT_pow_checkBsize
@@ -2203,94 +2139,91 @@
\fi
{#1}%
}%
-\edef\XINT_pow_BisNegative #1#2{\noexpand\xintError:FractionRoundedToZero\space 0}%
+\edef\XINT_pow_BisNegative #1#2%
+ {\noexpand\xintError:FractionRoundedToZero\space 0}%
\def\XINT_pow_BisZero #1#2{ 1}%
-\def\XINT_pow_checkBsize #1#2%
+\def\XINT_pow_checkBsize #1%
{%
- \ifnum #1>999999999
+ \ifnum #1>100000
\expandafter\XINT_pow_BtooBig
\else
- \expandafter\XINT_pow_loop
+ \expandafter\XINT_pow_loopI
\fi
- {#1}{#2}\XINT_pow_posprod
- \xint_relax
- \xint_bye\xint_bye\xint_bye\xint_bye
- \xint_bye\xint_bye\xint_bye\xint_bye
- \xint_relax
-}%
-\edef\XINT_pow_BtooBig #1\xint_relax #2\xint_relax
- {\noexpand\xintError:ExponentTooBig\space 0}%
-\def\XINT_pow_loop #1#2%
-{%
- \ifnum #1 = 1
- \expandafter\XINT_pow_loop_end
- \else
- \xint_afterfi{\expandafter\XINT_pow_loop_a
- \expandafter{\the\numexpr 2*(#1/2)-#1\expandafter }% b mod 2
- \expandafter{\the\numexpr #1-#1/2\expandafter }% [b/2]
- \expandafter{\romannumeral0\xintiisqr{#2}}}%
- \fi
- {{#2}}%
+ {#1}%
}%
-\def\XINT_pow_loop_end {\romannumeral0\XINT_rord_main {}\relax }%
-\def\XINT_pow_loop_a #1%
+\edef\XINT_pow_BtooBig #1#2{\noexpand\xintError:ExponentTooBig\space 0}%
+\def\XINT_pow_loopI #1%
{%
- \ifnum #1 = 1
- \expandafter\XINT_pow_loop
+ \ifnum #1=\xint_c_i\XINT_pow_Iend\fi
+ \ifodd #1
+ \expandafter\XINT_pow_loopI_odd
\else
- \expandafter\XINT_pow_loop_throwaway
+ \expandafter\XINT_pow_loopI_even
\fi
+ {#1}%
}%
-\def\XINT_pow_loop_throwaway #1#2#3%
+\edef\XINT_pow_Iend\fi #1\fi #2#3{\noexpand\fi\space #3}%
+\def\XINT_pow_loopI_even #1#2%
{%
- \XINT_pow_loop {#1}{#2}%
+ \expandafter\XINT_pow_loopI\expandafter
+ {\the\numexpr #1/\xint_c_ii\expandafter}\expandafter
+ {\romannumeral0\xintiisqr {#2}}%
}%
-\def\XINT_pow_posprod #1%
+\def\XINT_pow_loopI_odd #1#2%
{%
- \XINT_pow_pprod_checkifempty #1\Z
+ \expandafter\XINT_pow_loopI_odda\expandafter
+ {\romannumeral0\XINT_RQ {}#2\R\R\R\R\R\R\R\R\Z }{#1}{#2}%
}%
-\def\XINT_pow_pprod_checkifempty #1%
+\def\XINT_pow_loopI_odda #1#2#3%
{%
- \xint_gob_til_relax #1\XINT_pow_pprod_emptyproduct\relax
- \XINT_pow_pprod_RQfirst #1%
+ \expandafter\XINT_pow_loopII\expandafter
+ {\the\numexpr #2/\xint_c_ii-\xint_c_i\expandafter}\expandafter
+ {\romannumeral0\xintiisqr {#3}}{#1}%
}%
-\def\XINT_pow_pprod_emptyproduct #1\Z { 1}%
-\def\XINT_pow_pprod_RQfirst #1\Z
+\def\XINT_pow_loopII #1%
{%
- \expandafter\XINT_pow_pprod_getnext\expandafter
- {\romannumeral0\XINT_RQ {}#1\R\R\R\R\R\R\R\R\Z}%
+ \ifnum #1 = \xint_c_i\XINT_pow_IIend\fi
+ \ifodd #1
+ \expandafter\XINT_pow_loopII_odd
+ \else
+ \expandafter\XINT_pow_loopII_even
+ \fi
+ {#1}%
}%
-\def\XINT_pow_pprod_getnext #1#2%
+\def\XINT_pow_loopII_even #1#2%
{%
- \XINT_pow_pprod_checkiffinished #2\Z {#1}%
+ \expandafter\XINT_pow_loopII\expandafter
+ {\the\numexpr #1/\xint_c_ii\expandafter}\expandafter
+ {\romannumeral0\xintiisqr {#2}}%
}%
-\def\XINT_pow_pprod_checkiffinished #1%
+\def\XINT_pow_loopII_odd #1#2#3%
{%
- \xint_gob_til_relax #1\XINT_pow_pprod_end\relax
- \XINT_pow_pprod_compute #1%
+ \expandafter\XINT_pow_loopII_odda\expandafter
+ {\romannumeral0\XINT_mulr_enter #3\Z\Z\Z\Z #2\W\W\W\W}{#1}{#2}%
}%
-\def\XINT_pow_pprod_compute #1\Z #2%
+\def\XINT_pow_loopII_odda #1#2#3%
{%
- \expandafter\XINT_pow_pprod_getnext\expandafter
- {\romannumeral0\XINT_mulr_enter #2\Z\Z\Z\Z #1\W\W\W\W }%
+ \expandafter\XINT_pow_loopII\expandafter
+ {\the\numexpr #2/\xint_c_ii-\xint_c_i\expandafter}\expandafter
+ {\romannumeral0\xintiisqr {#3}}{#1}%
}%
-\def\XINT_pow_pprod_end\relax\XINT_pow_pprod_compute #1\Z #2%
+\def\XINT_pow_IIend\fi #1\fi #2#3#4%
{%
- \expandafter\xint_cleanupzeros_andstop
- \romannumeral0\xintreverseorder {#2}%
+ \fi\XINT_mul_enter #4\Z\Z\Z\Z #3\W\W\W\W
}%
\def\xintiiQuo {\romannumeral0\xintiiquo }%
\def\xintiiRem {\romannumeral0\xintiirem }%
-\def\xintiiquo {\expandafter\xint_firstoftwo_afterstop
- \romannumeral0\xintiidivision }%
-\def\xintiirem {\expandafter\xint_secondoftwo_afterstop
- \romannumeral0\xintiidivision }%
+\def\xintiiquo {\expandafter\xint_firstoftwo_thenstop
+ \romannumeral0\xintiidivision }%
+\def\xintiirem {\expandafter\xint_secondoftwo_thenstop
+ \romannumeral0\xintiidivision }%
\def\xintQuo {\romannumeral0\xintquo }%
\def\xintRem {\romannumeral0\xintrem }%
-\def\xintquo {\expandafter\xint_firstoftwo_afterstop
- \romannumeral0\xintdivision }%
-\def\xintrem {\expandafter\xint_secondoftwo_afterstop
- \romannumeral0\xintdivision }%
+\def\xintquo {\expandafter\xint_firstoftwo_thenstop
+ \romannumeral0\xintdivision }%
+\def\xintrem {\expandafter\xint_secondoftwo_thenstop
+ \romannumeral0\xintdivision }%
+\def\xintiiDivision {\romannumeral0\xintiidivision }%
\def\xintiidivision #1%
{%
\expandafter\xint_iidivision\expandafter {\romannumeral-`0#1}%
@@ -2308,7 +2241,6 @@
{%
\expandafter\XINT_div_fork \romannumeral0\xintnum{#2}\Z #1\Z
}%
-\def\XINT_Division #1#2{\romannumeral0\XINT_div_fork #2\Z #1\Z }%
\def\XINT_div_fork #1#2\Z #3#4\Z
{%
\xint_UDzerofork
@@ -2324,48 +2256,45 @@
}%
\edef\XINT_div_BisZero #1#2#3#4{\noexpand\xintError:DivisionByZero\space {0}{0}}%
\def\XINT_div_AisZero #1#2#3#4{ {0}{0}}%
-\def\XINT_div_plusplus #1#2#3#4%
-{%
- \XINT_div_prepare {#3#1}{#4#2}%
-}%
+\def\XINT_div_plusplus #1#2#3#4{\XINT_div_prepare {#3#1}{#4#2}}%
\def\XINT_div_BisNegative #1#2#3#4%
{%
- \expandafter\XINT_div_BisNegative_post
+ \expandafter\XINT_div_BisNegative_b
\romannumeral0\XINT_div_fork #1\Z #4#2\Z
}%
-\edef\XINT_div_BisNegative_post #1%
+\edef\XINT_div_BisNegative_b #1%
{%
\noexpand\expandafter\space\noexpand\expandafter
{\noexpand\romannumeral0\noexpand\XINT_opp #1}%
}%
\def\XINT_div_AisNegative #1#2#3#4%
{%
- \expandafter\XINT_div_AisNegative_post
+ \expandafter\XINT_div_AisNegative_b
\romannumeral0\XINT_div_prepare {#3#1}{#2}{#3#1}%
}%
-\def\XINT_div_AisNegative_post #1#2%
+\def\XINT_div_AisNegative_b #1#2%
{%
\if0\XINT_Sgn #2\Z
- \expandafter \XINT_div_AisNegative_zerorem
+ \expandafter \XINT_div_AisNegative_Rzero
\else
- \expandafter \XINT_div_AisNegative_posrem
+ \expandafter \XINT_div_AisNegative_Rpositive
\fi
{#1}{#2}%
}%
-\edef\XINT_div_AisNegative_zerorem #1#2#3%
+\edef\XINT_div_AisNegative_Rzero #1#2#3%
{%
\noexpand\expandafter\space\noexpand\expandafter
{\noexpand\romannumeral0\noexpand\XINT_opp #1}{0}%
}%
-\def\XINT_div_AisNegative_posrem #1%
+\def\XINT_div_AisNegative_Rpositive #1%
{%
- \expandafter \XINT_div_AisNegative_posrem_b \expandafter
+ \expandafter \XINT_div_AisNegative_Rpositive_b \expandafter
{\romannumeral0\xintiiopp{\xintInc {#1}}}%
}%
-\def\XINT_div_AisNegative_posrem_b #1#2#3%
+\def\XINT_div_AisNegative_Rpositive_b #1#2#3%
{%
- \expandafter \xint_exchangetwo_keepbraces_afterstop \expandafter
- {\romannumeral0\XINT_sub {#3}{#2}}{#1}%
+ \expandafter \xint_exchangetwo_keepbraces_thenstop \expandafter
+ {\romannumeral0\XINT_sub {#3}{#2}}{#1}%
}%
\def\XINT_div_prepare #1%
{%
@@ -2374,341 +2303,352 @@
}%
\def\XINT_div_prepareB_aa #1%
{%
- \ifnum #1=1
- \expandafter\XINT_div_prepareB_ab
+ \ifnum #1=\xint_c_i
+ \expandafter\XINT_div_prepareB_onedigit
\else
\expandafter\XINT_div_prepareB_a
\fi
{#1}%
}%
-\def\XINT_div_prepareB_ab #1#2%
-{%
- \ifnum #2=1
- \expandafter\XINT_div_prepareB_BisOne
- \else
- \expandafter\XINT_div_prepareB_e
- \fi {000}{3}{4}{#2}%
-}%
-\def\XINT_div_prepareB_BisOne #1#2#3#4#5{ {#5}{0}}%
\def\XINT_div_prepareB_a #1%
{%
\expandafter\XINT_div_prepareB_c\expandafter
{\the\numexpr \xint_c_iv*((#1+\xint_c_i)/\xint_c_iv)}{#1}%
}%
+\def\XINT_div_prepareB_onedigit #1#2%
+{%
+ \ifcase#2
+ \or\expandafter\XINT_div_BisOne
+ \or\expandafter\XINT_div_BisTwo
+ \else\expandafter\XINT_div_prepareB_e
+ \fi {000}{0}{4}{#2}%
+}%
+\def\XINT_div_BisOne #1#2#3#4#5{ {#5}{0}}%
+\def\XINT_div_BisTwo #1#2#3#4#5%
+{%
+ \expandafter\expandafter\expandafter\XINT_div_BisTwo_a
+ \ifodd\xintiiLDg{#5} \expandafter1\else \expandafter0\fi {#5}%
+}%
+\edef\XINT_div_BisTwo_a #1#2%
+{%
+ \noexpand\expandafter\space\noexpand\expandafter
+ {\noexpand\romannumeral0\noexpand\xinthalf {#2}}{#1}%
+}%
\def\XINT_div_prepareB_c #1#2%
{%
- \ifcase \numexpr #1-#2\relax
- \expandafter\XINT_div_prepareB_d
- \or
- \expandafter\XINT_div_prepareB_di
- \or
- \expandafter\XINT_div_prepareB_dii
- \or
- \expandafter\XINT_div_prepareB_diii
- \fi {#1}%
+ \csname XINT_div_prepareB_d\romannumeral\numexpr#1-#2\endcsname
+ {#1}%
}%
-\def\XINT_div_prepareB_d {\XINT_div_prepareB_e {}{0}}%
-\def\XINT_div_prepareB_di {\XINT_div_prepareB_e {0}{1}}%
-\def\XINT_div_prepareB_dii {\XINT_div_prepareB_e {00}{2}}%
-\def\XINT_div_prepareB_diii {\XINT_div_prepareB_e {000}{3}}%
+\def\XINT_div_prepareB_d {\XINT_div_prepareB_e {}{0000}}%
+\def\XINT_div_prepareB_di {\XINT_div_prepareB_e {0}{000}}%
+\def\XINT_div_prepareB_dii {\XINT_div_prepareB_e {00}{00}}%
+\def\XINT_div_prepareB_diii {\XINT_div_prepareB_e {000}{0}}%
+\def\XINT_div_cleanR #10000.{{#1}}%
\def\XINT_div_prepareB_e #1#2#3#4%
{%
- \XINT_div_prepareB_f #4#1\Z {#3}{#2}{#1}%
+ \ifnum#3=\xint_c_iv\expandafter\XINT_div_prepareLittleB_f
+ \else\expandafter\XINT_div_prepareB_f
+ \fi
+ #4#1{#3}{#2}{#1}%
}%
-\def\XINT_div_prepareB_f #1#2#3#4#5\Z
-{%
- \expandafter \XINT_div_prepareB_g \expandafter
- {\romannumeral0\xintreverseorder {#1#2#3#4#5}}{#1#2#3#4}%
+\def\XINT_div_prepareB_f #1#2#3#4#5#{%
+ \expandafter\XINT_div_prepareB_g
+ \the\numexpr #1#2#3#4+\xint_c_i\expandafter
+ .\the\numexpr (#1#2#3#4+\xint_c_i)/\xint_c_ii\expandafter
+ .\romannumeral0\xintreverseorder {#1#2#3#4#5}.{#1#2#3#4}%
+}%
+\def\XINT_div_prepareLittleB_f #1#{%
+ \expandafter\XINT_div_prepareB_g \the\numexpr #1/\xint_c_ii.{}.{}.{#1}%
}%
-\def\XINT_div_prepareB_g #1#2#3#4#5#6%
+\def\XINT_div_prepareB_g #1.#2.#3.#4#5#6#7#8%
{%
- \XINT_div_prepareA_a {#6#5}{#2}{#3}{#1}{#4}%
+ \XINT_div_prepareA_a {#8#7}{#5}{{#1}{#2}{#4}}{#3}{#6}%
}%
\def\XINT_div_prepareA_a #1%
{%
- \expandafter \XINT_div_prepareA_b \expandafter
- {\romannumeral0\xintlength {#1}}{#1}% A >0 ici
+ \expandafter\XINT_div_prepareA_b\expandafter
+ {\romannumeral0\xintlength {#1}}{#1}%
}%
\def\XINT_div_prepareA_b #1%
{%
- \expandafter\XINT_div_prepareA_c\expandafter{\the\numexpr 4*((#1+1)/4)}{#1}%
+ \expandafter\XINT_div_prepareA_c\expandafter
+ {\the\numexpr \xint_c_iv*((#1+\xint_c_i)/\xint_c_iv)}{#1}%
}%
\def\XINT_div_prepareA_c #1#2%
{%
- \ifcase \numexpr #1-#2\relax
- \expandafter\XINT_div_prepareA_d
- \or
- \expandafter\XINT_div_prepareA_di
- \or
- \expandafter\XINT_div_prepareA_dii
- \or
- \expandafter\XINT_div_prepareA_diii
- \fi {#1}%
+ \csname XINT_div_prepareA_d\romannumeral\numexpr #1-#2\endcsname
+ {#1}%
}%
\def\XINT_div_prepareA_d {\XINT_div_prepareA_e {}}%
\def\XINT_div_prepareA_di {\XINT_div_prepareA_e {0}}%
\def\XINT_div_prepareA_dii {\XINT_div_prepareA_e {00}}%
\def\XINT_div_prepareA_diii {\XINT_div_prepareA_e {000}}%
-\def\XINT_div_prepareA_e #1#2#3%
+\def\XINT_div_prepareA_e #1#2#3#4#5%
{%
- \XINT_div_startswitch {#1#3}{#2}%
+ \XINT_div_start_a {#2}{#4}{#1#3}#5%
}%
-\def\XINT_div_startswitch #1#2#3#4%
+\def\XINT_div_start_a #1#2%
{%
- \ifnum #2 > #4
- \expandafter\XINT_div_body_a
+ \ifnum #2=\xint_c_iv \expandafter\XINT_div_little_b
\else
- \ifnum #2 = #4
- \expandafter\expandafter\expandafter\XINT_div_final_a
- \else
- \expandafter\expandafter\expandafter\XINT_div_finished_a
- \fi\fi {#1}{#4}{#3}{0000}{#2}%
+ \ifnum #1 < #2
+ \expandafter\expandafter\expandafter\XINT_div_III_aa
+ \else
+ \expandafter\expandafter\expandafter\XINT_div_start_b
+ \fi
+ \fi
+ {#1}{#2}%
}%
-\def\XINT_div_finished_a #1#2#3%
+\def\XINT_div_III_aa #1#2#3#4#5#6#7%
{%
- \expandafter\XINT_div_finished_b\expandafter {\romannumeral0\XINT_cuz {#1}}%
+ \expandafter\expandafter\expandafter
+ \XINT_div_III_b\xint_cleanupzeros_nostop #3.{0000}%
}%
-\def\XINT_div_finished_b #1#2#3#4#5%
+\def\XINT_div_III_b #1%
{%
- \if0\XINT_Sgn #1\Z
- \xint_afterfi {\XINT_div_finished_c {0}}%
+ \if0#1%
+ \expandafter\XINT_div_III_bRzero
\else
- \xint_afterfi {\expandafter\XINT_div_finished_c\expandafter
- {\romannumeral0\XINT_dsh_checksignx #5\Z {#1}}%
- }%
+ \expandafter\XINT_div_III_bRpos
\fi
- {#2}%
+ #1%
}%
-\edef\XINT_div_finished_c #1#2%
+\def\XINT_div_III_bRzero 0.#1#2%
{%
- \noexpand\expandafter\space\noexpand\expandafter
- {\noexpand\romannumeral0\noexpand\XINT_rev_andcuz {#2}}{#1}%
+ \expandafter\space\expandafter
+ {\romannumeral0\XINT_cuz_loop #1\W\W\W\W\W\W\W\Z}{0}%
+}%
+\def\XINT_div_III_bRpos #1.#2#3%
+{%
+ \expandafter\XINT_div_III_c \XINT_div_cleanR #1#3.{#2}%
+}%
+\def\XINT_div_III_c #1#2%
+{%
+ \expandafter\space\expandafter
+ {\romannumeral0\XINT_cuz_loop #2\W\W\W\W\W\W\W\Z}{#1}%
+}%
+\def\XINT_div_start_b #1#2#3#4#5#6%
+{%
+ \XINT_div_start_c {#2}.#3.{#6}{{#1}{#2}{{#4}{#5}}{#6}}%
+}%
+\def\XINT_div_start_c #1#2.#3#4#5#6%
+{%
+ \ifnum #1=\xint_c_iv\XINT_div_start_ca\fi
+ \expandafter\XINT_div_start_c\expandafter
+ {\the\numexpr #1-\xint_c_iv}#2#3#4#5#6.%
+}%
+\def\XINT_div_start_ca\fi\expandafter\XINT_div_start_c\expandafter
+ #1#2#3#4#5{\fi\XINT_div_start_d {#2#3#4#5}#2#3#4#5}%
+\def\XINT_div_start_d #1#2.#3.#4#5#6%
+{%
+ \XINT_div_I_a {#1}{#4}{#2}{#6}{0000}#5{#3}{#6}{}%
}%
-\def\XINT_div_final_a #1%
+\def\XINT_div_I_a #1#2%
{%
- \XINT_div_final_b #1\Z
+ \expandafter\XINT_div_I_b\the\numexpr #1/#2.{#1}{#2}%
}%
-\def\XINT_div_final_b #1#2#3#4#5\Z
+\def\XINT_div_I_b #1%
{%
- \xint_gob_til_zeros_iv #1#2#3#4\xint_div_final_c0000%
- \XINT_div_final_c {#1#2#3#4}{#1#2#3#4#5}%
+ \xint_gob_til_zero #1\XINT_div_I_czero 0\XINT_div_I_c #1%
}%
-\def\xint_div_final_c0000\XINT_div_final_c #1{\XINT_div_finished_a }%
-\def\XINT_div_final_c #1#2#3#4%
+\def\XINT_div_I_czero 0%
+ \XINT_div_I_c 0.#1#2#3#4#5{\XINT_div_I_g {#5}{#3}}%
+\def\XINT_div_I_c #1.#2#3%
{%
- \expandafter \XINT_div_final_da \expandafter
- {\the\numexpr #1-(#1/#4)*#4\expandafter }\expandafter
- {\the\numexpr #1/#4\expandafter }\expandafter
- {\romannumeral0\xint_cleanupzeros_andstop #2}%
+ \expandafter\XINT_div_I_da\the\numexpr #2-#1*#3.#1.%
}%
-\def\XINT_div_final_da #1%
+\def\XINT_div_I_da #1.%
{%
\ifnum #1>\xint_c_ix
- \expandafter\XINT_div_final_dP
+ \expandafter\XINT_div_I_dP
\else
- \xint_afterfi
- {\ifnum #1<\xint_c_
- \expandafter\XINT_div_final_dN
- \else
- \expandafter\XINT_div_final_db
- \fi }%
+ \ifnum #1<\xint_c_
+ \expandafter\expandafter\expandafter\XINT_div_I_dN
+ \else
+ \expandafter\expandafter\expandafter\XINT_div_I_db
+ \fi
\fi
}%
-\def\XINT_div_final_dN #1%
+\def\XINT_div_I_dN #1.%
{%
- \expandafter\XINT_div_final_dP\the\numexpr #1-\xint_c_i\relax
+ \expandafter\XINT_div_I_dP\the\numexpr #1-\xint_c_i.%
}%
-\def\XINT_div_final_dP #1#2#3#4#5% q,A,Q,L,B (puis c)
+\def\XINT_div_I_db #1.#2#3% #1=q=un chiffre, #2=alpha, #3=B
{%
- \expandafter \XINT_div_final_f \expandafter
- {\romannumeral0\xintiisub {#2}%
- {\romannumeral0\XINT_mul_M {#1}#5\Z\Z\Z\Z }}%
- {\romannumeral0\XINT_add_A 0{}#1000\W\X\Y\Z #3\W\X\Y\Z }%
+ \expandafter\XINT_div_I_dc\expandafter
+ {\romannumeral0\expandafter\XINT_div_sub_xpxp\expandafter
+ {\romannumeral0\xintreverseorder{#2}}%
+ {\romannumeral0\XINT_mul_Mr {#1}#3\Z\Z\Z\Z }}%
+ #1{#2}{#3}%
}%
-\def\XINT_div_final_db #1#2#3#4#5% q,A,Q,L,B (puis c)
+\def\XINT_div_I_dc #1#2%
{%
- \expandafter\XINT_div_final_dc\expandafter
- {\romannumeral0\xintiisub {#2}%
- {\romannumeral0\XINT_mul_M {#1}#5\Z\Z\Z\Z }}%
- {#1}{#2}{#3}{#4}{#5}%
+ \if-#1% s'arranger pour que si n^^e9gatif on ait renvoy^^e9 alpha=-.
+ \expandafter\xint_firstoftwo
+ \else\expandafter\xint_secondoftwo\fi
+ {\expandafter\XINT_div_I_dP\the\numexpr #2-\xint_c_i.}%
+ {\XINT_div_I_e {#1}#2}%
}%
-\def\XINT_div_final_dc #1#2% 1.09i re-styles the conditional here
+\def\XINT_div_I_e #1#2#3#4#5%
{%
- \ifnum\XINT__Sgn #1\Z<\xint_c_
- \expandafter\xint_firstoftwo
- \else\expandafter\xint_secondoftwo
- \fi
- {\expandafter\XINT_div_final_dP\the\numexpr #2-\xint_c_i\relax}%
- {\XINT_div_final_e {#1}#2}%
+ \expandafter\XINT_div_I_f \the\numexpr \xint_c_x^iv+#2+#5{#1}%
}%
-\def\XINT_div_final_e #1#2#3#4#5#6% A final, q, trash, Q, L, B
+\def\XINT_div_I_dP #1.#2#3#4%
{%
- \XINT_div_final_f {#1}%
- {\romannumeral0\XINT_add_A 0{}#2000\W\X\Y\Z #4\W\X\Y\Z }%
+ \expandafter \XINT_div_I_f \the\numexpr \xint_c_x^iv+#1+#4\expandafter
+ {\romannumeral0\expandafter\XINT_div_sub_xpxp\expandafter
+ {\romannumeral0\xintreverseorder{#2}}%
+ {\romannumeral0\XINT_mul_Mr {#1}#3\Z\Z\Z\Z }}%
}%
-\def\XINT_div_final_f #1#2#3% R,Q \`a d\'evelopper,c. re-styled in 1.09i
+\def\XINT_div_I_f 1#1#2#3#4{\XINT_div_I_g {#1#2#3#4}}%
+\def\XINT_div_I_g #1#2#3#4#5#6#7#8#9%
{%
- \if0\XINT_Sgn #1\Z
- \expandafter\xint_firstoftwo
- \else\expandafter\xint_secondoftwo
- \fi
- {\XINT_div_final_end {0}}%
- {\expandafter\XINT_div_final_end\expandafter
- {\romannumeral0\XINT_dsh_checksignx #3\Z {#1}}%
- }%
- {#2}%
+ \ifnum#3=#4
+ \expandafter\XINT_div_III_ab
+ \else
+ \expandafter\XINT_div_I_h
+ \fi
+ {#5}#2.#7.{{#5}{#6}{#4}{#3}}{#8}{#9#1}%
}%
-\edef\XINT_div_final_end #1#2%
+\def\XINT_div_III_ab #1#2.#3.#4#5%
{%
- \noexpand\expandafter\space\noexpand\expandafter {#2}{#1}%
+ \expandafter\XINT_div_III_b
+ \romannumeral0\XINT_cuz_loop #2#3\W\W\W\W\W\W\W\Z.%
}%
-\def\XINT_div_body_a #1%
+\def\XINT_div_I_h #1.#2#3#4#5#6.#7#8%
{%
- \XINT_div_body_b #1\Z {#1}%
+ \XINT_div_II_b #1#2#3#4#5.{#8}{#7}{#6}{#8}%
}%
-\def\XINT_div_body_b #1#2#3#4#5#6#7#8#9\Z
+\def\XINT_div_II_b #1#2#3#4#5#6#7#8#9%
{%
- \XINT_div_body_c {#1#2#3#4#5#6#7#8}%
+ \xint_gob_til_zeros_iv #2#3#4#5\XINT_div_II_skipc 0000%
+ \XINT_div_II_c #1{#2#3#4#5}{#6#7#8#9}%
}%
-\def\XINT_div_body_c #1#2#3%
+\def\XINT_div_II_skipc 0000\XINT_div_II_c #1#2#3#4#5.#6#7%
{%
- \XINT_div_body_d {#3}{}#2\Z {#1}{#3}%
+ \XINT_div_II_k #7{#4#5}{#6}{0000}%
}%
-\def\XINT_div_body_d #1#2#3#4#5#6%
+\def\XINT_div_II_c #1#2#3#4%
{%
- \ifnum #1 >\xint_c_
- \expandafter\XINT_div_body_d
- \expandafter{\the\numexpr #1-\xint_c_iv\expandafter }%
- \else
- \expandafter\XINT_div_body_e
- \fi
- {#6#5#4#3#2}%
+ \expandafter\XINT_div_II_d\the\numexpr (#3#4+#2)/#1+\xint_c_ixixixix\relax
+ {#1}{#2}#3#4%
}%
-\def\XINT_div_body_e #1#2\Z #3%
+\def\XINT_div_II_d 1#1#2#3#4#5#6#7.#8%
{%
- \XINT_div_body_f {#3}{#1}{#2}%
+ \expandafter\XINT_div_II_e
+ \romannumeral0\expandafter\XINT_div_sub_xpxp\expandafter
+ {\romannumeral0\xintreverseorder{#7}}%
+ {\romannumeral0\XINT_mul_Mr {#1#2#3#4}#8\Z\Z\Z\Z }.%
+ {#5}{#6}{#8}{#1#2#3#4}%
}%
-\def\XINT_div_body_f #1#2#3#4#5#6#7#8%
+\def\XINT_div_II_e #1#2#3#4%
{%
- \expandafter\XINT_div_body_gg
- \the\numexpr (#1+(#5+\xint_c_i)/\xint_c_ii)/(#5+\xint_c_i)+99999\relax
- {#8}{#2}{#8}{#4}{#5}{#3}{#6}{#7}{#8}%
+ \xint_gob_til_zeros_iv #1#2#3#4\XINT_div_II_skipf 0000%
+ \XINT_div_II_f #1#2#3#4%
}%
-\def\XINT_div_body_gg #1#2#3#4#5#6%
+\def\XINT_div_II_skipf 0000\XINT_div_II_f 0000#1.#2#3#4#5#6%
{%
- \xint_UDzerofork
- #2\XINT_div_body_gk
- 0{\XINT_div_body_ggk #2}%
- \krof
- {#3#4#5#6}%
+ \XINT_div_II_k #6{#1}{#4}{#5}%
}%
-\def\XINT_div_body_gk #1#2#3%
+\def\XINT_div_II_f #1#2#3#4#5#6#7#8#9.%
{%
- \expandafter\XINT_div_body_h
- \romannumeral0\XINT_div_sub_xpxp
- {\romannumeral0\XINT_mul_Mr {#1}#2\Z\Z\Z\Z }{#3}\Z {#1}%
+ \XINT_div_II_fa {#1#2#3#4#5#6#7#8}{#1#2#3#4#5#6#7#8#9}%
}%
-\def\XINT_div_body_ggk #1#2#3%
+\def\XINT_div_II_fa #1#2#3#4%
{%
- \expandafter \XINT_div_body_gggk \expandafter
- {\romannumeral0\XINT_mul_Mr {#1}0000#3\Z\Z\Z\Z }%
- {\romannumeral0\XINT_mul_Mr {#2}#3\Z\Z\Z\Z }%
- {#1#2}%
+ \expandafter\XINT_div_II_g\expandafter
+ {\the\numexpr (#1+#4)/#3-\xint_c_i}{#2}%
}%
-\def\XINT_div_body_gggk #1#2#3#4%
+\def\XINT_div_II_g #1#2#3#4%
{%
- \expandafter\XINT_div_body_h
- \romannumeral0\XINT_div_sub_xpxp
- {\romannumeral0\expandafter\XINT_mul_Ar
- \expandafter0\expandafter{\expandafter}#2\W\X\Y\Z #1\W\X\Y\Z }%
- {#4}\Z {#3}%
+ \expandafter \XINT_div_II_h
+ \the\numexpr #4+#1+\xint_c_x^iv\expandafter\expandafter\expandafter
+ {\expandafter\xint_gobble_iv
+ \romannumeral0\expandafter\XINT_div_sub_xpxp\expandafter
+ {\romannumeral0\xintreverseorder{#2}}%
+ {\romannumeral0\XINT_mul_Mr {#1}#3\Z\Z\Z\Z }}{#3}%
}%
-\def\XINT_div_body_h #1#2#3#4#5#6#7#8#9\Z
+\def\XINT_div_II_h 1#1#2#3#4#5#6#7%
{%
- \ifnum #1#2#3#4>\xint_c_
- \xint_afterfi{\XINT_div_body_i {#1#2#3#4#5#6#7#8}}%
- \else
- \expandafter\XINT_div_body_k
- \fi
- {#1#2#3#4#5#6#7#8#9}%
+ \XINT_div_II_k #7{#5}{#6}{#1#2#3#4}%
}%
-\def\XINT_div_body_k #1#2#3%
+\def\XINT_div_II_k #1#2#3#4#5%
{%
- \XINT_div_body_l {#1}{#2}%
+ \expandafter\XINT_div_II_l \the\numexpr #4-\xint_c_iv.{#3}#1{#2}#5.%
}%
-\def\XINT_div_body_i #1#2#3#4#5#6%
+\def\XINT_div_II_l #1.#2#3#4#5#6#7#8#9%
{%
- \expandafter\XINT_div_body_j
- \expandafter{\the\numexpr (#1+(#6+1)/2)/(#6+1)-1}%
- {#2}{#3}{#4}{#5}{#6}%
+ \XINT_div_II_m {{#1}{#2}{{#3}{#4}}{#5}}{#5}{#6#7#8#9}#6#7#8#9%
}%
-\def\XINT_div_body_j #1#2#3#4%
+\def\XINT_div_II_m #1#2#3#4.#5#6%
{%
- \expandafter \XINT_div_body_l \expandafter
- {\romannumeral0\XINT_div_sub_xpxp
- {\romannumeral0\XINT_mul_Mr {#1}#4\Z\Z\Z\Z }{\xintReverseOrder{#2}}}%
- {#3+#1}%
+ \XINT_div_I_a {#3}{#2}{#4}{#5}{#6}#1%
}%
-\def\XINT_div_body_l #1#2#3#4#5#6#7%
+\def\XINT_div_little_b #1#2#3#4#5#6#7%
{%
- \expandafter\XINT_div_body_m
- \the\numexpr \xint_c_x^viii+#2\relax {#6}{#3}{#7}{#1#5}{#4}%
+ \XINT_div_little_c #3.{{#4}{#6}}{#1}%
}%
-\def\XINT_div_body_m 1#1#2#3#4#5#6#7#8%
+\def\XINT_div_little_c #1#2#3#4#5.#6#7%
{%
- \ifnum #1#2#3#4>\xint_c_
- \xint_afterfi {\XINT_div_body_n {#8#7#6#5#4#3#2#1}}%
- \else
- \xint_afterfi {\XINT_div_body_n {#8#7#6#5}}%
- \fi
+ \XINT_div_littleI_a {#1#2#3#4}#6{#7}{#5}%
}%
-\def\XINT_div_body_n #1#2%
+\def\XINT_div_littleI_a #1#2#3%
{%
- \expandafter\XINT_div_body_o\expandafter
- {\romannumeral0\XINT_addr_A 0{}#1\W\X\Y\Z #2\W\X\Y\Z }%
+ \expandafter\XINT_div_littleI_b
+ \the\numexpr (#1+#2)/#3-\xint_c_i{#1}{#2}{#3}%
}%
-\def\XINT_div_body_o #1#2#3#4%
+\def\XINT_div_littleI_b #1%
{%
- \XINT_div_body_p {#3}{#2}{}#4\Z {#1}%
+ \xint_gob_til_zero #1\XINT_div_littleI_skip 0\XINT_div_littleI_c #1%
}%
-\def\XINT_div_body_p #1#2#3#4#5#6#7%
+\def\XINT_div_littleI_skip 0\XINT_div_littleI_c 0#1#2#3#4#5%
+ {\XINT_div_littleII_a {#4}{#1}#5.{{#2}{#3}}{0000}}%
+\def\XINT_div_littleI_c #1#2#3#4%
{%
- \ifnum #1 > #2
- \xint_afterfi
- {\ifnum #4#5#6#7 > \xint_c_
- \expandafter\XINT_div_body_q
- \else
- \expandafter\XINT_div_body_repeatp
- \fi }%
- \else
- \expandafter\XINT_div_gotofinal_a
- \fi
- {#1}{#2}{#3}#4#5#6#7%
+ \expandafter\expandafter\expandafter\XINT_div_littleI_e
+ \expandafter\expandafter\expandafter
+ {\expandafter\xint_gobble_i\the\numexpr \xint_c_x^iv+#2-#1*#4}#1{{#3}{#4}}%
+}%
+\def\XINT_div_littleI_e #1#2#3#4#5%
+ {\XINT_div_littleII_a {#4}{#1}#5.{#3}{000#2}}%
+\def\XINT_div_littleII_a #1%
+{%
+ \ifnum#1=\xint_c_iv
+ \expandafter\XINT_div_littleIII_ab
+ \else
+ \expandafter\XINT_div_littleII_b
+ \fi {#1}%
}%
-\def\XINT_div_body_repeatp #1#2#3#4#5#6#7%
+\def\XINT_div_littleIII_ab #1#2#3.#4%
{%
- \expandafter\XINT_div_body_p\expandafter{\the\numexpr #1-4}{#2}{0000#3}%
+ \expandafter\XINT_div_III_b\the\numexpr #2#3.%
}%
-\def\XINT_div_body_q #1#2#3#4\Z #5#6%
+\def\XINT_div_littleII_b #1%
{%
- \XINT_div_body_b #4\Z {#4}{#2}{#6}{#3#5}{#1}%
+ \expandafter\XINT_div_littleII_c\expandafter {\the\numexpr #1-\xint_c_iv}%
}%
-\def\XINT_div_gotofinal_a #1#2#3#4\Z %
+\def\XINT_div_littleII_c #1#2#3#4#5#6#7.#8%
{%
- \XINT_div_gotofinal_b #3\Z {#4}{#1}%
+ \XINT_div_littleII_d {#2#3#4#5#6}#8{#1}{#7}%
}%
-\def\XINT_div_gotofinal_b 0000#1\Z #2#3#4#5%
+\def\XINT_div_littleII_d #1#2#3%
{%
- \XINT_div_final_a {#2}{#3}{#5}{#1#4}{#3}%
+ \expandafter\XINT_div_littleII_e\the\numexpr (#1+#2)/#3+\xint_c_ixixixix.%
+ {#1}{#2}{#3}%
}%
-\def\XINT_div_sub_xpxp #1%
+\def\XINT_div_littleII_e 1#1.#2#3#4%
{%
- \expandafter \XINT_div_sub_xpxp_a \expandafter{#1}%
+ \expandafter\expandafter\expandafter\XINT_div_littleII_f
+ \expandafter\xint_gobble_i\the\numexpr \xint_c_x^iv+#2-#1*#4.%
+ {#1}{{#3}{#4}}%
}%
-\def\XINT_div_sub_xpxp_a #1#2%
+\def\XINT_div_littleII_f #1.#2#3#4#5#6%
{%
- \expandafter\expandafter\expandafter\XINT_div_sub_xpxp_b
- #2\W\X\Y\Z #1\W\X\Y\Z
+ \XINT_div_littleII_a {#4}{#1}#5.{#3}{#6#2}%
+}%
+\def\XINT_div_sub_xpxp #1#2% #1=alpha d^^e9j^^e0 renvers^^e9, #2 se d^^e9veloppe en qB
+{%
+ \expandafter\XINT_div_sub_xpxp_b #2\W\X\Y\Z #1\W\X\Y\Z
}%
\def\XINT_div_sub_xpxp_b
{%
@@ -2727,61 +2667,36 @@
\def\XINT_div_sub_onestep #1#2#3#4#5#6%
{%
\expandafter\XINT_div_sub_backtoA
- \the\numexpr 11#5#4#3#2-#6+#1-\xint_c_i.%
+ \the\numexpr 11#6-#5#4#3#2+#1-\xint_c_i.%
}%
\def\XINT_div_sub_backtoA #1#2#3.#4%
{%
\XINT_div_sub_A #2{#3#4}%
}%
-\def\xint_div_sub_bz\W\XINT_div_sub_onestep #1#2#3#4#5#6#7%
+\def\xint_div_sub_bz\W\XINT_div_sub_onestep #1\Z { -}%
+\def\xint_div_sub_az\W\XINT_div_sub_B #1#2{\XINT_div_sub_C #1}%
+\def\XINT_div_sub_C #1#2#3#4#5#6%
{%
- \xint_UDzerofork
- #1\XINT_div_sub_C %
- 0\XINT_div_sub_D % pas de retenue
- \krof
- {#7}#2#3#4#5%
+ \xint_gob_til_W #3\xint_div_sub_cz\W
+ \XINT_div_sub_C_onestep #1{#6#5#4#3}{#2}%
}%
-\def\XINT_div_sub_D #1#2\W\X\Y\Z
+\def\XINT_div_sub_C_onestep #1#2%
{%
- \expandafter\space
- \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_div_sub_C #1#2#3#4#5%
-{%
- \xint_gob_til_W #2\xint_div_sub_cz\W
- \XINT_div_sub_AC_onestep {#5#4#3#2}{#1}%
-}%
-\def\XINT_div_sub_AC_onestep #1%
-{%
- \expandafter\XINT_div_sub_backtoC\the\numexpr 11#1-\xint_c_i.%
+ \expandafter\XINT_div_sub_backtoC \the\numexpr 11#2+#1-\xint_c_i.%
}%
\def\XINT_div_sub_backtoC #1#2#3.#4%
{%
- \XINT_div_sub_AC_checkcarry #2{#3#4}% la retenue va \^etre examin\'ee
-}%
-\def\XINT_div_sub_AC_checkcarry #1%
-{%
- \xint_gob_til_one #1\xint_div_sub_AC_nocarry 1\XINT_div_sub_C
+ \XINT_div_sub_C #2{#3#4}%
}%
-\def\xint_div_sub_AC_nocarry 1\XINT_div_sub_C #1#2\W\X\Y\Z
+\def\xint_div_sub_cz\W\XINT_div_sub_C_onestep #1#2%
{%
- \expandafter\space
- \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%
+ \if#10% retenue
+ \expandafter\xint_div_sub_neg
+ \else\expandafter\xint_div_sub_ok
+ \fi
}%
-\def\xint_div_sub_cz\W\XINT_div_sub_AC_onestep #1#2{ #2}%
-\def\xint_div_sub_az\W\XINT_div_sub_B #1#2#3#4\Z { #3}%
+\def\xint_div_sub_neg #1{ -}%
+\def\xint_div_sub_ok #1{ #1}%
\def\xintiiFDg {\romannumeral0\xintiifdg }%
\def\xintiifdg #1%
{%
@@ -2918,7 +2833,7 @@
\def\XINT_dshr_xzeroorneg #1\Z #2{ 0}%
\def\XINT_dshr_xpositive #1\Z
{%
- \expandafter\xint_secondoftwo_afterstop\romannumeral0\xintdsx {#1}%
+ \expandafter\xint_secondoftwo_thenstop\romannumeral0\xintdsx {#1}%
}%
\def\xintDSH {\romannumeral0\xintdsh }%
\def\xintdsh #1#2%
@@ -2940,7 +2855,7 @@
\def\XINT_dsh_xiszero #1\Z #2{ #2}%
\def\XINT_dsh_xisPos #1\Z #2%
{%
- \expandafter\xint_firstoftwo_afterstop
+ \expandafter\xint_firstoftwo_thenstop
\romannumeral0\XINT_dsx_checksignA #2\Z {#1}% via DSx
}%
\def\xintDSx {\romannumeral0\xintdsx }%
@@ -2975,7 +2890,7 @@
\def\XINT_dsx_xisNeg_Azero #1\Z #2{ 0}%
\def\XINT_dsx_xisNeg_checkx #1%
{%
- \ifnum #1>999999999
+ \ifnum #1>1000000
\xint_afterfi
{\xintError:TooBigDecimalShift
\expandafter\space\expandafter 0\xint_gobble_iv }%
@@ -2983,11 +2898,12 @@
\expandafter \XINT_dsx_zeroloop
\fi
}%
+\def\XINT_dsx_addzerosnofuss #1{\XINT_dsx_zeroloop {#1}{}\Z }%
\def\XINT_dsx_zeroloop #1#2%
{%
- \ifnum #1<9 \XINT_dsx_exita\fi
+ \ifnum #1<\xint_c_ix \XINT_dsx_exita\fi
\expandafter\XINT_dsx_zeroloop\expandafter
- {\the\numexpr #1-8}{#200000000}%
+ {\the\numexpr #1-\xint_c_viii}{#200000000}%
}%
\def\XINT_dsx_exita\fi\expandafter\XINT_dsx_zeroloop
{%
@@ -3056,12 +2972,12 @@
\def\xintDecSplitR {\romannumeral0\xintdecsplitr }%
\def\xintdecsplitl
{%
- \expandafter\xint_firstoftwo_afterstop
+ \expandafter\xint_firstoftwo_thenstop
\romannumeral0\xintdecsplit
}%
\def\xintdecsplitr
{%
- \expandafter\xint_secondoftwo_afterstop
+ \expandafter\xint_secondoftwo_thenstop
\romannumeral0\xintdecsplit
}%
\def\xintDecSplit {\romannumeral0\xintdecsplit }%
@@ -3085,7 +3001,7 @@
}%
\def\XINT_split_bigx #1\Z #2%
{%
- \ifcase\XINT__Sgn #1\Z
+ \ifcase\XINT_cntSgn #1\Z
\or \xint_afterfi { {}{#2}}% positive big x
\else
\xint_afterfi { {#2}{}}% negative big x
@@ -3106,9 +3022,9 @@
}%
\def\XINT_split_fromleft_loop #1%
{%
- \ifnum #1<8 \XINT_split_fromleft_exita\fi
+ \ifnum #1<\xint_c_viii\XINT_split_fromleft_exita\fi
\expandafter\XINT_split_fromleft_loop_perhaps\expandafter
- {\the\numexpr #1-8\expandafter}\XINT_split_fromleft_eight
+ {\the\numexpr #1-\xint_c_viii\expandafter}\XINT_split_fromleft_eight
}%
\def\XINT_split_fromleft_eight #1#2#3#4#5#6#7#8#9{#9{#1#2#3#4#5#6#7#8#9}}%
\def\XINT_split_fromleft_loop_perhaps #1#2%
@@ -3124,7 +3040,7 @@
\def\XINT_split_fromleft_exita\fi
\expandafter\XINT_split_fromleft_loop_perhaps\expandafter #1#2%
{\fi \XINT_split_fromleft_exitb #1}%
-\def\XINT_split_fromleft_exitb\the\numexpr #1-8\expandafter
+\def\XINT_split_fromleft_exitb\the\numexpr #1-\xint_c_viii\expandafter
{%
\csname XINT_split_fromleft_endsplit_\romannumeral #1\endcsname
}%
@@ -3164,9 +3080,9 @@
}%
\def\XINT_split_fromright_loop #1%
{%
- \ifnum #1<8 \XINT_split_fromright_exita\fi
+ \ifnum #1<\xint_c_viii\XINT_split_fromright_exita\fi
\expandafter\XINT_split_fromright_loop_perhaps\expandafter
- {\the\numexpr #1-8\expandafter }\XINT_split_fromright_eight
+ {\the\numexpr #1-\xint_c_viii\expandafter }\XINT_split_fromright_eight
}%
\def\XINT_split_fromright_eight #1#2#3#4#5#6#7#8#9{#9{#9#8#7#6#5#4#3#2#1}}%
\def\XINT_split_fromright_loop_perhaps #1#2%
@@ -3178,7 +3094,7 @@
\def\XINT_split_fromright_exita\fi
\expandafter\XINT_split_fromright_loop_perhaps\expandafter #1#2%
{\fi \XINT_split_fromright_exitb #1}%
-\def\XINT_split_fromright_exitb\the\numexpr #1-8\expandafter
+\def\XINT_split_fromright_exitb\the\numexpr #1-\xint_c_viii\expandafter
{%
\csname XINT_split_fromright_endsplit_\romannumeral #1\endcsname
}%
@@ -3224,7 +3140,7 @@
}%
\def\XINT_dbl_zero #1\Z \W\W\W\W\W\W\W { 0}%
\def\XINT_dbl_neg
- {\expandafter\xint_minus_afterstop\romannumeral0\XINT_dbl_pos }%
+ {\expandafter\xint_minus_thenstop\romannumeral0\XINT_dbl_pos }%
\def\XINT_dbl_pos
{%
\expandafter\XINT_dbl_a \expandafter{\expandafter}\expandafter 0%
@@ -3315,7 +3231,7 @@
}%
\def\XINT_dec_zero #1\W\W\W\W\W\W\W\W { -1}%
\def\XINT_dec_neg
- {\expandafter\xint_minus_afterstop\romannumeral0\XINT_inc_pos }%
+ {\expandafter\xint_minus_thenstop\romannumeral0\XINT_inc_pos }%
\def\XINT_dec_pos
{%
\expandafter\XINT_dec_a \expandafter{\expandafter}%
@@ -3380,7 +3296,6 @@
\def\XINT_inc_A 0\XINT_inc_c #1#2#3#4#5#6#7#8#9%
{\XINT_dec_B {#1#2#3#4#5#6#7#8#9}}%
\def\XINT_inc_end\W #1\relax #2{ 1#2}%
-\def\XINT_dsx_addzerosnofuss #1{\XINT_dsx_zeroloop {#1}{}\Z }%
\def\xintiSqrt {\romannumeral0\xintisqrt }%
\def\xintisqrt
{\expandafter\XINT_sqrt_post\romannumeral0\xintisquareroot }%
@@ -3397,12 +3312,12 @@
0-{\XINT_sqrt #1}%
\krof
}%
-\def\XINT_sqrt_iszero #1\Z { 1.}% 1.09e was wrong from inception in 1.08 :-((
-\edef\XINT_sqrt_isneg #1\Z {\noexpand\xintError:RootOfNegative\space 1.}%
+\def\XINT_sqrt_iszero #1\Z { 1.}%
+\edef\XINT_sqrt_isneg #1\Z {\noexpand\xintError:RootOfNegative\space 1.}%
\def\XINT_sqrt #1\Z
{%
\expandafter\XINT_sqrt_start\expandafter
- {\romannumeral0\xintlength {#1}}{#1}%
+ {\romannumeral0\xintlength {#1}}{#1}%
}%
\def\XINT_sqrt_start #1%
{%
@@ -3442,40 +3357,19 @@
}%
\def\XINT_sqrt_c #1#2%
{%
- \expandafter #2%
- \ifcase #1
- \or 2\or 2\or 2\or 3\or 3\or 3\or 3\or 3\or %3+5
- 4\or 4\or 4\or 4\or 4\or 4\or 4\or %+7
- 5\or 5\or 5\or 5\or 5\or 5\or 5\or 5\or 5\or %+9
- 6\or 6\or 6\or 6\or 6\or 6\or 6\or 6\or 6\or 6\or 6\or %+11
- 7\or 7\or 7\or 7\or 7\or 7\or 7\or 7\or 7\or 7\or 7\or 7\or 7\or %+13
- 8\or 8\or 8\or 8\or 8\or 8\or 8\or
- 8\or 8\or 8\or 8\or 8\or 8\or 8\or 8\or %+15
- 9\or 9\or 9\or 9\or 9\or 9\or 9\or 9\or
- 9\or 9\or 9\or 9\or 9\or 9\or 9\or 9\or 9\or %+17
- 10\or 10\or 10\or 10\or 10\or 10\or 10\or 10\or 10\or
- 10\or 10\or 10\or 10\or 10\or 10\or 10\or 10\or 10\or 10\or\fi %+19
-}%
-\def\XINT_sqrt_small_d #1\or #2\fi #3%
+ \expandafter #2\expandafter
+ {\the\numexpr\ifnum #1>\xint_c_iii
+ \ifnum #1>\xint_c_viii
+ \ifnum #1>15 \ifnum #1>24 \ifnum #1>35
+ \ifnum #1>48 \ifnum #1>63 \ifnum #1>80
+ 10\else 9\fi \else 8\fi \else 7\fi \else 6\fi
+ \else 5\fi \else 4\fi \else 3\fi \else 2\fi \relax }%
+}%
+\def\XINT_sqrt_small_d #1#2%
{%
- \fi
- \expandafter\XINT_sqrt_small_de
- \ifcase \numexpr #3/\xint_c_ii-\xint_c_i\relax
- {}%
- \or
- 0%
- \or
- {00}%
- \or
- {000}%
- \or
- {0000}%
- \or
- \fi {#1}%
-}%
-\def\XINT_sqrt_small_de #1\or #2\fi #3%
-{%
- \fi\XINT_sqrt_small_e {#3#1}%
+ \expandafter\XINT_sqrt_small_e\expandafter
+ {\the\numexpr #1\ifcase \numexpr #2/\xint_c_ii-\xint_c_i\relax
+ \or 0\or 00\or 000\or 0000\fi }%
}%
\def\XINT_sqrt_small_e #1#2%
{%
@@ -3502,15 +3396,14 @@
{\the\numexpr #3-#1}%
}%
\def\XINT_sqrt_small_end #1#2#3{ {#3}{#2}}%
-\def\XINT_sqrt_big_d #1\or #2\fi #3%
+\def\XINT_sqrt_big_d #1#2%
{%
- \fi
- \ifodd #3
- \xint_afterfi{\expandafter\XINT_sqrt_big_eB}%
+ \ifodd #2
+ \expandafter\expandafter\expandafter\XINT_sqrt_big_eB
\else
- \xint_afterfi{\expandafter\XINT_sqrt_big_eA}%
+ \expandafter\expandafter\expandafter\XINT_sqrt_big_eA
\fi
- \expandafter{\the\numexpr #3/\xint_c_ii }{#1}%
+ \expandafter {\the\numexpr #2/\xint_c_ii }{#1}%
}%
\def\XINT_sqrt_big_eA #1#2#3%
{%
@@ -3556,7 +3449,7 @@
\def\XINT_sqrt_big_g #1#2%
{%
\expandafter\XINT_sqrt_big_j
- \romannumeral0\xintiidivision{#1}
+ \romannumeral0\xintiidivision{#1}%
{\romannumeral0\XINT_dbl_pos #2\R\R\R\R\R\R\R\Z \W\W\W\W\W\W\W }{#2}%
}%
\def\XINT_sqrt_big_j #1%
@@ -3578,6 +3471,70 @@
{#2}{#1}%
}%
\def\XINT_sqrt_big_end #1#2#3#4{ {#3}{#2}}%
+\def\xintIsTrue:csv #1{\expandafter\XINT_istrue:_a\romannumeral-`0#1,,^}%
+\def\XINT_istrue:_a {\XINT_istrue:_b {}}%
+\def\XINT_istrue:_b #1#2,%
+ {\expandafter\XINT_istrue:_c\romannumeral-`0#2,{#1}}%
+\def\XINT_istrue:_c #1{\if #1,\expandafter\XINT_:_f
+ \else\expandafter\XINT_istrue:_d\fi #1}%
+\def\XINT_istrue:_d #1,%
+ {\expandafter\XINT_istrue:_e\romannumeral0\xintisnotzero {#1},}%
+\def\XINT_istrue:_e #1,#2{\XINT_istrue:_b {#2,#1}}%
+\def\XINT_:_f ,#1#2^{\xint_gobble_i #1}%
+\def\xintANDof:csv #1{\expandafter\XINT_andof:_a\romannumeral-`0#1,,^}%
+\def\XINT_andof:_a {\expandafter\XINT_andof:_b\romannumeral-`0}%
+\def\XINT_andof:_b #1{\if #1,\expandafter\XINT_andof:_e
+ \else\expandafter\XINT_andof:_c\fi #1}%
+\def\XINT_andof:_c #1,{\xintifTrueAelseB {#1}{\XINT_andof:_a}{\XINT_andof:_no}}%
+\def\XINT_andof:_no #1^{0}%
+\def\XINT_andof:_e #1^{1}% works with empty list
+\def\xintORof:csv #1{\expandafter\XINT_orof:_a\romannumeral-`0#1,,^}%
+\def\XINT_orof:_a {\expandafter\XINT_orof:_b\romannumeral-`0}%
+\def\XINT_orof:_b #1{\if #1,\expandafter\XINT_orof:_e
+ \else\expandafter\XINT_orof:_c\fi #1}%
+\def\XINT_orof:_c #1,{\xintifTrueAelseB{#1}{\XINT_orof:_yes}{\XINT_orof:_a}}%
+\def\XINT_orof:_yes #1^{1}%
+\def\XINT_orof:_e #1^{0}% works with empty list
+\def\xintXORof:csv #1{\expandafter\XINT_xorof:_a\expandafter
+ 0\romannumeral-`0#1,,^}%
+\def\XINT_xorof:_a #1#2,{\expandafter\XINT_xorof:_b\romannumeral-`0#2,#1}%
+\def\XINT_xorof:_b #1{\if #1,\expandafter\XINT_:_e
+ \else\expandafter\XINT_xorof:_c\fi #1}%
+\def\XINT_xorof:_c #1,#2%
+ {\xintifTrueAelseB {#1}{\if #20\xint_afterfi{\XINT_xorof:_a 1}%
+ \else\xint_afterfi{\XINT_xorof:_a 0}\fi}%
+ {\XINT_xorof:_a #2}%
+ }%
+\def\XINT_:_e ,#1#2^{#1}% allows empty list
+\def\xintiMaxof:csv #1{\expandafter\XINT_imaxof:_b\romannumeral-`0#1,,}%
+\def\XINT_imaxof:_b #1,#2,{\expandafter\XINT_imaxof:_c\romannumeral-`0#2,{#1},}%
+\def\XINT_imaxof:_c #1{\if #1,\expandafter\XINT_of:_e
+ \else\expandafter\XINT_imaxof:_d\fi #1}%
+\def\XINT_imaxof:_d #1,{\expandafter\XINT_imaxof:_b\romannumeral0\xintimax {#1}}%
+\def\XINT_of:_e ,#1,{#1}%
+\let\xintMaxof:csv\xintiMaxof:csv
+\def\xintiMinof:csv #1{\expandafter\XINT_iminof:_b\romannumeral-`0#1,,}%
+\def\XINT_iminof:_b #1,#2,{\expandafter\XINT_iminof:_c\romannumeral-`0#2,{#1},}%
+\def\XINT_iminof:_c #1{\if #1,\expandafter\XINT_of:_e
+ \else\expandafter\XINT_iminof:_d\fi #1}%
+\def\XINT_iminof:_d #1,{\expandafter\XINT_iminof:_b\romannumeral0\xintimin {#1}}%
+\let\xintMinof:csv\xintiMinof:csv
+\def\xintiiSum:csv #1{\expandafter\XINT_iisum:_a\romannumeral-`0#1,,^}%
+\def\XINT_iisum:_a {\XINT_iisum:_b {0}}%
+\def\XINT_iisum:_b #1#2,{\expandafter\XINT_iisum:_c\romannumeral-`0#2,{#1}}%
+\def\XINT_iisum:_c #1{\if #1,\expandafter\XINT_:_e
+ \else\expandafter\XINT_iisum:_d\fi #1}%
+\def\XINT_iisum:_d #1,#2{\expandafter\XINT_iisum:_b\expandafter
+ {\romannumeral0\xintiiadd {#2}{#1}}}%
+\let\xintSum:csv\xintiiSum:csv
+\def\xintiiPrd:csv #1{\expandafter\XINT_iiprd:_a\romannumeral-`0#1,,^}%
+\def\XINT_iiprd:_a {\XINT_iiprd:_b {1}}%
+\def\XINT_iiprd:_b #1#2,{\expandafter\XINT_iiprd:_c\romannumeral-`0#2,{#1}}%
+\def\XINT_iiprd:_c #1{\if #1,\expandafter\XINT_:_e
+ \else\expandafter\XINT_iiprd:_d\fi #1}%
+\def\XINT_iiprd:_d #1,#2{\expandafter\XINT_iiprd:_b\expandafter
+ {\romannumeral0\xintiimul {#2}{#1}}}%
+\let\xintPrd:csv\xintiiPrd:csv
\XINT_restorecatcodes_endinput%
\endinput
%%
diff --git a/Master/texmf-dist/tex/generic/xint/xintbinhex.sty b/Master/texmf-dist/tex/generic/xint/xintbinhex.sty
index d1b8229163d..eff3a8281d1 100644
--- a/Master/texmf-dist/tex/generic/xint/xintbinhex.sty
+++ b/Master/texmf-dist/tex/generic/xint/xintbinhex.sty
@@ -21,9 +21,9 @@
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%%----------------------------------------------------------------
-%% The xint bundle (version 1.09i of December 18, 2013)
+%% The xint bundle (version 1.09j of January 9, 2014)
%% xintbinhex: Expandable binary and hexadecimal conversions
-%% Copyright (C) 2013 by Jean-Francois Burnol
+%% Copyright (C) 2013-2014 by Jean-Francois Burnol
%%----------------------------------------------------------------
\begingroup\catcode61\catcode48\catcode32=10\relax%
\catcode13=5 % ^^M
@@ -53,8 +53,7 @@
\else
\ifx\x\relax % plain-TeX, first loading of xintbinhex.sty
\ifx\w\relax % but xint.sty not yet loaded.
- \y{xintbinhex}{Package xint is required}%
- \y{xintbinhex}{Will try \string\input\space xint.sty}%
+ \y{xintbinhex}{now issuing \string\input\space xint.sty}%
\def\z{\endgroup\input xint.sty\relax}%
\fi
\else
@@ -62,8 +61,7 @@
\ifx\x\empty % LaTeX, first loading,
% variable is initialized, but \ProvidesPackage not yet seen
\ifx\w\relax % xint.sty not yet loaded.
- \y{xintbinhex}{Package xint is required}%
- \y{xintbinhex}{Will try \string\RequirePackage{xint}}%
+ \y{xintbinhex}{now issuing \string\RequirePackage{xint}}%
\def\z{\endgroup\RequirePackage{xint}}%
\fi
\else
@@ -103,10 +101,8 @@
\XINTsetupcatcodes%
\XINT_providespackage
\ProvidesPackage{xintbinhex}%
- [2013/12/18 v1.09i Expandable binary and hexadecimal conversions (jfB)]%
+ [2014/01/09 v1.09j Expandable binary and hexadecimal conversions (jfB)]%
\chardef\xint_c_xvi 16
-\chardef\xint_c_ii^v 32
-\chardef\xint_c_ii^vi 64
\chardef\xint_c_ii^vii 128
\mathchardef\xint_c_ii^viii 256
\mathchardef\xint_c_ii^xii 4096
@@ -217,7 +213,7 @@
-{\XINT_dth_P #1}%
\krof
}%
-\def\XINT_dth_N {\expandafter\xint_minus_afterstop\romannumeral0\XINT_dth_P }%
+\def\XINT_dth_N {\expandafter\xint_minus_thenstop\romannumeral0\XINT_dth_P }%
\def\XINT_dth_P {\expandafter\XINT_dth_III\romannumeral-`0\XINT_dtbh_I {0.}}%
\def\xintDecToBin {\romannumeral0\xintdectobin }%
\def\xintdectobin #1%
@@ -229,7 +225,7 @@
-{\XINT_dtb_P #1}%
\krof
}%
-\def\XINT_dtb_N {\expandafter\xint_minus_afterstop\romannumeral0\XINT_dtb_P }%
+\def\XINT_dtb_N {\expandafter\xint_minus_thenstop\romannumeral0\XINT_dtb_P }%
\def\XINT_dtb_P {\expandafter\XINT_dtb_III\romannumeral-`0\XINT_dtbh_I {0.}}%
\def\XINT_dtbh_I #1#2#3#4#5%
{%
@@ -365,7 +361,7 @@
-{\XINT_htd_I {0000}#1}%
\krof
}%
-\def\XINT_htd_neg {\expandafter\xint_minus_afterstop
+\def\XINT_htd_neg {\expandafter\xint_minus_thenstop
\romannumeral0\XINT_htd_I {0000}}%
\def\XINT_htd_I #1#2#3#4#5%
{%
@@ -449,7 +445,7 @@
-{\XINT_btd_I {000000}#1}%
\krof
}%
-\def\XINT_btd_neg {\expandafter\xint_minus_afterstop
+\def\XINT_btd_neg {\expandafter\xint_minus_thenstop
\romannumeral0\XINT_btd_I {000000}}%
\def\XINT_btd_I #1#2#3#4#5#6#7#8#9%
{%
@@ -561,7 +557,7 @@
-{\XINT_bth_P #1}%
\krof
}%
-\def\XINT_bth_N {\expandafter\xint_minus_afterstop\romannumeral0\XINT_bth_P }%
+\def\XINT_bth_N {\expandafter\xint_minus_thenstop\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%
@@ -595,7 +591,7 @@
-{\XINT_htb_P #1}%
\krof
}%
-\def\XINT_htb_N {\expandafter\xint_minus_afterstop\romannumeral0\XINT_htb_P }%
+\def\XINT_htb_N {\expandafter\xint_minus_thenstop\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%
{%
@@ -636,7 +632,7 @@
-{\XINT_chtb_P #1}%
\krof
}%
-\def\XINT_chtb_N {\expandafter\xint_minus_afterstop\romannumeral0\XINT_chtb_P }%
+\def\XINT_chtb_N {\expandafter\xint_minus_thenstop\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 776210f4ea8..9b05709ba26 100644
--- a/Master/texmf-dist/tex/generic/xint/xintcfrac.sty
+++ b/Master/texmf-dist/tex/generic/xint/xintcfrac.sty
@@ -21,9 +21,9 @@
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%%----------------------------------------------------------------
-%% The xint bundle (version 1.09i of December 18, 2013)
+%% The xint bundle (version 1.09j of January 9, 2014)
%% xintcfrac: Expandable continued fractions with xint package
-%% Copyright (C) 2013 by Jean-Francois Burnol
+%% Copyright (C) 2013-2014 by Jean-Francois Burnol
%%----------------------------------------------------------------
\begingroup\catcode61\catcode48\catcode32=10\relax%
\catcode13=5 % ^^M
@@ -53,8 +53,7 @@
\else
\ifx\x\relax % plain-TeX, first loading of xintcfrac.sty
\ifx\w\relax % but xintfrac.sty not yet loaded.
- \y{xintcfrac}{Package xintfrac is required}%
- \y{xintcfrac}{Will try \string\input\space xintfrac.sty}%
+ \y{xintcfrac}{now issuing \string\input\space xintfrac.sty}%
\def\z{\endgroup\input xintfrac.sty\relax}%
\fi
\else
@@ -62,8 +61,7 @@
\ifx\x\empty % LaTeX, first loading,
% variable is initialized, but \ProvidesPackage not yet seen
\ifx\w\relax % xintfrac.sty not yet loaded.
- \y{xintcfrac}{Package xintfrac is required}%
- \y{xintcfrac}{Will try \string\RequirePackage{xintfrac}}%
+ \y{xintcfrac}{now issuing \string\RequirePackage{xintfrac}}%
\def\z{\endgroup\RequirePackage{xintfrac}}%
\fi
\else
@@ -103,7 +101,7 @@
\XINTsetupcatcodes%
\XINT_providespackage
\ProvidesPackage{xintcfrac}%
- [2013/12/18 v1.09i Expandable continued fractions with xint package (jfB)]%
+ [2014/01/09 v1.09j Expandable continued fractions with xint package (jfB)]%
\def\xintCFrac {\romannumeral0\xintcfrac }%
\def\xintcfrac #1%
{%
diff --git a/Master/texmf-dist/tex/generic/xint/xintexpr.sty b/Master/texmf-dist/tex/generic/xint/xintexpr.sty
index 0565e1d0212..239625f466c 100644
--- a/Master/texmf-dist/tex/generic/xint/xintexpr.sty
+++ b/Master/texmf-dist/tex/generic/xint/xintexpr.sty
@@ -21,9 +21,9 @@
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%%----------------------------------------------------------------
-%% The xint bundle (version 1.09i of December 18, 2013)
+%% The xint bundle (version 1.09j of January 9, 2014)
%% xintexpr: Expandable expression parser
-%% Copyright (C) 2013 by Jean-Francois Burnol
+%% Copyright (C) 2013-2014 by Jean-Francois Burnol
%%----------------------------------------------------------------
\begingroup\catcode61\catcode48\catcode32=10\relax%
\catcode13=5 % ^^M
@@ -53,8 +53,7 @@
\else
\ifx\x\relax % plain-TeX, first loading of xintexpr.sty
\ifx\w\relax % but xintfrac.sty not yet loaded.
- \y{xintexpr}{Package xintfrac is required}%
- \y{xintexpr}{Will try \string\input\space xintfrac.sty}%
+ \y{xintexpr}{now issuing \string\input\space xintfrac.sty}%
\def\z{\endgroup\input xintfrac.sty\relax}%
\fi
\else
@@ -62,8 +61,7 @@
\ifx\x\empty % LaTeX, first loading,
% variable is initialized, but \ProvidesPackage not yet seen
\ifx\w\relax % xintfrac.sty not yet loaded.
- \y{xintexpr}{Package xintfrac is required}%
- \y{xintexpr}{Will try \string\RequirePackage{xintfrac}}%
+ \y{xintexpr}{now issuing \string\RequirePackage{xintfrac}}%
\def\z{\endgroup\RequirePackage{xintfrac}}%
\fi
\else
@@ -103,8 +101,8 @@
\XINTsetupcatcodes%
\XINT_providespackage
\ProvidesPackage{xintexpr}%
- [2013/12/18 v1.09i Expandable expression parser (jfB)]%
-\def\xint_gob_til_! #1!{}% nota bene: ! is of catcode 11
+ [2014/01/09 v1.09j Expandable expression parser (jfB)]%
+\def\xint_gob_til_! #1!{}% nota bene: this ! has catcode 11
\edef\XINT_expr_lock #1!%
{\noexpand\expandafter\space\noexpand\csname .=#1\noexpand\endcsname }%
\def\XINT_expr_unlock {\expandafter\XINT_expr_unlock_a\string }%
@@ -112,13 +110,15 @@
\def\XINT_expr_unexpectedtoken {\xintError:ignored }%
\def\XINT_newexpr_setprefix #1>{\noexpand\romannumeral-`0}%
\def\xint_UDxintrelaxfork #1\xint_relax #2#3\krof {#2}%
-\def\XINT_expr_done {!\XINT_expr_usethe\XINT_expr_print }%
-\let\XINT_iiexpr_done \XINT_expr_done
-\def\XINT_iexpr_done {!\XINT_expr_usethe\XINT_iexpr_print }%
-\def\XINT_flexpr_done {!\XINT_expr_usethe\XINT_flexpr_print }%
-\def\XINT_boolexpr_done{!\XINT_expr_usethe\XINT_boolexpr_print }%
-\def\XINT_expr_usethe {use_xintthe!\xintError:use_xintthe! }%
-\def\xintthe #1{\romannumeral-`0\expandafter\xint_gobble_ii\romannumeral-`0#1}%
+\def\xint_protect {\noexpand\xint_protect\noexpand }% 1.09j
+\def\XINT_expr_done {!\XINT_expr_usethe\xint_protect\XINT_expr_print }%
+\let\XINT_iiexpr_done \XINT_expr_done
+\def\XINT_iexpr_done {!\XINT_expr_usethe\xint_protect\XINT_iexpr_print }%
+\def\XINT_flexpr_done {!\XINT_expr_usethe\xint_protect\XINT_flexpr_print }%
+\def\XINT_boolexpr_done {!\XINT_expr_usethe\xint_protect\XINT_boolexpr_print }%
+\protected\def\XINT_expr_usethe #1#2#3% modified in 1.09j
+ {\xintError:missing_xintthe!\show#3missing xintthe (see log)!}%
+\def\xintthe #1{\romannumeral-`0\expandafter\xint_gobble_iii\romannumeral-`0#1}%
\let\XINT_expr_print \XINT_expr_unlock
\def\XINT_iexpr_print #1{\xintRound:csv {\XINT_expr_unlock #1}}%
\def\XINT_flexpr_print #1{\xintFloat:csv {\XINT_expr_unlock #1}}%
@@ -133,19 +133,19 @@
\def\xintiieval
{\expandafter\XINT_iiexpr_until_end_a\romannumeral-`0\XINT_expr_getnext }%
\def\xinttheexpr
- {\romannumeral-`0\expandafter\xint_gobble_ii\romannumeral0\xinteval }%
+ {\romannumeral-`0\expandafter\xint_gobble_iii\romannumeral0\xinteval }%
\def\xintthefloatexpr
- {\romannumeral-`0\expandafter\xint_gobble_ii\romannumeral0\xintfloateval }%
+ {\romannumeral-`0\expandafter\xint_gobble_iii\romannumeral0\xintfloateval }%
\def\xinttheiiexpr
- {\romannumeral-`0\expandafter\xint_gobble_ii\romannumeral0\xintiieval }%
+ {\romannumeral-`0\expandafter\xint_gobble_iii\romannumeral0\xintiieval }%
\def\xintiexpr {\romannumeral0\expandafter\expandafter\expandafter
- \XINT_iexpr_done \expandafter\xint_gobble_iii\romannumeral0\xinteval }%
+ \XINT_iexpr_done \expandafter\xint_gobble_iv\romannumeral0\xinteval }%
\def\xinttheiexpr {\romannumeral-`0\expandafter\expandafter\expandafter
- \XINT_iexpr_print\expandafter\xint_gobble_iii\romannumeral0\xinteval }%
+ \XINT_iexpr_print\expandafter\xint_gobble_iv\romannumeral0\xinteval }%
\def\xintboolexpr {\romannumeral0\expandafter\expandafter\expandafter
- \XINT_boolexpr_done \expandafter\xint_gobble_iii\romannumeral0\xinteval }%
+ \XINT_boolexpr_done \expandafter\xint_gobble_iv\romannumeral0\xinteval }%
\def\xinttheboolexpr {\romannumeral-`0\expandafter\expandafter\expandafter
- \XINT_boolexpr_print\expandafter\xint_gobble_iii\romannumeral0\xinteval }%
+ \XINT_boolexpr_print\expandafter\xint_gobble_iv\romannumeral0\xinteval }%
\let\xintnumexpr \xintiexpr % deprecated
\let\xintthenumexpr\xinttheiexpr % deprecated
\def\xintifboolexpr #1%
@@ -183,7 +183,7 @@
}%
\def\XINT_expr_getnext_gotonetoken_wehope\Z #1%
{% screens out sub-expressions and \count or \dimen registers/variables
- \xint_gob_til_! #1\XINT_expr_subexpr !%
+ \xint_gob_til_! #1\XINT_expr_subexpr !% recall this ! has catcode 11
\ifcat\relax#1% \count or \numexpr etc... token or count, dimen, skip cs
\expandafter\XINT_expr_countdimenetc_fork
\else
@@ -192,7 +192,7 @@
\fi
#1%
}%
-\def\XINT_expr_subexpr !#1\fi {\expandafter\XINT_expr_getop\xint_gobble_iii }%
+\def\XINT_expr_subexpr !#1\fi !{\expandafter\XINT_expr_getop\xint_gobble_iii }%
\def\XINT_expr_countdimenetc_fork #1%
{%
\ifx\count#1\else\ifx#1\dimen\else\ifx#1\numexpr\else\ifx#1\dimexpr\else
@@ -212,10 +212,10 @@
{% The * is in truth catcode 12 #. For (hacking) use with \xintNewExpr.
\XINT_expr_sixwayfork
#1-.+*{\xint_c_xviii ({}}% back to until for oparen triggering
- (#1.+*-%
- (-#1+*{\XINT_expr_scandec_II.}%
- (-.#1*\XINT_expr_getnext%
- (-.+#1{\XINT_expr_scandec_II}%
+ (#1.+*{-}%
+ (-#1+*{\XINT_expr_scandec_II .}%
+ (-.#1*{\XINT_expr_getnext }%
+ (-.+#1{\XINT_expr_scandec_II }%
(-.+*{\XINT_expr_scan_dec_or_func #1}%
\krof
}}%
@@ -269,11 +269,12 @@
\XINT_expr_lock\romannumeral-`0\XINT_expr_scanfracpart_b
}%
\def\XINT_expr_scanintpart_a #1% Please no braced material: 123{FORBIDDEN}
-{%
+{% careful that ! has catcode letter... spaces needed after <cs>...
\ifcat #1\relax
- \expandafter !%
- \else \expandafter\expandafter\expandafter
- \XINT_expr_scanintpart_aa\expandafter\string
+ \expandafter !% stop number scan if \relax, \count, \numexpr, or
+ \else \xint_afterfi{\ifx !#1\expandafter !\else % also \xintexpr etc..
+ \expandafter\expandafter\expandafter
+ \XINT_expr_scanintpart_aa\expandafter\string\fi }%
\fi #1%
}%
\def\XINT_expr_scanintpart_aa #1%
@@ -285,7 +286,7 @@
\expandafter\expandafter\expandafter
\XINT_expr_scandec_transition
\else % gather what we got so far, leave catcode 12 #1 in stream
- \expandafter\expandafter\expandafter !% ! of catcode 11 ...
+ \expandafter\expandafter\expandafter !% ! of catcode 11, space needed
\fi
\fi
#1%
@@ -303,9 +304,10 @@
\def\XINT_expr_scanfracpart_a #1%
{%
\ifcat #1\relax
- \expandafter !%
- \else \expandafter\expandafter\expandafter
- \XINT_expr_scanfracpart_aa\expandafter\string
+ \expandafter !% stop number scan
+ \else \xint_afterfi{\ifx !#1\expandafter !\else
+ \expandafter\expandafter\expandafter
+ \XINT_expr_scanfracpart_aa\expandafter\string\fi }%
\fi #1%
}%
\def\XINT_expr_scanfracpart_aa #1%
@@ -332,10 +334,14 @@
\ifcat #2\relax\expandafter\xint_firstoftwo
\else \expandafter\xint_secondoftwo
\fi
- {\ifx #2\relax\expandafter\XINT_expr_foundend\expandafter#1%
- \else
- \xint_afterfi{\XINT_expr_foundop *#1#2}%
- \fi }%
+ {\ifx #2\relax\expandafter\xint_firstofthree
+ \else\expandafter\xint_secondofthree % tacit multiplication
+ \fi }%
+ {\ifx !#2\expandafter\xint_secondofthree % tacit multiplication
+ \else\expandafter\xint_thirdofthree
+ \fi }%
+ {\XINT_expr_foundend #1}%
+ {\XINT_expr_foundop *#1#2}%
{\XINT_expr_foundop #2#1}%
}%
\def\XINT_expr_foundend {\xint_c_ \relax }% \relax is a place holder here.
diff --git a/Master/texmf-dist/tex/generic/xint/xintfrac.sty b/Master/texmf-dist/tex/generic/xint/xintfrac.sty
index ebe00b574bc..25d24fd4bcd 100644
--- a/Master/texmf-dist/tex/generic/xint/xintfrac.sty
+++ b/Master/texmf-dist/tex/generic/xint/xintfrac.sty
@@ -21,9 +21,9 @@
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%%----------------------------------------------------------------
-%% The xint bundle (version 1.09i of December 18, 2013)
+%% The xint bundle (version 1.09j of January 9, 2014)
%% xintfrac: Expandable operations on fractions
-%% Copyright (C) 2013 by Jean-Francois Burnol
+%% Copyright (C) 2013-2014 by Jean-Francois Burnol
%%----------------------------------------------------------------
\begingroup\catcode61\catcode48\catcode32=10\relax%
\catcode13=5 % ^^M
@@ -53,8 +53,7 @@
\else
\ifx\x\relax % plain-TeX, first loading of xintfrac.sty
\ifx\w\relax % but xint.sty not yet loaded.
- \y{xintfrac}{Package xint is required}%
- \y{xintfrac}{Will try \string\input\space xint.sty}%
+ \y{xintfrac}{now issuing \string\input\space xint.sty}%
\def\z{\endgroup\input xint.sty\relax}%
\fi
\else
@@ -62,8 +61,7 @@
\ifx\x\empty % LaTeX, first loading,
% variable is initialized, but \ProvidesPackage not yet seen
\ifx\w\relax % xint.sty not yet loaded.
- \y{xintfrac}{Package xint is required}%
- \y{xintfrac}{Will try \string\RequirePackage{xint}}%
+ \y{xintfrac}{now issuing \string\RequirePackage{xint}}%
\def\z{\endgroup\RequirePackage{xint}}%
\fi
\else
@@ -103,11 +101,10 @@
\XINTsetupcatcodes%
\XINT_providespackage
\ProvidesPackage{xintfrac}%
- [2013/12/18 v1.09i Expandable operations on fractions (jfB)]%
+ [2014/01/09 v1.09j Expandable operations on fractions (jfB)]%
\chardef\xint_c_vi 6
\chardef\xint_c_vii 7
\chardef\xint_c_xviii 18
-\mathchardef\xint_c_x^iv 10000
\def\xintLen {\romannumeral0\xintlen }%
\def\xintlen #1%
{%
@@ -149,7 +146,7 @@
}%
\def\XINT_outfrac #1#2#3%
{%
- \ifcase\XINT__Sgn #3\Z
+ \ifcase\XINT_cntSgn #3\Z
\expandafter \XINT_outfrac_divisionbyzero
\or
\expandafter \XINT_outfrac_P
@@ -426,7 +423,7 @@
}%
\def\XINT_rawz #1%
{%
- \ifcase\XINT__Sgn #1\Z
+ \ifcase\XINT_cntSgn #1\Z
\expandafter\XINT_rawz_Ba
\or
\expandafter\XINT_rawz_A
@@ -452,7 +449,7 @@
}%
\def\XINT_numer #1%
{%
- \ifcase\XINT__Sgn #1\Z
+ \ifcase\XINT_cntSgn #1\Z
\expandafter\XINT_numer_B
\or
\expandafter\XINT_numer_A
@@ -470,7 +467,7 @@
}%
\def\XINT_denom #1%
{%
- \ifcase\XINT__Sgn #1\Z
+ \ifcase\XINT_cntSgn #1\Z
\expandafter\XINT_denom_B
\or
\expandafter\XINT_denom_A
@@ -495,7 +492,7 @@
\def\XINT_fracfrac_C 0\XINT_fracfrac_D #1#2#3%
{%
\if1\XINT_isOne {#3}%
- \xint_afterfi {\expandafter\xint_firstoftwo_afterstop\xint_gobble_ii }%
+ \xint_afterfi {\expandafter\xint_firstoftwo_thenstop\xint_gobble_ii }%
\fi
\space
\frac {#2}{#3}%
@@ -529,7 +526,7 @@
}%
\def\XINT_sgnfrac_N
{%
- \expandafter\xint_minus_afterstop\romannumeral0\XINT_sgnfrac_P
+ \expandafter\xint_minus_thenstop\romannumeral0\XINT_sgnfrac_P
}%
\def\xintFwOver {\romannumeral0\xintfwover }%
\def\xintfwover #1%
@@ -577,7 +574,7 @@
}%
\def\XINT_sgnfwover_N
{%
- \expandafter\xint_minus_afterstop\romannumeral0\XINT_sgnfwover_P
+ \expandafter\xint_minus_thenstop\romannumeral0\XINT_sgnfwover_P
}%
\def\xintREZ {\romannumeral0\xintrez }%
\def\xintrez
@@ -597,7 +594,7 @@
\krof
}%
\def\XINT_rez_zero #1\Z #2#3{ 0/1[0]}%
-\def\XINT_rez_neg {\expandafter\xint_minus_afterstop\romannumeral0\XINT_rez_B }%
+\def\XINT_rez_neg {\expandafter\xint_minus_thenstop\romannumeral0\XINT_rez_B }%
\def\XINT_rez_B #1\Z
{%
\expandafter\XINT_rez_C\romannumeral0\XINT_factortens {#1}%
@@ -655,8 +652,8 @@
\expandafter\xint_exchangetwo_keepbraces\expandafter
{\the\numexpr #2+#5}{#1}{#3}{#4}\XINT_float_Q
}%
-\def\XINTinFloatfE {\romannumeral0\XINT_inFloatfE }%
-\def\XINT_inFloatfE [#1]#2%
+\def\XINTinFloatfE {\romannumeral0\XINTinfloatfe }%
+\def\XINTinfloatfe [#1]#2%
{%
\expandafter\XINT_infloatfe_a\expandafter
{\the\numexpr #1\expandafter}\romannumeral0\XINT_infrac {#2}%
@@ -695,7 +692,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_afterstop}%
+\def\XINT_irr_negative #1\Z #2{\XINT_irr_D #1\Z #2\Z \xint_minus_thenstop}%
\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
{%
@@ -746,9 +743,9 @@
\def\XINT_ifint #1/#2\Z
{%
\if\XINT_isOne {#2}1%
- \expandafter\xint_firstoftwo_afterstop
+ \expandafter\xint_firstoftwo_thenstop
\else
- \expandafter\xint_secondoftwo_afterstop
+ \expandafter\xint_secondoftwo_thenstop
\fi
}%
\def\xintJrr {\romannumeral0\xintjrr }%
@@ -769,7 +766,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_afterstop }%
+\def\XINT_jrr_negative #1\Z #2{\XINT_jrr_D #1\Z #2\Z \xint_minus_thenstop }%
\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
{%
@@ -829,14 +826,14 @@
{%
\expandafter\XINT_rez_AB\romannumeral0\xintiirem{#1}{#2}\Z {0}{#2}%
}%
-\def\XINTinFloatFrac {\romannumeral0\XINT_inFloatFrac }%
-\def\XINT_inFloatFrac [#1]#2%
+\def\XINTinFloatFrac {\romannumeral0\XINTinfloatfrac }%
+\def\XINTinfloatfrac [#1]#2%
{%
\expandafter\XINT_infloatfrac_a\expandafter
{\romannumeral0\xinttfrac{#2}}{#1}%
}%
-\def\XINT_infloatfrac_a #1#2{\XINT_inFloat [#2]{#1}}%
-\def\xintTrunc {\romannumeral0\xinttrunc }%
+\def\XINT_infloatfrac_a #1#2{\XINTinFloat [#2]{#1}}%
+\def\xintTrunc {\romannumeral0\xinttrunc }%
\def\xintiTrunc {\romannumeral0\xintitrunc }%
\def\xinttrunc #1%
{%
@@ -867,10 +864,10 @@
{%
\xint_gob_til_zero #2\XINT_trunc_iszero0\XINT_trunc_B {#1}{#2#3}%
}%
-\def\XINT_trunc_iszero #1#2#3#4#5{ 0\Z 0}%
+\def\XINT_trunc_iszero0\XINT_trunc_B #1#2#3{ 0\Z 0}%
\def\XINT_trunc_B #1%
{%
- \ifcase\XINT__Sgn #1\Z
+ \ifcase\XINT_cntSgn #1\Z
\expandafter\XINT_trunc_D
\or
\expandafter\XINT_trunc_D
@@ -881,43 +878,40 @@
}%
\def\XINT_trunc_C #1#2#3%
{%
- \expandafter \XINT_trunc_E
- \romannumeral0\xint_dsh {#3}{#1}\Z #2\Z
+ \expandafter\XINT_trunc_CE\expandafter
+ {\romannumeral0\XINT_dsx_zeroloop {-#1}{}\Z {#3}}{#2}%
}%
+\def\XINT_trunc_CE #1#2{\XINT_trunc_E #2.{#1}}%
\def\XINT_trunc_D #1#2%
{%
- \expandafter \XINT_trunc_DE \expandafter
- {\romannumeral0\xint_dsh {#2}{-#1}}%
+ \expandafter\XINT_trunc_E
+ \romannumeral0\XINT_dsx_zeroloop {#1}{}\Z {#2}.%
}%
-\def\XINT_trunc_DE #1#2{\XINT_trunc_E #2\Z #1\Z }%
-\def\XINT_trunc_E #1#2\Z #3#4\Z
+\def\XINT_trunc_E #1%
{%
- \xint_UDsignsfork
- #1#3\XINT_trunc_minusminus
- #1-{\XINT_trunc_minusplus #3}%
- #3-{\XINT_trunc_plusminus #1}%
- --{\XINT_trunc_plusplus #3#1}%
+ \xint_UDsignfork
+ #1\XINT_trunc_Fneg
+ -{\XINT_trunc_Fpos #1}%
\krof
- {#4}{#2}%
}%
-\def\XINT_trunc_minusminus #1#2{\xintiiquo {#1}{#2}\Z \space}%
-\def\XINT_trunc_minusplus #1#2#3{\xintiiquo {#1#2}{#3}\Z \xint_minus_afterstop}%
-\def\XINT_trunc_plusminus #1#2#3{\xintiiquo {#2}{#1#3}\Z \xint_minus_afterstop}%
-\def\XINT_trunc_plusplus #1#2#3#4{\xintiiquo {#1#3}{#2#4}\Z \space}%
+\def\XINT_trunc_Fneg #1.#2{\expandafter\xint_firstoftwo_thenstop
+ \romannumeral0\XINT_div_prepare {#2}{#1}\Z \xint_minus_thenstop}%
+\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%
{%
- \xint_gob_til_zero #1\XINT_trunc_zero 0\xint_firstoftwo {#3#1#2}0%
+ \xint_gob_til_zero #1\XINT_trunc_zero 0#3#1#2%
}%
+\def\XINT_trunc_zero 0#1#20{ 0}%
\def\XINT_trunc_G #1\Z #2#3%
{%
\xint_gob_til_zero #2\XINT_trunc_zero 0%
\expandafter\XINT_trunc_H\expandafter
{\the\numexpr\romannumeral0\xintlength {#1}-#3}{#3}{#1}#2%
}%
-\def\XINT_trunc_zero 0#10{ 0}%
\def\XINT_trunc_H #1#2%
{%
- \ifnum #1 > 0
+ \ifnum #1 > \xint_c_
\xint_afterfi {\XINT_trunc_Ha {#2}}%
\else
\xint_afterfi {\XINT_trunc_Hb {-#1}}% -0,--1,--2, ....
@@ -934,7 +928,7 @@
\def\XINT_trunc_Hb #1#2#3%
{%
\expandafter #3\expandafter0\expandafter.%
- \romannumeral0\XINT_dsx_zeroloop {#1}{}\Z {}#2% #1=-0 possible!
+ \romannumeral0\XINT_dsx_zeroloop {#1}{}\Z {}#2% #1=-0 autoris^^e9 !
}%
\def\xintRound {\romannumeral0\xintround }%
\def\xintiRound {\romannumeral0\xintiround }%
@@ -1000,15 +994,246 @@
{%
\XINT_addm_A 0{}1000\W\X\Y\Z #1000\W\X\Y\Z \Z
}%
-\def\xintRound:csv #1{\expandafter\XINT_round:_a\romannumeral-`0#1,,^}%
-\def\XINT_round:_a {\XINT_round:_b {}}%
-\def\XINT_round:_b #1#2,%
- {\expandafter\XINT_round:_c\romannumeral-`0#2,{#1}}%
-\def\XINT_round:_c #1{\if #1,\expandafter\XINT_:_f
- \else\expandafter\XINT_round:_d\fi #1}%
-\def\XINT_round:_d #1,%
- {\expandafter\XINT_round:_e\romannumeral0\xintiround 0{#1},}%
-\def\XINT_round:_e #1,#2{\XINT_round:_b {#2,#1}}%
+\def\xintXTrunc #1#2%
+{%
+ \expandafter\XINT_xtrunc_a\expandafter
+ {\the\numexpr #1\expandafter}\romannumeral0\xintraw {#2}%
+}%
+\def\XINT_xtrunc_a #1%
+{%
+ \expandafter\XINT_xtrunc_b\expandafter
+ {\the\numexpr\ifnum#1<\xint_c_i \xint_c_i-\fi #1}%
+}%
+\def\XINT_xtrunc_b #1%
+{%
+ \expandafter\XINT_xtrunc_c\expandafter
+ {\the\numexpr (#1+\xint_c_ii^v)/\xint_c_ii^vi-\xint_c_i}{#1}%
+}%
+\def\XINT_xtrunc_c #1#2%
+{%
+ \expandafter\XINT_xtrunc_d\expandafter
+ {\the\numexpr #2-\xint_c_ii^vi*#1}{#1}{#2}%
+}%
+\def\XINT_xtrunc_d #1#2#3#4/#5[#6]%
+{%
+ \XINT_xtrunc_e #4.{#6}{#5}{#3}{#2}{#1}%
+}%
+\def\XINT_xtrunc_e #1%
+{%
+ \xint_UDzerominusfork
+ #1-\XINT_xtrunc_zero
+ 0#1\XINT_xtrunc_N
+ 0-{\XINT_xtrunc_P #1}%
+ \krof
+}%
+\def\XINT_xtrunc_zero .#1#2#3#4#5%
+{%
+ 0.\romannumeral0\expandafter\XINT_dsx_zeroloop\expandafter
+ {\the\numexpr #5}{}\Z {}%
+ \xintiloop [#4+-1]
+ \ifnum \xintiloopindex>\xint_c_
+ 0000000000000000000000000000000000000000000000000000000000000000%
+ \repeat
+}%
+\def\XINT_xtrunc_N {-\XINT_xtrunc_P }%
+\def\XINT_xtrunc_P #1.#2%
+{%
+ \ifnum #2<\xint_c_
+ \expandafter\XINT_xtrunc_negN_Q
+ \else
+ \expandafter\XINT_xtrunc_Q
+ \fi {#2}{#1}.%
+}%
+\def\XINT_xtrunc_negN_Q #1#2.#3#4#5#6%
+{%
+ \expandafter\XINT_xtrunc_negN_R
+ \romannumeral0\XINT_div_prepare {#3}{#2}{#3}{#1}{#4}%
+}%
+\def\XINT_xtrunc_negN_R #1#2#3#4#5%
+{%
+ \expandafter\XINT_xtrunc_negN_S\expandafter
+ {\the\numexpr -#4}{#5}{#2}{#3}{#1}%
+}%
+\def\XINT_xtrunc_negN_S #1#2%
+{%
+ \expandafter\XINT_xtrunc_negN_T\expandafter
+ {\the\numexpr #2-#1}{#1}{#2}%
+}%
+\def\XINT_xtrunc_negN_T #1%
+{%
+ \ifnum \xint_c_<#1
+ \expandafter\XINT_xtrunc_negNA
+ \else
+ \expandafter\XINT_xtrunc_negNW
+ \fi {#1}%
+}%
+\def\XINT_xtrunc_unlock #10.{ }%
+\def\XINT_xtrunc_negNA #1#2#3#4#5#6%
+{%
+ \expandafter\XINT_xtrunc_negNB\expandafter
+ {\romannumeral0\expandafter\expandafter\expandafter
+ \XINT_xtrunc_unlock\expandafter\string
+ \csname\XINT_xtrunc_b {#1}#4/#5[0]\expandafter\endcsname
+ \expandafter}\expandafter
+ {\the\numexpr\xintLength{#6}-#2}{#6}%
+}%
+\def\XINT_xtrunc_negNB #1#2#3{\XINT_xtrunc_negNC {#2}{#3}#1}%
+\def\XINT_xtrunc_negNC #1%
+{%
+ \ifnum \xint_c_ < #1
+ \expandafter\XINT_xtrunc_negNDa
+ \else
+ \expandafter\XINT_xtrunc_negNE
+ \fi {#1}%
+}%
+\def\XINT_xtrunc_negNDa #1#2%
+{%
+ \expandafter\XINT_xtrunc_negNDb%
+ \romannumeral0\XINT_split_fromleft_loop {#1}{}#2\W\W\W\W\W\W\W\W\Z
+}%
+\def\XINT_xtrunc_negNDb #1#2{#1.#2}%
+\def\XINT_xtrunc_negNE #1#2%
+{%
+ 0.\romannumeral0\XINT_dsx_zeroloop {-#1}{}\Z {}#2%
+}%
+\def\XINT_xtrunc_negNW #1#2#3#4#5#6%
+{%
+ \expandafter\XINT_xtrunc_negNX\expandafter
+ {\romannumeral0\xintnum{\xintDecSplitL {-#1}{#6}}}{#3}%
+}%
+\def\XINT_xtrunc_negNX #1#2%
+{%
+ \expandafter\XINT_xtrunc_negNC\expandafter
+ {\the\numexpr\xintLength {#1}-#2}{#1}%
+}%
+\def\XINT_xtrunc_Q #1%
+{%
+ \expandafter\XINT_xtrunc_prepare_I
+ \romannumeral0\XINT_dsx_zeroloop {#1}{}\Z
+}%
+\def\XINT_xtrunc_prepare_I #1.#2#3%
+{%
+ \expandafter\XINT_xtrunc_prepareB_aa\expandafter
+ {\romannumeral0\xintlength {#2}}{#2}{#1}%
+}%
+\def\XINT_xtrunc_prepareB_aa #1%
+{%
+ \ifnum #1=\xint_c_i
+ \expandafter\XINT_xtrunc_prepareB_onedigit
+ \else
+ \expandafter\XINT_xtrunc_prepareB_PaBa
+ \fi
+ {#1}%
+}%
+\def\XINT_xtrunc_prepareB_onedigit #1#2%
+{%
+ \ifcase#2
+ \or\expandafter\XINT_xtrunc_BisOne
+ \or\expandafter\XINT_xtrunc_BisTwo
+ \else\expandafter\XINT_xtrunc_prepareB_PaBe
+ \fi {000}{0}{4}{#2}%
+}%
+\def\XINT_xtrunc_BisOne #1#2#3#4#5#6#7%
+{%
+ #5.\romannumeral0\expandafter\XINT_dsx_zeroloop\expandafter
+ {\the\numexpr #7}{}\Z {}%
+ \xintiloop [#6+-1]
+ \ifnum \xintiloopindex>\xint_c_
+ 0000000000000000000000000000000000000000000000000000000000000000%
+ \repeat
+}%
+\def\XINT_xtrunc_BisTwo #1#2#3#4#5#6#7%
+{%
+ \xintHalf {#5}.\ifodd\xintiiLDg{#5} 5\else 0\fi
+ \romannumeral0\expandafter\XINT_dsx_zeroloop\expandafter
+ {\the\numexpr #7-\xint_c_i}{}\Z {}%
+ \xintiloop [#6+-1]
+ \ifnum \xintiloopindex>\xint_c_
+ 0000000000000000000000000000000000000000000000000000000000000000%
+ \repeat
+}%
+\def\XINT_xtrunc_prepareB_PaBa #1#2%
+{%
+ \expandafter\XINT_xtrunc_Pa\expandafter
+ {\romannumeral0\XINT_xtrunc_prepareB_a {#1}{#2}}%
+}%
+\def\XINT_xtrunc_prepareB_a #1%
+{%
+ \expandafter\XINT_xtrunc_prepareB_c\expandafter
+ {\the\numexpr \xint_c_iv*((#1+\xint_c_i)/\xint_c_iv)}{#1}%
+}%
+\def\XINT_xtrunc_prepareB_c #1#2%
+{%
+ \csname XINT_xtrunc_prepareB_d\romannumeral\numexpr#1-#2\endcsname
+ {#1}%
+}%
+\def\XINT_xtrunc_prepareB_d {\XINT_xtrunc_prepareB_e {}{0000}}%
+\def\XINT_xtrunc_prepareB_di {\XINT_xtrunc_prepareB_e {0}{000}}%
+\def\XINT_xtrunc_prepareB_dii {\XINT_xtrunc_prepareB_e {00}{00}}%
+\def\XINT_xtrunc_prepareB_diii {\XINT_xtrunc_prepareB_e {000}{0}}%
+\def\XINT_xtrunc_prepareB_PaBe #1#2#3#4%
+{%
+ \expandafter\XINT_xtrunc_Pa\expandafter
+ {\romannumeral0\XINT_xtrunc_prepareB_e {#1}{#2}{#3}{#4}}%
+}%
+\def\XINT_xtrunc_prepareB_e #1#2#3#4%
+{%
+ \ifnum#3=\xint_c_iv\expandafter\XINT_xtrunc_prepareLittleB_f
+ \else\expandafter\XINT_xtrunc_prepareB_f
+ \fi
+ #4#1{#3}{#2}{#1}%
+}%
+\def\XINT_xtrunc_prepareB_f #1#2#3#4#5#{%
+ \expandafter\space
+ \expandafter\XINT_div_prepareB_g
+ \the\numexpr #1#2#3#4+\xint_c_i\expandafter
+ .\the\numexpr (#1#2#3#4+\xint_c_i)/\xint_c_ii\expandafter
+ .\romannumeral0\xintreverseorder {#1#2#3#4#5}.{#1#2#3#4}%
+}%
+\def\XINT_xtrunc_prepareLittleB_f #1#{%
+ \expandafter\space\expandafter
+ \XINT_div_prepareB_g \the\numexpr #1/\xint_c_ii.{}.{}.{#1}%
+}%
+\def\XINT_xtrunc_Pa #1#2%
+{%
+ \expandafter\XINT_xtrunc_Pb\romannumeral0#1{#2}{#1}%
+}%
+\def\XINT_xtrunc_Pb #1#2#3#4{#1.\XINT_xtrunc_A {#4}{#2}{#3}}%
+\def\XINT_xtrunc_A #1%
+{%
+ \unless\ifnum #1>\xint_c_ \XINT_xtrunc_transition\fi
+ \expandafter\XINT_xtrunc_B\expandafter{\the\numexpr #1-\xint_c_i}%
+}%
+\def\XINT_xtrunc_B #1#2#3%
+{%
+ \expandafter\XINT_xtrunc_D\romannumeral0#3%
+ {#20000000000000000000000000000000000000000000000000000000000000000}%
+ {#1}{#3}%
+}%
+\def\XINT_xtrunc_D #1#2#3%
+{%
+ \romannumeral0\expandafter\XINT_dsx_zeroloop\expandafter
+ {\the\numexpr \xint_c_ii^vi-\xintLength{#1}}{}\Z {}#1%
+ \XINT_xtrunc_A {#3}{#2}%
+}%
+\def\XINT_xtrunc_transition\fi
+ \expandafter\XINT_xtrunc_B\expandafter #1#2#3#4%
+{%
+ \fi
+ \ifnum #4=\xint_c_ \XINT_xtrunc_abort\fi
+ \expandafter\XINT_xtrunc_x\expandafter
+ {\romannumeral0\XINT_dsx_zeroloop {#4}{}\Z {#2}}{#3}{#4}%
+}%
+\def\XINT_xtrunc_x #1#2%
+{%
+ \expandafter\XINT_xtrunc_y\romannumeral0#2{#1}%
+}%
+\def\XINT_xtrunc_y #1#2#3%
+{%
+ \romannumeral0\expandafter\XINT_dsx_zeroloop\expandafter
+ {\the\numexpr #3-\xintLength{#1}}{}\Z {}#1%
+}%
+\def\XINT_xtrunc_abort\fi\expandafter\XINT_xtrunc_x\expandafter #1#2#3{\fi}%
\mathchardef\XINTdigits 16
\def\xintDigits #1#2%
{\afterassignment \xint_gobble_i \mathchardef\XINTdigits=}%
@@ -1045,7 +1270,7 @@
\krof
}%
\def\XINT_float_zero #1\Z #2#3#4#5{ 0.e0}%
-\def\XINT_float_J {\expandafter\xint_minus_afterstop\romannumeral0\XINT_float_K }%
+\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
{%
\expandafter\XINT_float_L\expandafter
@@ -1186,17 +1411,8 @@
{\the\numexpr #3+#4+\xint_c_i-#2}{#1}%
}%
\def\XINT_float_Y #1#2{ #2e#1}%
-\def\xintFloat:csv #1{\expandafter\XINT_float:_a\romannumeral-`0#1,,^}%
-\def\XINT_float:_a {\XINT_float:_b {}}%
-\def\XINT_float:_b #1#2,%
- {\expandafter\XINT_float:_c\romannumeral-`0#2,{#1}}%
-\def\XINT_float:_c #1{\if #1,\expandafter\XINT_:_f
- \else\expandafter\XINT_float:_d\fi #1}%
-\def\XINT_float:_d #1,%
- {\expandafter\XINT_float:_e\romannumeral0\xintfloat {#1},}%
-\def\XINT_float:_e #1,#2{\XINT_float:_b {#2,#1}}%
-\def\XINTinFloat {\romannumeral0\XINT_inFloat }%
-\def\XINT_inFloat [#1]#2%
+\def\XINTinFloat {\romannumeral0\XINTinfloat }%
+\def\XINTinfloat [#1]#2%
{%
\expandafter\XINT_infloat_a\expandafter
{\the\numexpr #1\expandafter}%
@@ -1214,7 +1430,7 @@
0-{\XINT_float_K #1}%
\krof
}%
-\def\XINT_infloat_zero #1\Z #2#3#4#5{ 0/1[0]}%
+\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%
{%
@@ -1364,13 +1580,6 @@
\expandafter\XINT_fsum_loop_a\expandafter{\romannumeral0\xintadd {#2}{#1}}%
}%
\def\XINT_fsum_finished #1\Z #2{ #2}%
-\def\xintSum:csv #1{\expandafter\XINT_sum:_a\romannumeral-`0#1,,^}%
-\def\XINT_sum:_a {\XINT_sum:_b {0/1[0]}}%
-\def\XINT_sum:_b #1#2,{\expandafter\XINT_sum:_c\romannumeral-`0#2,{#1}}%
-\def\XINT_sum:_c #1{\if #1,\expandafter\XINT_:_e
- \else\expandafter\XINT_sum:_d\fi #1}%
-\def\XINT_sum:_d #1,#2{\expandafter\XINT_sum:_b\expandafter
- {\romannumeral0\xintadd {#2}{#1}}}%
\def\xintMul {\romannumeral0\xintmul }%
\def\xintmul #1%
{%
@@ -1458,13 +1667,6 @@
\expandafter\XINT_fprod_loop_a\expandafter{\romannumeral0\xintmul {#1}{#2}}%
}%
\def\XINT_fprod_finished #1\Z #2{ #2}%
-\def\xintPrd:csv #1{\expandafter\XINT_prd:_a\romannumeral-`0#1,,^}%
-\def\XINT_prd:_a {\XINT_prd:_b {1/1[0]}}%
-\def\XINT_prd:_b #1#2,{\expandafter\XINT_prd:_c\romannumeral-`0#2,{#1}}%
-\def\XINT_prd:_c #1{\if #1,\expandafter\XINT_:_e
- \else\expandafter\XINT_prd:_d\fi #1}%
-\def\XINT_prd:_d #1,#2{\expandafter\XINT_prd:_b\expandafter
- {\romannumeral0\xintmul {#2}{#1}}}%
\def\xintDiv {\romannumeral0\xintdiv }%
\def\xintdiv #1%
{%
@@ -1521,7 +1723,7 @@
}%
\def\XINT_fgeq_D #1#2#3%
{%
- \expandafter\XINT__SgnFork\romannumeral-`0\expandafter\XINT__Sgn
+ \expandafter\XINT_cntSgnFork\romannumeral-`0\expandafter\XINT_cntSgn
\the\numexpr #2+\xintLength{#3}-\xintLength{#1}\relax\Z
{ 0}{\XINT_fgeq_E #2\Z {#3}{#1}}{ 1}%
}%
@@ -1563,7 +1765,7 @@
#1#5{#2/#3[#4]}{#6/#7[#8]}%
}%
\def\XINT_fmax_minusminus --%
- {\expandafter\xint_minus_afterstop\romannumeral0\XINT_fmin_nonneg_b }%
+ {\expandafter\xint_minus_thenstop\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%
@@ -1587,33 +1789,6 @@
\def\XINT_maxof_d #1\Z
{\expandafter\XINT_maxof_b\romannumeral0\xintmax {#1}}%
\def\XINT_maxof_e #1\Z #2\Z { #2}%
-\def\xintMaxof:csv #1{\expandafter\XINT_maxof:_b\romannumeral-`0#1,,}%
-\def\XINT_maxof:_b #1,#2,{\expandafter\XINT_maxof:_c\romannumeral-`0#2,{#1},}%
-\def\XINT_maxof:_c #1{\if #1,\expandafter\XINT_of:_e
- \else\expandafter\XINT_maxof:_d\fi #1}%
-\def\XINT_maxof:_d #1,{\expandafter\XINT_maxof:_b\romannumeral0\xintmax {#1}}%
-\def\XINTinFloatMaxof {\romannumeral0\XINTinfloatmaxof }%
-\def\XINTinfloatmaxof #1{\expandafter\XINT_flmaxof_a\romannumeral-`0#1\relax }%
-\def\XINT_flmaxof_a #1{\expandafter\XINT_flmaxof_b
- \romannumeral0\XINT_inFloat [\XINTdigits]{#1}\Z }%
-\def\XINT_flmaxof_b #1\Z #2%
- {\expandafter\XINT_flmaxof_c\romannumeral-`0#2\Z {#1}\Z}%
-\def\XINT_flmaxof_c #1%
- {\xint_gob_til_relax #1\XINT_flmaxof_e\relax\XINT_flmaxof_d #1}%
-\def\XINT_flmaxof_d #1\Z
- {\expandafter\XINT_flmaxof_b\romannumeral0\xintmax
- {\XINTinFloat [\XINTdigits]{#1}}}%
-\def\XINT_flmaxof_e #1\Z #2\Z { #2}%
-\def\XINTinFloatMaxof:csv #1{\expandafter\XINT_flmaxof:_a\romannumeral-`0#1,,}%
-\def\XINT_flmaxof:_a #1,{\expandafter\XINT_flmaxof:_b
- \romannumeral0\XINT_inFloat [\XINTdigits]{#1},}%
-\def\XINT_flmaxof:_b #1,#2,%
- {\expandafter\XINT_flmaxof:_c\romannumeral-`0#2,{#1},}%
-\def\XINT_flmaxof:_c #1{\if #1,\expandafter\XINT_of:_e
- \else\expandafter\XINT_flmaxof:_d\fi #1}%
-\def\XINT_flmaxof:_d #1,%
- {\expandafter\XINT_flmaxof:_b\romannumeral0\xintmax
- {\XINTinFloat [\XINTdigits]{#1}}}%
\def\xintMin {\romannumeral0\xintmin }%
\def\xintmin #1%
{%
@@ -1634,7 +1809,7 @@
#1#5{#2/#3[#4]}{#6/#7[#8]}%
}%
\def\XINT_fmin_minusminus --%
- {\expandafter\xint_minus_afterstop\romannumeral0\XINT_fmax_nonneg_b }%
+ {\expandafter\xint_minus_thenstop\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%
@@ -1658,33 +1833,6 @@
\def\XINT_minof_d #1\Z
{\expandafter\XINT_minof_b\romannumeral0\xintmin {#1}}%
\def\XINT_minof_e #1\Z #2\Z { #2}%
-\def\xintMinof:csv #1{\expandafter\XINT_minof:_b\romannumeral-`0#1,,}%
-\def\XINT_minof:_b #1,#2,{\expandafter\XINT_minof:_c\romannumeral-`0#2,{#1},}%
-\def\XINT_minof:_c #1{\if #1,\expandafter\XINT_of:_e
- \else\expandafter\XINT_minof:_d\fi #1}%
-\def\XINT_minof:_d #1,{\expandafter\XINT_minof:_b\romannumeral0\xintmin {#1}}%
-\def\XINTinFloatMinof {\romannumeral0\XINTinfloatminof }%
-\def\XINTinfloatminof #1{\expandafter\XINT_flminof_a\romannumeral-`0#1\relax }%
-\def\XINT_flminof_a #1{\expandafter\XINT_flminof_b
- \romannumeral0\XINT_inFloat [\XINTdigits]{#1}\Z }%
-\def\XINT_flminof_b #1\Z #2%
- {\expandafter\XINT_flminof_c\romannumeral-`0#2\Z {#1}\Z}%
-\def\XINT_flminof_c #1%
- {\xint_gob_til_relax #1\XINT_flminof_e\relax\XINT_flminof_d #1}%
-\def\XINT_flminof_d #1\Z
- {\expandafter\XINT_flminof_b\romannumeral0\xintmin
- {\XINTinFloat [\XINTdigits]{#1}}}%
-\def\XINT_flminof_e #1\Z #2\Z { #2}%
-\def\XINTinFloatMinof:csv #1{\expandafter\XINT_flminof:_a\romannumeral-`0#1,,}%
-\def\XINT_flminof:_a #1,{\expandafter\XINT_flminof:_b
- \romannumeral0\XINT_inFloat [\XINTdigits]{#1},}%
-\def\XINT_flminof:_b #1,#2,%
- {\expandafter\XINT_flminof:_c\romannumeral-`0#2,{#1},}%
-\def\XINT_flminof:_c #1{\if #1,\expandafter\XINT_of:_e
- \else\expandafter\XINT_flminof:_d\fi #1}%
-\def\XINT_flminof:_d #1,%
- {\expandafter\XINT_flminof:_b\romannumeral0\xintmin
- {\XINTinFloat [\XINTdigits]{#1}}}%
\def\xintCmp {\romannumeral0\xintcmp }%
\def\xintcmp #1%
{%
@@ -1738,7 +1886,7 @@
}%
\def\XINT_fcmp_D #1#2#3%
{%
- \expandafter\XINT__SgnFork\romannumeral-`0\expandafter\XINT__Sgn
+ \expandafter\XINT_cntSgnFork\romannumeral-`0\expandafter\XINT_cntSgn
\the\numexpr #2+\xintLength{#3}-\xintLength{#1}\relax\Z
{ -1}{\XINT_fcmp_E #2\Z {#3}{#1}}{ 1}%
}%
@@ -1769,7 +1917,7 @@
\def\xintFloatAdd {\romannumeral0\xintfloatadd }%
\def\xintfloatadd #1{\XINT_fladd_chkopt \xintfloat #1\Z }%
\def\XINTinFloatAdd {\romannumeral0\XINTinfloatadd }%
-\def\XINTinfloatadd #1{\XINT_fladd_chkopt \XINT_inFloat #1\Z }%
+\def\XINTinfloatadd #1{\XINT_fladd_chkopt \XINTinfloat #1\Z }%
\def\XINT_fladd_chkopt #1#2%
{%
\ifx [#2\expandafter\XINT_fladd_opt
@@ -1787,11 +1935,11 @@
\def\XINT_FL_Add #1#2%
{%
\expandafter\XINT_FL_Add_a\expandafter{\the\numexpr #1\expandafter}%
- \expandafter{\romannumeral0\XINT_inFloat [#1]{#2}}%
+ \expandafter{\romannumeral0\XINTinfloat [#1]{#2}}%
}%
\def\XINT_FL_Add_a #1#2#3%
{%
- \expandafter\XINT_FL_Add_b\romannumeral0\XINT_inFloat [#1]{#3}#2{#1}%
+ \expandafter\XINT_FL_Add_b\romannumeral0\XINTinfloat [#1]{#3}#2{#1}%
}%
\def\XINT_FL_Add_b #1%
{%
@@ -1816,7 +1964,7 @@
\def\xintFloatSub {\romannumeral0\xintfloatsub }%
\def\xintfloatsub #1{\XINT_flsub_chkopt \xintfloat #1\Z }%
\def\XINTinFloatSub {\romannumeral0\XINTinfloatsub }%
-\def\XINTinfloatsub #1{\XINT_flsub_chkopt \XINT_inFloat #1\Z }%
+\def\XINTinfloatsub #1{\XINT_flsub_chkopt \XINTinfloat #1\Z }%
\def\XINT_flsub_chkopt #1#2%
{%
\ifx [#2\expandafter\XINT_flsub_opt
@@ -1834,7 +1982,7 @@
\def\xintFloatMul {\romannumeral0\xintfloatmul}%
\def\xintfloatmul #1{\XINT_flmul_chkopt \xintfloat #1\Z }%
\def\XINTinFloatMul {\romannumeral0\XINTinfloatmul }%
-\def\XINTinfloatmul #1{\XINT_flmul_chkopt \XINT_inFloat #1\Z }%
+\def\XINTinfloatmul #1{\XINT_flmul_chkopt \XINTinfloat #1\Z }%
\def\XINT_flmul_chkopt #1#2%
{%
\ifx [#2\expandafter\XINT_flmul_opt
@@ -1852,17 +2000,17 @@
\def\XINT_FL_Mul #1#2%
{%
\expandafter\XINT_FL_Mul_a\expandafter{\the\numexpr #1\expandafter}%
- \expandafter{\romannumeral0\XINT_inFloat [#1]{#2}}%
+ \expandafter{\romannumeral0\XINTinfloat [#1]{#2}}%
}%
\def\XINT_FL_Mul_a #1#2#3%
{%
- \expandafter\XINT_FL_Mul_b\romannumeral0\XINT_inFloat [#1]{#3}#2%
+ \expandafter\XINT_FL_Mul_b\romannumeral0\XINTinfloat [#1]{#3}#2%
}%
\def\XINT_FL_Mul_b #1[#2]#3[#4]{\xintE{\xintiiMul {#1}{#3}}{#2+#4}}%
\def\xintFloatDiv {\romannumeral0\xintfloatdiv}%
\def\xintfloatdiv #1{\XINT_fldiv_chkopt \xintfloat #1\Z }%
\def\XINTinFloatDiv {\romannumeral0\XINTinfloatdiv }%
-\def\XINTinfloatdiv #1{\XINT_fldiv_chkopt \XINT_inFloat #1\Z }%
+\def\XINTinfloatdiv #1{\XINT_fldiv_chkopt \XINTinfloat #1\Z }%
\def\XINT_fldiv_chkopt #1#2%
{%
\ifx [#2\expandafter\XINT_fldiv_opt
@@ -1880,17 +2028,17 @@
\def\XINT_FL_Div #1#2%
{%
\expandafter\XINT_FL_Div_a\expandafter{\the\numexpr #1\expandafter}%
- \expandafter{\romannumeral0\XINT_inFloat [#1]{#2}}%
+ \expandafter{\romannumeral0\XINTinfloat [#1]{#2}}%
}%
\def\XINT_FL_Div_a #1#2#3%
{%
- \expandafter\XINT_FL_Div_b\romannumeral0\XINT_inFloat [#1]{#3}#2%
+ \expandafter\XINT_FL_Div_b\romannumeral0\XINTinfloat [#1]{#3}#2%
}%
\def\XINT_FL_Div_b #1[#2]#3[#4]{\xintE{#3/#1}{#4-#2}}%
\def\XINTinFloatSum {\romannumeral0\XINTinfloatsum }%
\def\XINTinfloatsum #1{\expandafter\XINT_floatsum_a\romannumeral-`0#1\relax }%
\def\XINT_floatsum_a #1{\expandafter\XINT_floatsum_b
- \romannumeral0\XINT_inFloat[\XINTdigits]{#1}\Z }%
+ \romannumeral0\XINTinfloat[\XINTdigits]{#1}\Z }%
\def\XINT_floatsum_b #1\Z #2%
{\expandafter\XINT_floatsum_c\romannumeral-`0#2\Z {#1}\Z}%
\def\XINT_floatsum_c #1%
@@ -1898,18 +2046,10 @@
\def\XINT_floatsum_d #1\Z
{\expandafter\XINT_floatsum_b\romannumeral0\XINTinfloatadd {#1}}%
\def\XINT_floatsum_e #1\Z #2\Z { #2}%
-\def\XINTinFloatSum:csv #1{\expandafter\XINT_floatsum:_a\romannumeral-`0#1,,^}%
-\def\XINT_floatsum:_a {\XINT_floatsum:_b {0/1[0]}}%
-\def\XINT_floatsum:_b #1#2,%
- {\expandafter\XINT_floatsum:_c\romannumeral-`0#2,{#1}}%
-\def\XINT_floatsum:_c #1{\if #1,\expandafter\XINT_:_e
- \else\expandafter\XINT_floatsum:_d\fi #1}%
-\def\XINT_floatsum:_d #1,#2{\expandafter\XINT_floatsum:_b\expandafter
- {\romannumeral0\XINTinfloatadd {#2}{#1}}}%
\def\XINTinFloatPrd {\romannumeral0\XINTinfloatprd }%
\def\XINTinfloatprd #1{\expandafter\XINT_floatprd_a\romannumeral-`0#1\relax }%
\def\XINT_floatprd_a #1{\expandafter\XINT_floatprd_b
- \romannumeral0\XINT_inFloat[\XINTdigits]{#1}\Z }%
+ \romannumeral0\XINTinfloat[\XINTdigits]{#1}\Z }%
\def\XINT_floatprd_b #1\Z #2%
{\expandafter\XINT_floatprd_c\romannumeral-`0#2\Z {#1}\Z}%
\def\XINT_floatprd_c #1%
@@ -1917,18 +2057,10 @@
\def\XINT_floatprd_d #1\Z
{\expandafter\XINT_floatprd_b\romannumeral0\XINTinfloatmul {#1}}%
\def\XINT_floatprd_e #1\Z #2\Z { #2}%
-\def\XINTinFloatPred:csv #1{\expandafter\XINT_floatprd:_a\romannumeral-`0#1,,^}%
-\def\XINT_floatprd:_a {\XINT_floatprd:_b {1/1[0]}}%
-\def\XINT_floatprd:_b #1#2,%
- {\expandafter\XINT_floatprd:_c\romannumeral-`0#2,{#1}}%
-\def\XINT_floatprd:_c #1{\if #1,\expandafter\XINT_:_e
- \else\expandafter\XINT_floatprd:_d\fi #1}%
-\def\XINT_floatprd:_d #1,#2{\expandafter\XINT_floatprd:_b\expandafter
- {\romannumeral0\XINTinfloatmul {#2}{#1}}}%
\def\xintFloatPow {\romannumeral0\xintfloatpow}%
\def\xintfloatpow #1{\XINT_flpow_chkopt \xintfloat #1\Z }%
\def\XINTinFloatPow {\romannumeral0\XINTinfloatpow }%
-\def\XINTinfloatpow #1{\XINT_flpow_chkopt \XINT_inFloat #1\Z }%
+\def\XINTinfloatpow #1{\XINT_flpow_chkopt \XINTinfloat #1\Z }%
\def\XINT_flpow_chkopt #1#2%
{%
\ifx [#2\expandafter\XINT_flpow_opt
@@ -1967,12 +2099,12 @@
{%
\expandafter\XINT_flpow_checkB_d \expandafter
{\the\numexpr \expandafter\xintLength\expandafter
- {\the\numexpr #1*20/3}+#1+#2+1}%
+ {\the\numexpr #1*20/\xint_c_iii }+#1+#2+\xint_c_i }%
}%
\def\XINT_flpow_checkB_d #1#2#3#4%
{%
\expandafter \XINT_flpow_a
- \romannumeral0\XINT_inFloat [#1]{#4}{#1}{#2}#3%
+ \romannumeral0\XINTinfloat [#1]{#4}{#1}{#2}#3%
}%
\def\XINT_flpow_a #1%
{%
@@ -1982,82 +2114,84 @@
0-{\XINT_flpow_b 0#1}%
\krof
}%
-\def\XINT_flpow_zero [#1]#2#3#4#5%
-{%
- \if #41 \xint_afterfi {\xintError:DivisionByZero\space 1.e2147483647}%
- \else \xint_afterfi { 0.e0}\fi
-}%
\def\XINT_flpow_b #1#2[#3]#4#5%
{%
- \XINT_flpow_c {#4}{#5}{#2[#3]}{#1*\ifodd #5 1\else 0\fi}%
+ \XINT_flpow_loopI {#5}{#2[#3]}{\romannumeral0\XINTinfloatmul [#4]}%
+ {#1*\ifodd #5 1\else 0\fi}%
}%
-\def\XINT_flpow_c #1#2#3#4%
+\def\XINT_flpow_zero [#1]#2#3#4#5%
{%
- \XINT_flpow_loop {#1}{#2}{#3}{{#1}}\XINT_flpow_prd
- \xint_relax
- \xint_bye\xint_bye\xint_bye\xint_bye
- \xint_bye\xint_bye\xint_bye\xint_bye
- \xint_relax {#4}%
+ \if #41\xint_afterfi {\xintError:DivisionByZero #5{1[2147483648]}}%
+ \else \xint_afterfi {#5{0[0]}}\fi
}%
-\def\XINT_flpow_loop #1#2#3%
+\def\XINT_flpow_loopI #1%
{%
- \ifnum #2 = 1
- \expandafter\XINT_flpow_loop_end
+ \ifnum #1=\xint_c_i\XINT_flpow_ItoIII\fi
+ \ifodd #1
+ \expandafter\XINT_flpow_loopI_odd
\else
- \xint_afterfi{\expandafter\XINT_flpow_loop_a
- \expandafter{\the\numexpr 2*(#2/2)-#2\expandafter }% b mod 2
- \expandafter{\the\numexpr #2-#2/2\expandafter }% [b/2]
- \expandafter{\romannumeral0\XINTinfloatmul [#1]{#3}{#3}}}%
+ \expandafter\XINT_flpow_loopI_even
\fi
- {#1}{{#3}}%
+ {#1}%
}%
-\def\XINT_flpow_loop_a #1#2#3#4%
+\def\XINT_flpow_ItoIII\fi #1\fi #2#3#4#5%
{%
- \ifnum #1 = 1
- \expandafter\XINT_flpow_loop
- \else
- \expandafter\XINT_flpow_loop_throwaway
- \fi
- {#4}{#2}{#3}%
+ \fi\expandafter\XINT_flpow_III\the\numexpr #5\relax #3%
}%
-\def\XINT_flpow_loop_throwaway #1#2#3#4%
+\def\XINT_flpow_loopI_even #1#2#3%
{%
- \XINT_flpow_loop {#1}{#2}{#3}%
+ \expandafter\XINT_flpow_loopI\expandafter
+ {\the\numexpr #1/\xint_c_ii\expandafter}\expandafter
+ {#3{#2}{#2}}{#3}%
}%
-\def\XINT_flpow_loop_end #1{\romannumeral0\XINT_rord_main {}\relax }%
-\def\XINT_flpow_prd #1#2%
+\def\XINT_flpow_loopI_odd #1#2#3%
{%
- \XINT_flpow_prd_getnext {#2}{#1}%
+ \expandafter\XINT_flpow_loopII\expandafter
+ {\the\numexpr #1/\xint_c_ii-\xint_c_i\expandafter}\expandafter
+ {#3{#2}{#2}}{#3}{#2}%
}%
-\def\XINT_flpow_prd_getnext #1#2#3%
+\def\XINT_flpow_loopII #1%
{%
- \XINT_flpow_prd_checkiffinished #3\Z {#1}{#2}%
+ \ifnum #1 = \xint_c_i\XINT_flpow_IItoIII\fi
+ \ifodd #1
+ \expandafter\XINT_flpow_loopII_odd
+ \else
+ \expandafter\XINT_flpow_loopII_even
+ \fi
+ {#1}%
}%
-\def\XINT_flpow_prd_checkiffinished #1%
+\def\XINT_flpow_loopII_even #1#2#3%
{%
- \xint_gob_til_relax #1\XINT_flpow_prd_end\relax
- \XINT_flpow_prd_compute #1%
+ \expandafter\XINT_flpow_loopII\expandafter
+ {\the\numexpr #1/\xint_c_ii\expandafter}\expandafter
+ {#3{#2}{#2}}{#3}%
}%
-\def\XINT_flpow_prd_compute #1\Z #2#3%
+\def\XINT_flpow_loopII_odd #1#2#3#4%
{%
- \expandafter\XINT_flpow_prd_getnext\expandafter
- {\romannumeral0\XINTinfloatmul [#3]{#1}{#2}}{#3}%
+ \expandafter\XINT_flpow_loopII_odda\expandafter
+ {#3{#2}{#4}}{#1}{#2}{#3}%
}%
-\def\XINT_flpow_prd_end\relax\XINT_flpow_prd_compute
- \relax\Z #1#2#3%
+\def\XINT_flpow_loopII_odda #1#2#3#4%
{%
- \expandafter\XINT_flpow_conclude \the\numexpr #3\relax #1%
+ \expandafter\XINT_flpow_loopII\expandafter
+ {\the\numexpr #2/\xint_c_ii-\xint_c_i\expandafter}\expandafter
+ {#4{#3}{#3}}{#4}{#1}%
}%
-\def\XINT_flpow_conclude #1#2[#3]#4%
+\def\XINT_flpow_IItoIII\fi #1\fi #2#3#4#5#6%
{%
- \expandafter\XINT_flpow_conclude_really\expandafter
+ \fi\expandafter\XINT_flpow_III\the\numexpr #6\expandafter\relax
+ #4{#3}{#5}%
+}%
+\def\XINT_flpow_III #1#2[#3]#4%
+{%
+ \expandafter\XINT_flpow_IIIend\expandafter
{\the\numexpr\if #41 -\fi#3\expandafter}%
\xint_UDzerofork
#4{{#2}}%
0{{1/#2}}%
\krof #1%
}%
-\def\XINT_flpow_conclude_really #1#2#3#4%
+\def\XINT_flpow_IIIend #1#2#3#4%
{%
\xint_UDzerofork
#3{#4{#2[#1]}}%
@@ -2067,7 +2201,7 @@
\def\xintFloatPower {\romannumeral0\xintfloatpower}%
\def\xintfloatpower #1{\XINT_flpower_chkopt \xintfloat #1\Z }%
\def\XINTinFloatPower {\romannumeral0\XINTinfloatpower}%
-\def\XINTinfloatpower #1{\XINT_flpower_chkopt \XINT_inFloat #1\Z }%
+\def\XINTinfloatpower #1{\XINT_flpower_chkopt \XINTinfloat #1\Z }%
\def\XINT_flpower_chkopt #1#2%
{%
\ifx [#2\expandafter\XINT_flpower_opt
@@ -2106,68 +2240,84 @@
{%
\expandafter\XINT_flpower_checkB_d \expandafter
{\the\numexpr \expandafter\xintLength\expandafter
- {\the\numexpr #1*20/3}+#1+#2+1}%
+ {\the\numexpr #1*20/\xint_c_iii }+#1+#2+\xint_c_i }%
}%
\def\XINT_flpower_checkB_d #1#2#3#4%
{%
\expandafter \XINT_flpower_a
- \romannumeral0\XINT_inFloat [#1]{#4}{#1}{#2}#3%
+ \romannumeral0\XINTinfloat [#1]{#4}{#1}{#2}#3%
}%
\def\XINT_flpower_a #1%
{%
\xint_UDzerominusfork
- #1-\XINT_flpower_zero
+ #1-\XINT_flpow_zero
0#1{\XINT_flpower_b 1}%
0-{\XINT_flpower_b 0#1}%
\krof
}%
-\def\XINT_flpower_zero [#1]#2#3#4#5%
+\def\XINT_flpower_b #1#2[#3]#4#5%
{%
- \if #41
- \xint_afterfi {\xintError:DivisionByZero\space 1.e2147483647}%
- \else \xint_afterfi { 0.e0}\fi
+ \XINT_flpower_loopI {#5}{#2[#3]}{\romannumeral0\XINTinfloatmul [#4]}%
+ {#1*\xintiiOdd {#5}}%
}%
-\def\XINT_flpower_b #1#2[#3]#4#5%
+\def\XINT_flpower_loopI #1%
{%
- \XINT_flpower_c {#4}{#5}{#2[#3]}{#1*\xintiiOdd {#5}}%
+ \if1\XINT_isOne {#1}\XINT_flpower_ItoIII\fi
+ \if1\xintiiOdd{#1}%
+ \expandafter\expandafter\expandafter\XINT_flpower_loopI_odd
+ \else
+ \expandafter\expandafter\expandafter\XINT_flpower_loopI_even
+ \fi
+ \expandafter {\romannumeral0\xinthalf{#1}}%
}%
-\def\XINT_flpower_c #1#2#3#4%
+\def\XINT_flpower_ItoIII\fi #1\fi\expandafter #2#3#4#5%
{%
- \XINT_flpower_loop {#1}{#2}{#3}{{#1}}\XINT_flpow_prd
- \xint_relax
- \xint_bye\xint_bye\xint_bye\xint_bye
- \xint_bye\xint_bye\xint_bye\xint_bye
- \xint_relax {#4}%
+ \fi\expandafter\XINT_flpow_III \the\numexpr #5\relax #3%
}%
-\def\XINT_flpower_loop #1#2#3%
+\def\XINT_flpower_loopI_even #1#2#3%
{%
- \if0\XINT_isOne {#2}\xint_afterfi
- {\expandafter\XINT_flpower_loop_x\expandafter
- {\romannumeral0\XINTinfloatmul [#1]{#3}{#3}}%
- {\romannumeral0\xintdivision {#2}{2}}%
- }%
- \else\expandafter\XINT_flpow_loop_end
- \fi
- {#1}{{#3}}%
+ \expandafter\XINT_flpower_toI\expandafter {#3{#2}{#2}}{#1}{#3}%
+}%
+\def\XINT_flpower_loopI_odd #1#2#3%
+{%
+ \expandafter\XINT_flpower_toII\expandafter {#3{#2}{#2}}{#1}{#3}{#2}%
}%
-\def\XINT_flpower_loop_x #1#2{\expandafter\XINT_flpower_loop_a #2{#1}}%
-\def\XINT_flpower_loop_a #1#2#3#4%
+\def\XINT_flpower_toI #1#2{\XINT_flpower_loopI {#2}{#1}}%
+\def\XINT_flpower_toII #1#2{\XINT_flpower_loopII {#2}{#1}}%
+\def\XINT_flpower_loopII #1%
{%
- \ifnum #2 = 1
- \expandafter\XINT_flpower_loop
+ \if1\XINT_isOne {#1}\XINT_flpower_IItoIII\fi
+ \if1\xintiiOdd{#1}%
+ \expandafter\expandafter\expandafter\XINT_flpower_loopII_odd
\else
- \expandafter\XINT_flpower_loop_throwaway
+ \expandafter\expandafter\expandafter\XINT_flpower_loopII_even
\fi
- {#4}{#1}{#3}%
+ \expandafter {\romannumeral0\xinthalf{#1}}%
}%
-\def\XINT_flpower_loop_throwaway #1#2#3#4%
+\def\XINT_flpower_loopII_even #1#2#3%
{%
- \XINT_flpower_loop {#1}{#2}{#3}%
+ \expandafter\XINT_flpower_toII\expandafter
+ {#3{#2}{#2}}{#1}{#3}%
+}%
+\def\XINT_flpower_loopII_odd #1#2#3#4%
+{%
+ \expandafter\XINT_flpower_loopII_odda\expandafter
+ {#3{#2}{#4}}{#2}{#3}{#1}%
+}%
+\def\XINT_flpower_loopII_odda #1#2#3#4%
+{%
+ \expandafter\XINT_flpower_toII\expandafter
+ {#3{#2}{#2}}{#4}{#3}{#1}%
+}%
+\def\XINT_flpower_IItoIII\fi #1\fi\expandafter #2#3#4#5#6%
+{%
+ \fi\expandafter\XINT_flpow_III\the\numexpr #6\expandafter\relax
+ #4{#3}{#5}%
}%
\def\xintFloatSqrt {\romannumeral0\xintfloatsqrt }%
\def\xintfloatsqrt #1{\XINT_flsqrt_chkopt \xintfloat #1\Z }%
\def\XINTinFloatSqrt {\romannumeral0\XINTinfloatsqrt }%
-\def\XINTinfloatsqrt #1{\XINT_flsqrt_chkopt \XINT_inFloat #1\Z }%
+\def\XINTinfloatsqrt #1{\XINT_flsqrt_chkopt \XINTinfloat #1\Z }%
\def\XINT_flsqrt_chkopt #1#2%
{%
\ifx [#2\expandafter\XINT_flsqrt_opt
@@ -2193,7 +2343,7 @@
\def\XINT_FL_sqrt_a #1#2%
{%
\expandafter\XINT_FL_sqrt_checkifzeroorneg
- \romannumeral0\XINT_inFloat [#1]{#2}%
+ \romannumeral0\XINTinfloat [#1]{#2}%
}%
\def\XINT_FL_sqrt_checkifzeroorneg #1%
{%
@@ -2203,8 +2353,8 @@
0-{\XINT_FL_sqrt_b #1}%
\krof
}%
-\def\XINT_FL_sqrt_iszero #1[#2]{0/1[0]}%
-\def\XINT_FL_sqrt_isneg #1[#2]{\xintError:RootOfNegative 0/1[0]}%
+\def\XINT_FL_sqrt_iszero #1[#2]{0[0]}%
+\def\XINT_FL_sqrt_isneg #1[#2]{\xintError:RootOfNegative 0[0]}%
\def\XINT_FL_sqrt_b #1[#2]%
{%
\ifodd #2
@@ -2223,15 +2373,14 @@
\expandafter\XINT_sqrt_a
\expandafter{\romannumeral0\xintlength {#2}}\XINT_flsqrt_big_d {#2}{#1}%
}%
-\def\XINT_flsqrt_big_d #1\or #2\fi #3%
+\def\XINT_flsqrt_big_d #1#2%
{%
- \fi
- \ifodd #3
- \xint_afterfi{\expandafter\XINT_flsqrt_big_eB}%
+ \ifodd #2
+ \expandafter\expandafter\expandafter\XINT_flsqrt_big_eB
\else
- \xint_afterfi{\expandafter\XINT_flsqrt_big_eA}%
+ \expandafter\expandafter\expandafter\XINT_flsqrt_big_eA
\fi
- \expandafter {\the\numexpr (#3-\xint_c_i)/\xint_c_ii }{#1}%
+ \expandafter {\the\numexpr (#2-\xint_c_i)/\xint_c_ii }{#1}%
}%
\def\XINT_flsqrt_big_eA #1#2#3%
{%
@@ -2342,6 +2491,108 @@
{\xintHalf{\xintiiQuo{\XINT_dsx_addzerosnofuss {#4}{#2}}{#3}}}}%
}%
\def\XINT_flsqrt_big_end_b #1#2{#2[#1]}%
+\def\XINTinFloatMaxof {\romannumeral0\XINTinfloatmaxof }%
+\def\XINTinfloatmaxof #1{\expandafter\XINT_flmaxof_a\romannumeral-`0#1\relax }%
+\def\XINT_flmaxof_a #1{\expandafter\XINT_flmaxof_b
+ \romannumeral0\XINTinfloat [\XINTdigits]{#1}\Z }%
+\def\XINT_flmaxof_b #1\Z #2%
+ {\expandafter\XINT_flmaxof_c\romannumeral-`0#2\Z {#1}\Z}%
+\def\XINT_flmaxof_c #1%
+ {\xint_gob_til_relax #1\XINT_flmaxof_e\relax\XINT_flmaxof_d #1}%
+\def\XINT_flmaxof_d #1\Z
+ {\expandafter\XINT_flmaxof_b\romannumeral0\xintmax
+ {\XINTinFloat [\XINTdigits]{#1}}}%
+\def\XINT_flmaxof_e #1\Z #2\Z { #2}%
+\def\XINTinFloatMinof {\romannumeral0\XINTinfloatminof }%
+\def\XINTinfloatminof #1{\expandafter\XINT_flminof_a\romannumeral-`0#1\relax }%
+\def\XINT_flminof_a #1{\expandafter\XINT_flminof_b
+ \romannumeral0\XINTinfloat [\XINTdigits]{#1}\Z }%
+\def\XINT_flminof_b #1\Z #2%
+ {\expandafter\XINT_flminof_c\romannumeral-`0#2\Z {#1}\Z}%
+\def\XINT_flminof_c #1%
+ {\xint_gob_til_relax #1\XINT_flminof_e\relax\XINT_flminof_d #1}%
+\def\XINT_flminof_d #1\Z
+ {\expandafter\XINT_flminof_b\romannumeral0\xintmin
+ {\XINTinFloat [\XINTdigits]{#1}}}%
+\def\XINT_flminof_e #1\Z #2\Z { #2}%
+\def\xintRound:csv #1{\expandafter\XINT_round:_a\romannumeral-`0#1,,^}%
+\def\XINT_round:_a {\XINT_round:_b {}}%
+\def\XINT_round:_b #1#2,%
+ {\expandafter\XINT_round:_c\romannumeral-`0#2,{#1}}%
+\def\XINT_round:_c #1{\if #1,\expandafter\XINT_:_f
+ \else\expandafter\XINT_round:_d\fi #1}%
+\def\XINT_round:_d #1,%
+ {\expandafter\XINT_round:_e\romannumeral0\xintiround 0{#1},}%
+\def\XINT_round:_e #1,#2{\XINT_round:_b {#2,#1}}%
+\def\xintFloat:csv #1{\expandafter\XINT_float:_a\romannumeral-`0#1,,^}%
+\def\XINT_float:_a {\XINT_float:_b {}}%
+\def\XINT_float:_b #1#2,%
+ {\expandafter\XINT_float:_c\romannumeral-`0#2,{#1}}%
+\def\XINT_float:_c #1{\if #1,\expandafter\XINT_:_f
+ \else\expandafter\XINT_float:_d\fi #1}%
+\def\XINT_float:_d #1,%
+ {\expandafter\XINT_float:_e\romannumeral0\xintfloat {#1},}%
+\def\XINT_float:_e #1,#2{\XINT_float:_b {#2,#1}}%
+\def\xintSum:csv #1{\expandafter\XINT_sum:_a\romannumeral-`0#1,,^}%
+\def\XINT_sum:_a {\XINT_sum:_b {0/1[0]}}%
+\def\XINT_sum:_b #1#2,{\expandafter\XINT_sum:_c\romannumeral-`0#2,{#1}}%
+\def\XINT_sum:_c #1{\if #1,\expandafter\XINT_:_e
+ \else\expandafter\XINT_sum:_d\fi #1}%
+\def\XINT_sum:_d #1,#2{\expandafter\XINT_sum:_b\expandafter
+ {\romannumeral0\xintadd {#2}{#1}}}%
+\def\xintPrd:csv #1{\expandafter\XINT_prd:_a\romannumeral-`0#1,,^}%
+\def\XINT_prd:_a {\XINT_prd:_b {1/1[0]}}%
+\def\XINT_prd:_b #1#2,{\expandafter\XINT_prd:_c\romannumeral-`0#2,{#1}}%
+\def\XINT_prd:_c #1{\if #1,\expandafter\XINT_:_e
+ \else\expandafter\XINT_prd:_d\fi #1}%
+\def\XINT_prd:_d #1,#2{\expandafter\XINT_prd:_b\expandafter
+ {\romannumeral0\xintmul {#2}{#1}}}%
+\def\xintMaxof:csv #1{\expandafter\XINT_maxof:_b\romannumeral-`0#1,,}%
+\def\XINT_maxof:_b #1,#2,{\expandafter\XINT_maxof:_c\romannumeral-`0#2,{#1},}%
+\def\XINT_maxof:_c #1{\if #1,\expandafter\XINT_of:_e
+ \else\expandafter\XINT_maxof:_d\fi #1}%
+\def\XINT_maxof:_d #1,{\expandafter\XINT_maxof:_b\romannumeral0\xintmax {#1}}%
+\def\xintMinof:csv #1{\expandafter\XINT_minof:_b\romannumeral-`0#1,,}%
+\def\XINT_minof:_b #1,#2,{\expandafter\XINT_minof:_c\romannumeral-`0#2,{#1},}%
+\def\XINT_minof:_c #1{\if #1,\expandafter\XINT_of:_e
+ \else\expandafter\XINT_minof:_d\fi #1}%
+\def\XINT_minof:_d #1,{\expandafter\XINT_minof:_b\romannumeral0\xintmin {#1}}%
+\def\XINTinFloatMinof:csv #1{\expandafter\XINT_flminof:_a\romannumeral-`0#1,,}%
+\def\XINT_flminof:_a #1,{\expandafter\XINT_flminof:_b
+ \romannumeral0\XINTinfloat [\XINTdigits]{#1},}%
+\def\XINT_flminof:_b #1,#2,%
+ {\expandafter\XINT_flminof:_c\romannumeral-`0#2,{#1},}%
+\def\XINT_flminof:_c #1{\if #1,\expandafter\XINT_of:_e
+ \else\expandafter\XINT_flminof:_d\fi #1}%
+\def\XINT_flminof:_d #1,%
+ {\expandafter\XINT_flminof:_b\romannumeral0\xintmin
+ {\XINTinFloat [\XINTdigits]{#1}}}%
+\def\XINTinFloatMaxof:csv #1{\expandafter\XINT_flmaxof:_a\romannumeral-`0#1,,}%
+\def\XINT_flmaxof:_a #1,{\expandafter\XINT_flmaxof:_b
+ \romannumeral0\XINTinfloat [\XINTdigits]{#1},}%
+\def\XINT_flmaxof:_b #1,#2,%
+ {\expandafter\XINT_flmaxof:_c\romannumeral-`0#2,{#1},}%
+\def\XINT_flmaxof:_c #1{\if #1,\expandafter\XINT_of:_e
+ \else\expandafter\XINT_flmaxof:_d\fi #1}%
+\def\XINT_flmaxof:_d #1,%
+ {\expandafter\XINT_flmaxof:_b\romannumeral0\xintmax
+ {\XINTinFloat [\XINTdigits]{#1}}}%
+\def\XINTinFloatSum:csv #1{\expandafter\XINT_floatsum:_a\romannumeral-`0#1,,^}%
+\def\XINT_floatsum:_a {\XINT_floatsum:_b {0[0]}}%
+\def\XINT_floatsum:_b #1#2,%
+ {\expandafter\XINT_floatsum:_c\romannumeral-`0#2,{#1}}%
+\def\XINT_floatsum:_c #1{\if #1,\expandafter\XINT_:_e
+ \else\expandafter\XINT_floatsum:_d\fi #1}%
+\def\XINT_floatsum:_d #1,#2{\expandafter\XINT_floatsum:_b\expandafter
+ {\romannumeral0\XINTinfloatadd {#2}{#1}}}%
+\def\XINTinFloatPred:csv #1{\expandafter\XINT_floatprd:_a\romannumeral-`0#1,,^}%
+\def\XINT_floatprd:_a {\XINT_floatprd:_b {1[0]}}%
+\def\XINT_floatprd:_b #1#2,%
+ {\expandafter\XINT_floatprd:_c\romannumeral-`0#2,{#1}}%
+\def\XINT_floatprd:_c #1{\if #1,\expandafter\XINT_:_e
+ \else\expandafter\XINT_floatprd:_d\fi #1}%
+\def\XINT_floatprd:_d #1,#2{\expandafter\XINT_floatprd:_b\expandafter
+ {\romannumeral0\XINTinfloatmul {#2}{#1}}}%
\XINT_restorecatcodes_endinput%
\endinput
%%
diff --git a/Master/texmf-dist/tex/generic/xint/xintgcd.sty b/Master/texmf-dist/tex/generic/xint/xintgcd.sty
index e4db522a478..713011b67c7 100644
--- a/Master/texmf-dist/tex/generic/xint/xintgcd.sty
+++ b/Master/texmf-dist/tex/generic/xint/xintgcd.sty
@@ -21,9 +21,9 @@
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%%----------------------------------------------------------------
-%% The xint bundle (version 1.09i of December 18, 2013)
+%% The xint bundle (version 1.09j of January 9, 2014)
%% xintgcd: Euclidean algorithm with xint package
-%% Copyright (C) 2013 by Jean-Francois Burnol
+%% Copyright (C) 2013-2014 by Jean-Francois Burnol
%%----------------------------------------------------------------
\begingroup\catcode61\catcode48\catcode32=10\relax%
\catcode13=5 % ^^M
@@ -53,8 +53,7 @@
\else
\ifx\x\relax % plain-TeX, first loading of xintgcd.sty
\ifx\w\relax % but xint.sty not yet loaded.
- \y{xintgcd}{Package xint is required}%
- \y{xintgcd}{Will try \string\input\space xint.sty}%
+ \y{xintgcd}{now issuing \string\input\space xint.sty}%
\def\z{\endgroup\input xint.sty\relax}%
\fi
\else
@@ -62,8 +61,7 @@
\ifx\x\empty % LaTeX, first loading,
% variable is initialized, but \ProvidesPackage not yet seen
\ifx\w\relax % xint.sty not yet loaded.
- \y{xintgcd}{Package xint is required}%
- \y{xintgcd}{Will try \string\RequirePackage{xint}}%
+ \y{xintgcd}{now issuing \string\RequirePackage{xint}}%
\def\z{\endgroup\RequirePackage{xint}}%
\fi
\else
@@ -103,7 +101,7 @@
\XINTsetupcatcodes%
\XINT_providespackage
\ProvidesPackage{xintgcd}%
- [2013/12/18 v1.09i Euclide algorithm with xint package (jfB)]%
+ [2014/01/09 v1.09j Euclide algorithm with xint package (jfB)]%
\def\xintGCD {\romannumeral0\xintgcd }%
\def\xintgcd #1%
{%
@@ -144,11 +142,6 @@
\def\XINT_gcdof_c #1{\xint_gob_til_relax #1\XINT_gcdof_e\relax\XINT_gcdof_d #1}%
\def\XINT_gcdof_d #1\Z {\expandafter\XINT_gcdof_b\romannumeral0\xintgcd {#1}}%
\def\XINT_gcdof_e #1\Z #2\Z { #2}%
-\def\xintGCDof:csv #1{\expandafter\XINT_gcdof:_b\romannumeral-`0#1,,}%
-\def\XINT_gcdof:_b #1,#2,{\expandafter\XINT_gcdof:_c\romannumeral-`0#2,{#1},}%
-\def\XINT_gcdof:_c #1{\if #1,\expandafter\XINT_of:_e
- \else\expandafter\XINT_gcdof:_d\fi #1}%
-\def\XINT_gcdof:_d #1,{\expandafter\XINT_gcdof:_b\romannumeral0\xintgcd {#1}}%
\def\xintLCM {\romannumeral0\xintlcm}%
\def\xintlcm #1%
{%
@@ -178,11 +171,6 @@
\def\XINT_lcmof_c #1{\xint_gob_til_relax #1\XINT_lcmof_e\relax\XINT_lcmof_d #1}%
\def\XINT_lcmof_d #1\Z {\expandafter\XINT_lcmof_b\romannumeral0\xintlcm {#1}}%
\def\XINT_lcmof_e #1\Z #2\Z { #2}%
-\def\xintLCMof:csv #1{\expandafter\XINT_lcmof:_a\romannumeral-`0#1,,}%
-\def\XINT_lcmof:_a #1,#2,{\expandafter\XINT_lcmof:_c\romannumeral-`0#2,{#1},}%
-\def\XINT_lcmof:_c #1{\if#1,\expandafter\XINT_of:_e
- \else\expandafter\XINT_lcmof:_d\fi #1}%
-\def\XINT_lcmof:_d #1,{\expandafter\XINT_lcmof:_a\romannumeral0\xintlcm {#1}}%
\def\xintBezout {\romannumeral0\xintbezout }%
\def\xintbezout #1%
{%
@@ -489,6 +477,16 @@
\par
\endgroup
}%
+\def\xintGCDof:csv #1{\expandafter\XINT_gcdof:_b\romannumeral-`0#1,,}%
+\def\XINT_gcdof:_b #1,#2,{\expandafter\XINT_gcdof:_c\romannumeral-`0#2,{#1},}%
+\def\XINT_gcdof:_c #1{\if #1,\expandafter\XINT_of:_e
+ \else\expandafter\XINT_gcdof:_d\fi #1}%
+\def\XINT_gcdof:_d #1,{\expandafter\XINT_gcdof:_b\romannumeral0\xintgcd {#1}}%
+\def\xintLCMof:csv #1{\expandafter\XINT_lcmof:_a\romannumeral-`0#1,,}%
+\def\XINT_lcmof:_a #1,#2,{\expandafter\XINT_lcmof:_c\romannumeral-`0#2,{#1},}%
+\def\XINT_lcmof:_c #1{\if#1,\expandafter\XINT_of:_e
+ \else\expandafter\XINT_lcmof:_d\fi #1}%
+\def\XINT_lcmof:_d #1,{\expandafter\XINT_lcmof:_a\romannumeral0\xintlcm {#1}}%
\XINT_restorecatcodes_endinput%
\endinput
%%
diff --git a/Master/texmf-dist/tex/generic/xint/xintseries.sty b/Master/texmf-dist/tex/generic/xint/xintseries.sty
index c38cdaaeb03..4a234aad79e 100644
--- a/Master/texmf-dist/tex/generic/xint/xintseries.sty
+++ b/Master/texmf-dist/tex/generic/xint/xintseries.sty
@@ -21,9 +21,9 @@
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%%----------------------------------------------------------------
-%% The xint bundle (version 1.09i of December 18, 2013)
+%% The xint bundle (version 1.09j of January 9, 2014)
%% xintseries: Expandable partial sums with xint package
-%% Copyright (C) 2013 by Jean-Francois Burnol
+%% Copyright (C) 2013-2014 by Jean-Francois Burnol
%%----------------------------------------------------------------
\begingroup\catcode61\catcode48\catcode32=10\relax%
\catcode13=5 % ^^M
@@ -53,8 +53,7 @@
\else
\ifx\x\relax % plain-TeX, first loading of xintseries.sty
\ifx\w\relax % but xintfrac.sty not yet loaded.
- \y{xintseries}{Package xintfrac is required}%
- \y{xintseries}{Will try \string\input\space xintfrac.sty}%
+ \y{xintseries}{now issuing \string\input\space xintfrac.sty}%
\def\z{\endgroup\input xintfrac.sty\relax}%
\fi
\else
@@ -62,8 +61,7 @@
\ifx\x\empty % LaTeX, first loading,
% variable is initialized, but \ProvidesPackage not yet seen
\ifx\w\relax % xintfrac.sty not yet loaded.
- \y{xintseries}{Package xintfrac is required}%
- \y{xintseries}{Will try \string\RequirePackage{xintfrac}}%
+ \y{xintseries}{now issuing \string\RequirePackage{xintfrac}}%
\def\z{\endgroup\RequirePackage{xintfrac}}%
\fi
\else
@@ -103,7 +101,7 @@
\XINTsetupcatcodes%
\XINT_providespackage
\ProvidesPackage{xintseries}%
- [2013/12/18 v1.09i Expandable partial sums with xint package (jfB)]%
+ [2014/01/09 v1.09j 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 945f73bf1b5..16e3a45750c 100644
--- a/Master/texmf-dist/tex/generic/xint/xinttools.sty
+++ b/Master/texmf-dist/tex/generic/xint/xinttools.sty
@@ -21,9 +21,9 @@
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%%----------------------------------------------------------------
-%% The xint bundle (version 1.09i of December 18, 2013)
+%% The xint bundle (version 1.09j of January 9, 2014)
%% xinttools: Expandable and non-expandable utilities
-%% Copyright (C) 2013 by Jean-Francois Burnol
+%% Copyright (C) 2013-2014 by Jean-Francois Burnol
%%----------------------------------------------------------------
\begingroup\catcode61\catcode48\catcode32=10\relax%
\catcode13=5 % ^^M
@@ -150,7 +150,7 @@
\fi
\XINT_providespackage
\ProvidesPackage {xinttools}%
- [2013/12/18 v1.09i Expandable and non-expandable utilities (jfB)]%
+ [2014/01/09 v1.09j Expandable and non-expandable utilities (jfB)]%
\long\def\xint_gobble_ {}%
\long\def\xint_gobble_i #1{}%
\long\def\xint_gobble_ii #1#2{}%
@@ -164,9 +164,9 @@
\xint_firstofone{\let\XINT_sptoken= } %<- space here!
\long\def\xint_firstoftwo #1#2{#1}%
\long\def\xint_secondoftwo #1#2{#2}%
-\long\def\xint_firstoftwo_afterstop #1#2{ #1}%
-\long\def\xint_secondoftwo_afterstop #1#2{ #2}%
-\def\xint_minus_afterstop { -}%
+\long\def\xint_firstoftwo_thenstop #1#2{ #1}%
+\long\def\xint_secondoftwo_thenstop #1#2{ #2}%
+\def\xint_minus_thenstop { -}%
\long\def\xint_gob_til_R #1\R {}%
\long\def\xint_gob_til_W #1\W {}%
\long\def\xint_gob_til_Z #1\Z {}%
@@ -178,18 +178,18 @@
\chardef\xint_c_ 0
\chardef\xint_c_viii 8
\newtoks\XINT_toks
-\def\XINT_odef #1{\expandafter\def\expandafter#1\expandafter }%
-\ifdefined\odef\else\let\odef\XINT_odef\fi
-\def\XINT_godef {\global\XINT_odef }%
-\def\XINT_oodef #1{\expandafter\expandafter\expandafter\def
+\def\xintodef #1{\expandafter\def\expandafter#1\expandafter }%
+\ifdefined\odef\else\let\odef\xintodef\fi
+\def\xintgodef {\global\xintodef }%
+\def\xintoodef #1{\expandafter\expandafter\expandafter\def
\expandafter\expandafter\expandafter#1%
\expandafter\expandafter\expandafter }%
-\ifdefined\oodef\else\let\oodef\XINT_oodef\fi
-\def\XINT_goodef {\global\XINT_oodef }%
-\def\XINT_fdef #1#2{\expandafter\def\expandafter#1\expandafter
+\ifdefined\oodef\else\let\oodef\xintoodef\fi
+\def\xintgoodef {\global\xintoodef }%
+\def\xintfdef #1#2{\expandafter\def\expandafter#1\expandafter
{\romannumeral-`0#2}}%
-\ifdefined\fdef\else\let\fdef\XINT_fdef\fi
-\def\XINT_gfdef {\global\XINT_fdef }%
+\ifdefined\fdef\else\let\fdef\xintfdef\fi
+\def\xintgfdef {\global\xintfdef }% should be \global\fdef if \fdef pre-exists?
\def\xintReverseOrder {\romannumeral0\xintreverseorder }%
\long\def\xintreverseorder #1%
{%
@@ -522,7 +522,7 @@
\def\XINT_seq #1#2%
{%
\ifcase\ifnum #1=#2 0\else\ifnum #2>#1 1\else -1\fi\fi\space
- \expandafter\xint_firstoftwo_afterstop
+ \expandafter\xint_firstoftwo_thenstop
\or
\expandafter\XINT_seq_p
\else
@@ -533,20 +533,20 @@
\def\XINT_seq_p #1#2%
{%
\ifnum #1>#2
- \xint_afterfi{\expandafter\XINT_seq_p}%
+ \expandafter\expandafter\expandafter\XINT_seq_p
\else
\expandafter\XINT_seq_e
\fi
- \expandafter{\the\numexpr #1-1}{#2}{#1}%
+ \expandafter{\the\numexpr #1-\xint_c_i}{#2}{#1}%
}%
\def\XINT_seq_n #1#2%
{%
\ifnum #1<#2
- \xint_afterfi{\expandafter\XINT_seq_n}%
+ \expandafter\expandafter\expandafter\XINT_seq_n
\else
\expandafter\XINT_seq_e
\fi
- \expandafter{\the\numexpr #1+1}{#2}{#1}%
+ \expandafter{\the\numexpr #1+\xint_c_i}{#2}{#1}%
}%
\def\XINT_seq_e #1#2#3{ }%
\def\XINT_seq_opt [\xint_bye #1]#2#3%
@@ -951,14 +951,18 @@
\def\xintAssign{\def\XINT_flet_macro {\XINT_assign_fork}\XINT_flet_zapsp }%
\def\XINT_assign_fork
{%
- \let\XINT_assign_def\edef
+ \let\XINT_assign_def\def
\ifx\XINT_token[\expandafter\XINT_assign_opt
\else\expandafter\XINT_assign_a
\fi
}%
\def\XINT_assign_opt [#1]%
{%
- \expandafter\let\expandafter\XINT_assign_def \csname XINT_#1def\endcsname
+ \ifcsname #1def\endcsname
+ \expandafter\let\expandafter\XINT_assign_def \csname #1def\endcsname
+ \else
+ \expandafter\let\expandafter\XINT_assign_def \csname xint#1def\endcsname
+ \fi
\XINT_assign_a
}%
\long\def\XINT_assign_a #1\to
@@ -1002,15 +1006,19 @@
\XINT_flet_zapsp }%
\def\XINT_assignarray_fork
{%
- \let\XINT_assignarray_def\edef
+ \let\XINT_assignarray_def\def
\ifx\XINT_token[\expandafter\XINT_assignarray_opt
\else\expandafter\XINT_assignarray
\fi
}%
\def\XINT_assignarray_opt [#1]%
{%
- \expandafter\let\expandafter\XINT_assignarray_def
- \csname XINT_#1def\endcsname
+ \ifcsname #1def\endcsname
+ \expandafter\let\expandafter\XINT_assignarray_def \csname #1def\endcsname
+ \else
+ \expandafter\let\expandafter\XINT_assignarray_def
+ \csname xint#1def\endcsname
+ \fi
\XINT_assignarray
}%
\long\def\XINT_assignarray #1\to #2%