summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-03-13 21:18:24 +0000
committerKarl Berry <karl@freefriends.org>2016-03-13 21:18:24 +0000
commit1dece60d27697bab91c26ad47b09149c34bfe189 (patch)
tree086aeeeb33674fa6afe46f67828f1fa5944271f0 /Master/texmf-dist/tex
parent1dd15ac4ccc619c707b7418b3710e5f379f72f08 (diff)
xint (13mar16)
git-svn-id: svn://tug.org/texlive/trunk@40014 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r--Master/texmf-dist/tex/generic/xint/xint.sty879
-rw-r--r--Master/texmf-dist/tex/generic/xint/xintbinhex.sty6
-rw-r--r--Master/texmf-dist/tex/generic/xint/xintcfrac.sty6
-rw-r--r--Master/texmf-dist/tex/generic/xint/xintcore.sty203
-rw-r--r--Master/texmf-dist/tex/generic/xint/xintexpr.sty399
-rw-r--r--Master/texmf-dist/tex/generic/xint/xintfrac.sty1868
-rw-r--r--Master/texmf-dist/tex/generic/xint/xintgcd.sty6
-rw-r--r--Master/texmf-dist/tex/generic/xint/xintkernel.sty10
-rw-r--r--Master/texmf-dist/tex/generic/xint/xintseries.sty6
-rw-r--r--Master/texmf-dist/tex/generic/xint/xinttools.sty6
10 files changed, 2080 insertions, 1309 deletions
diff --git a/Master/texmf-dist/tex/generic/xint/xint.sty b/Master/texmf-dist/tex/generic/xint/xint.sty
index 9c485509d83..85e1274744c 100644
--- a/Master/texmf-dist/tex/generic/xint/xint.sty
+++ b/Master/texmf-dist/tex/generic/xint/xint.sty
@@ -21,8 +21,8 @@
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%% ---------------------------------------------------------------
-%% The xint bundle v1.2e 2015/11/22
-%% Copyright (C) 2013-2015 by Jean-Francois Burnol
+%% The xint bundle 1.2f 2016/03/12
+%% Copyright (C) 2013-2016 by Jean-Francois Burnol
%% xint: Expandable operations on big integers
%% ---------------------------------------------------------------
\begingroup\catcode61\catcode48\catcode32=10\relax%
@@ -70,7 +70,7 @@
\XINTsetupcatcodes% defined in xintkernel.sty (loaded by xintcore.sty)
\XINT_providespackage
\ProvidesPackage{xint}%
- [2015/11/22 v1.2e Expandable operations on big integers (jfB)]%
+ [2016/03/12 1.2f Expandable operations on big integers (JFB)]%
\long\def\xint_firstofthree #1#2#3{#1}%
\long\def\xint_secondofthree #1#2#3{#2}%
\long\def\xint_thirdofthree #1#2#3{#3}%
@@ -378,9 +378,7 @@
\fi
{ -1}{ 1}%
}%
-%%%%%%%%%%%%
\def\XINT_cmp_aa {\expandafter\XINT_cmp_w\the\numexpr\XINT_cmp_a \xint_c_i }%
-%%%%%%%%%%%%
\def\XINT_cmp_a #1!#2!#3!#4!#5\W #6!#7!#8!#9!%
{%
\XINT_cmp_b #1!#6!#2!#7!#3!#8!#4!#9!#5\W
@@ -441,7 +439,6 @@
{%
\XINT_cmp_k #1#2!%
}%
-%%%%%%%%%%%%
\def\XINT_cmp_k #1#2\W
{%
\xint_UDzerofork
@@ -533,8 +530,8 @@
{%
\expandafter\XINT_geq_fork\expandafter #1\romannumeral`&&@#3\Z #2\Z
}%
-\let\XINT_geq_pre \xintiigeq % TEMPORAIRE
-\let\XINT_Geq \xintGeq % TEMPORAIRE ATTENTION FAIT xintNum
+\let\XINT_geq_pre \xintiigeq % TEMPORAIRE (oui, mais depuis quand ?)
+\let\XINT_Geq \xintGeq % TEMPORAIRE ATTENTION FAIT xintNum (et alors?)
\def\XINT_geq #1#2\Z #3%
{%
\expandafter\XINT_geq_fork\expandafter #1\romannumeral0\xintnum{#3}\Z #2\Z
@@ -590,7 +587,7 @@
\else
\expandafter\xint_secondoftwo
\fi
- \XINT_geq_aa {\XINT_geq_distinctlengths {#1}{#2}}
+ \XINT_geq_aa {\XINT_geq_distinctlengths {#1}{#2}}%
}%
\def\XINT_geq_distinctlengths #1#2#3\W #4\W
{%
@@ -601,9 +598,7 @@
\fi
{ 1}{ 0}%
}%
-%%%%%%%%%%%%
\def\XINT_geq_aa {\expandafter\XINT_geq_w\the\numexpr\XINT_geq_a \xint_c_i }%
-%%%%%%%%%%%%
\def\XINT_geq_a #1!#2!#3!#4!#5\W #6!#7!#8!#9!%
{%
\XINT_geq_b #1!#6!#2!#7!#3!#8!#4!#9!#5\W
@@ -664,7 +659,6 @@
{%
\XINT_geq_k #1#2!%
}%
-%%%%%%%%%%%%
\def\XINT_geq_k #1#2\W
{%
\xint_UDzerofork
@@ -1012,7 +1006,7 @@
0-{\XINT_dsx_xisPos #1}%
\krof
}%
-\def\XINT_dsx_xisZero #1\Z #2{ {#2}{0}}% attention comme x > 0
+\def\XINT_dsx_xisZero #1\Z #2{{#2}{0}}% attention comme x > 0
\def\XINT_dsx_xisNeg_checkA #1\Z #2%
{%
\XINT_dsx_xisNeg_checkA_ #2\Z {#1}%
@@ -1020,34 +1014,21 @@
\def\XINT_dsx_xisNeg_checkA_ #1#2\Z #3%
{%
\xint_gob_til_zero #1\XINT_dsx_xisNeg_Azero 0%
- \XINT_dsx_xisNeg_checkx {#3}{#3}{}\Z {#1#2}%
+ \XINT_dsx_zeroloop #3.{}\Z {#1#2}%
}%
\def\XINT_dsx_xisNeg_Azero #1\Z #2{ 0}%
-\def\XINT_dsx_xisNeg_checkx #1%
+\def\XINT_dsx_addzerosnofuss #1{\XINT_dsx_zeroloop #1.{}\Z }%
+\def\XINT_dsx_zeroloop #1.#2%
{%
- \ifnum #1>1000000
- \xint_afterfi
- {\xintError:TooBigDecimalShift
- \expandafter\space\expandafter 0\xint_gobble_iv }%
- \else
- \expandafter \XINT_dsx_zeroloop
- \fi
-}%
-\def\XINT_dsx_addzerosnofuss #1{\XINT_dsx_zeroloop {#1}{}\Z }%
-\def\XINT_dsx_zeroloop #1#2%
-{%
- \ifnum #1<\xint_c_ix \XINT_dsx_exita\fi
- \expandafter\XINT_dsx_zeroloop\expandafter
- {\the\numexpr #1-\xint_c_viii}{#200000000}%
-}%
-\def\XINT_dsx_exita\fi\expandafter\XINT_dsx_zeroloop
-{%
- \fi\expandafter\XINT_dsx_exitb
+ \ifnum #1<\xint_c_ix \expandafter\XINT_dsx_exita\fi
+ \expandafter\XINT_dsx_zeroloop\the\numexpr #1-\xint_c_viii.{#200000000}%
}%
-\def\XINT_dsx_exitb #1#2%
+\def\XINT_dsx_exita
+ \expandafter\XINT_dsx_zeroloop\the\numexpr #1-\xint_c_viii.#2%
{%
\expandafter\expandafter\expandafter
- \XINT_dsx_addzeros\csname xint_gobble_\romannumeral -#1\endcsname #2%
+ \XINT_dsx_addzeros\csname xint_gobble_\expandafter
+ \romannumeral\numexpr \xint_c_viii-(#1)\endcsname #2%
}%
\def\XINT_dsx_addzeros #1\Z #2{ #2#1}%
\def\XINT_dsx_xisPos #1\Z #2%
@@ -1062,28 +1043,23 @@
0-{\XINT_dsx_AisPos #1}%
\krof
}%
-\def\XINT_dsx_AisZero #1\Z #2{ {0}{0}}%
+\def\XINT_dsx_AisZero #1\Z #2{{0}{0}}%
\def\XINT_dsx_AisNeg #1\Z #2%
{%
- \expandafter\XINT_dsx_AisNeg_dosplit_andcheckfirst
- \romannumeral0\XINT_split_checksizex {#2}{#1}%
-}%
-\def\XINT_dsx_AisNeg_dosplit_andcheckfirst #1%
-{%
- \XINT_dsx_AisNeg_checkiffirstempty #1\Z
+ \expandafter\XINT_dsx_AisNeg_checkiffirstempty
+ \romannumeral0\XINT_split_xfork #2.#1\W\W\W\W\W\W\W\W\Z
}%
\def\XINT_dsx_AisNeg_checkiffirstempty #1%
{%
- \xint_gob_til_Z #1\XINT_dsx_AisNeg_finish_zero\Z
+ \xint_gob_til_dot #1\XINT_dsx_AisNeg_finish_zero.%
\XINT_dsx_AisNeg_finish_notzero #1%
}%
-\def\XINT_dsx_AisNeg_finish_zero\Z
- \XINT_dsx_AisNeg_finish_notzero\Z #1%
+\def\XINT_dsx_AisNeg_finish_zero.\XINT_dsx_AisNeg_finish_notzero.#1.%
{%
\expandafter\XINT_dsx_end
\expandafter {\romannumeral0\XINT_num {-#1}}{0}%
}%
-\def\XINT_dsx_AisNeg_finish_notzero #1\Z #2%
+\def\XINT_dsx_AisNeg_finish_notzero #1.#2.%
{%
\expandafter\XINT_dsx_end
\expandafter {\romannumeral0\XINT_num {#2}}{-#1}%
@@ -1091,57 +1067,39 @@
\def\XINT_dsx_AisPos #1\Z #2%
{%
\expandafter\XINT_dsx_AisPos_finish
- \romannumeral0\XINT_split_checksizex {#2}{#1}%
+ \romannumeral0\XINT_split_xfork #2.#1\W\W\W\W\W\W\W\W\Z
}%
-\def\XINT_dsx_AisPos_finish #1#2%
+\def\XINT_dsx_AisPos_finish #1.#2.%
{%
\expandafter\XINT_dsx_end
\expandafter {\romannumeral0\XINT_num {#2}}%
{\romannumeral0\XINT_num {#1}}%
}%
-\edef\XINT_dsx_end #1#2%
-{%
- \noexpand\expandafter\space\noexpand\expandafter{#2}{#1}%
-}%
-\def\xintDecSplitL {\romannumeral0\xintdecsplitl }%
-\def\xintDecSplitR {\romannumeral0\xintdecsplitr }%
-\def\xintdecsplitl
-{%
- \expandafter\xint_firstoftwo_thenstop
- \romannumeral0\xintdecsplit
-}%
-\def\xintdecsplitr
-{%
- \expandafter\xint_secondoftwo_thenstop
- \romannumeral0\xintdecsplit
-}%
+\def\XINT_dsx_end #1#2{\expandafter{#2}{#1}}%
\def\xintDecSplit {\romannumeral0\xintdecsplit }%
\def\xintdecsplit #1#2%
{%
- \expandafter \xint_split \expandafter
- {\romannumeral0\xintiiabs {#2}}{#1}% fait expansion de A
+ \expandafter\XINT_split_finish
+ \romannumeral0\expandafter\XINT_split_xfork
+ \the\numexpr #1\expandafter.\romannumeral0\xintiiabs {#2}\W\W\W\W\W\W\W\W\Z
}%
-\def\xint_split #1#2%
+\def\xintDecSplitL {\romannumeral0\xintdecsplitl }%
+\def\xintdecsplitl #1#2%
{%
- \expandafter\XINT_split_checksizex\expandafter{\the\numexpr #2}{#1}%
+ \expandafter\XINT_splitl_finish
+ \romannumeral0\expandafter\XINT_split_xfork
+ \the\numexpr #1\expandafter.\romannumeral0\xintiiabs {#2}\W\W\W\W\W\W\W\W\Z
}%
-\def\XINT_split_checksizex #1% 999999999 is anyhow very big, could be reduced
+\def\xintDecSplitR {\romannumeral0\xintdecsplitr }%
+\def\xintdecsplitr #1#2%
{%
- \ifnum\numexpr\XINT_Abs{#1}>999999999
- \xint_afterfi {\xintError:TooBigDecimalSplit\XINT_split_bigx }%
- \else
- \expandafter\XINT_split_xfork
- \fi
- #1\Z
-}%
-\def\XINT_split_bigx #1\Z #2%
-{%
- \ifcase\XINT_cntSgn #1\Z
- \or \xint_afterfi { {}{#2}}% positive big x
- \else
- \xint_afterfi { {#2}{}}% negative big x
- \fi
+ \expandafter\XINT_splitr_finish
+ \romannumeral0\expandafter\XINT_split_xfork
+ \the\numexpr #1\expandafter.\romannumeral0\xintiiabs {#2}\W\W\W\W\W\W\W\W\Z
}%
+\def\XINT_split_finish #1.#2.{{#1}{#2}}%
+\def\XINT_splitl_finish #1.#2.{{#1}}%
+\def\XINT_splitr_finish #1.#2.{{#2}}%
\def\XINT_split_xfork #1%
{%
\xint_UDzerominusfork
@@ -1150,36 +1108,35 @@
0-{\XINT_split_fromright #1}%
\krof
}%
-\def\XINT_split_zerosplit #1\Z #2{ {#2}{}}%
-\def\XINT_split_fromleft #1\Z #2%
+\def\XINT_split_zerosplit #1.#2\W\W\W\W\W\W\W\W\Z{ #2..}%
+\def\XINT_split_fromleft #1.%#2\W\W\W\W\W\W\W\W\Z
{%
- \XINT_split_fromleft_loop {#1}{}#2\W\W\W\W\W\W\W\W\Z
+ \XINT_split_fromleft_loop #1.{}%#2\W\W\W\W\W\W\W\W\Z
}%
-\def\XINT_split_fromleft_loop #1%
+\def\XINT_split_fromleft_loop #1.%
{%
- \ifnum #1<\xint_c_viii\XINT_split_fromleft_exita\fi
- \expandafter\XINT_split_fromleft_loop_perhaps\expandafter
- {\the\numexpr #1-\xint_c_viii\expandafter}\XINT_split_fromleft_eight
+ \ifnum #1<\xint_c_viii\expandafter\XINT_split_fromleft_exita\fi
+ \expandafter\XINT_split_fromleft_loop_perhaps
+ \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%
+\def\XINT_split_fromleft_loop_perhaps #1.#2%
{%
\xint_gob_til_W #2\XINT_split_fromleft_toofar\W
- \XINT_split_fromleft_loop {#1}%
+ \XINT_split_fromleft_loop #1.%
}%
-\def\XINT_split_fromleft_toofar\W\XINT_split_fromleft_loop #1#2#3\Z
+\def\XINT_split_fromleft_toofar\W\XINT_split_fromleft_loop #1.#2#3\Z
{%
\XINT_split_fromleft_toofar_b #2\Z
}%
-\def\XINT_split_fromleft_toofar_b #1\W #2\Z { {#1}{}}%
-\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-\xint_c_viii\expandafter
+\def\XINT_split_fromleft_toofar_b #1\W #2\Z { #1..}%
+\def\XINT_split_fromleft_exita
+ \expandafter\XINT_split_fromleft_loop_perhaps
+ \the\numexpr #1-\xint_c_viii\expandafter.\XINT_split_fromleft_eight
{%
\csname XINT_split_fromleft_endsplit_\romannumeral #1\endcsname
}%
-\def\XINT_split_fromleft_endsplit_ #1#2\W #3\Z { {#1}{#2}}%
+\def\XINT_split_fromleft_endsplit_ #1#2\W #3\Z { #1.#2.}%
\def\XINT_split_fromleft_endsplit_i #1#2%
{\XINT_split_fromleft_checkiftoofar #2{#1#2}}%
\def\XINT_split_fromleft_endsplit_ii #1#2#3%
@@ -1196,47 +1153,41 @@
{\XINT_split_fromleft_checkiftoofar #8{#1#2#3#4#5#6#7#8}}%
\def\XINT_split_fromleft_checkiftoofar #1#2#3\W #4\Z
{%
- \xint_gob_til_W #1\XINT_split_fromleft_wenttoofar\W
- \space {#2}{#3}%
+ \xint_gob_til_W #1\XINT_split_fromleft_wenttoofar\W \space#2.#3.%
}%
-\def\XINT_split_fromleft_wenttoofar\W\space #1%
+\def\XINT_split_fromleft_wenttoofar\W\space #1.%
{%
\XINT_split_fromleft_wenttoofar_b #1\Z
}%
-\def\XINT_split_fromleft_wenttoofar_b #1\W #2\Z { {#1}}%
-\def\XINT_split_fromright #1\Z #2%
-{%
- \expandafter \XINT_split_fromright_a \expandafter
- {\romannumeral0\xintreverseorder {#2}}{#1}{#2}%
-}%
-\def\XINT_split_fromright_a #1#2%
+\def\XINT_split_fromleft_wenttoofar_b #1\W #2\Z { #1.}%
+\def\XINT_split_fromright #1.#2\W\W\W\W\W\W\W\W\Z
{%
- \XINT_split_fromright_loop {#2}{}#1\W\W\W\W\W\W\W\W\Z
+ \expandafter\XINT_split_fromright_loop
+ \the\numexpr #1\expandafter.\expandafter{\expandafter}%
+ \romannumeral0\xintreverseorder{#2}\W\W\W\W\W\W\W\W\Z #2.%
}%
-\def\XINT_split_fromright_loop #1%
+\def\XINT_split_fromright_loop #1.%
{%
- \ifnum #1<\xint_c_viii\XINT_split_fromright_exita\fi
- \expandafter\XINT_split_fromright_loop_perhaps\expandafter
- {\the\numexpr #1-\xint_c_viii\expandafter }\XINT_split_fromright_eight
+ \ifnum #1<\xint_c_viii\expandafter\XINT_split_fromright_exita\fi
+ \expandafter\XINT_split_fromright_loop_perhaps
+ \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%
+\def\XINT_split_fromright_loop_perhaps #1.#2%
{%
\xint_gob_til_W #2\XINT_split_fromright_toofar\W
- \XINT_split_fromright_loop {#1}%
+ \XINT_split_fromright_loop #1.%
}%
-\def\XINT_split_fromright_toofar\W\XINT_split_fromright_loop #1#2#3\Z { {}}%
-\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-\xint_c_viii\expandafter
+\def\XINT_split_fromright_toofar\W\XINT_split_fromright_loop #1\Z {.}%
+\def\XINT_split_fromright_exita
+ \expandafter\XINT_split_fromright_loop_perhaps
+ \the\numexpr #1-\xint_c_viii\expandafter.\XINT_split_fromright_eight
{%
\csname XINT_split_fromright_endsplit_\romannumeral #1\endcsname
}%
-\edef\XINT_split_fromright_endsplit_ #1#2\W #3\Z #4%
+\def\XINT_split_fromright_endsplit_ #1#2\W #3\Z #4.%
{%
- \noexpand\expandafter\space\noexpand\expandafter
- {\noexpand\romannumeral0\noexpand\xintreverseorder {#2}}{#1}%
+ \xintreverseorder {#2}.#1.%
}%
\def\XINT_split_fromright_endsplit_i #1#2%
{\XINT_split_fromright_checkiftoofar #2{#2#1}}%
@@ -1257,8 +1208,8 @@
\xint_gob_til_W #1\XINT_split_fromright_wenttoofar\W
\XINT_split_fromright_endsplit_
}%
-\def\XINT_split_fromright_wenttoofar\W\XINT_split_fromright_endsplit_ #1\Z #2%
- { {}{#2}}%
+\def\XINT_split_fromright_wenttoofar\W
+ \XINT_split_fromright_endsplit_ #1\Z {.}%
\def\xintiiSqrt {\romannumeral0\xintiisqrt }%
\def\xintiiSqrtR {\romannumeral0\xintiisqrtr }%
\def\xintiiSquareRoot {\romannumeral0\xintiisquareroot }%
@@ -1284,159 +1235,649 @@
\edef\XINT_sqrt_isneg #1\Z {\noexpand\xintError:RootOfNegative\space 11}%
\def\XINT_sqrt #1\Z
{%
- \expandafter\XINT_sqrt_start\expandafter {\romannumeral0\xintlength {#1}}{#1}%
+ \expandafter\XINT_sqrt_start\romannumeral0\xintlength {#1}.#1.%
}%
-\def\XINT_sqrt_start #1%
+\def\XINT_sqrt_start #1.%
{%
- \ifnum #1<\xint_c_x
- \expandafter\XINT_sqrt_small_a
- \else
- \expandafter\XINT_sqrt_big_a
- \fi
- {#1}%
+ \ifnum #1<\xint_c_x\xint_dothis\XINT_sqrt_small_a\fi
+ \xint_orthat\XINT_sqrt_big_a #1.%
}%
-\def\XINT_sqrt_small_a #1{\XINT_sqrt_a {#1}\XINT_sqrt_small_d }%
-\def\XINT_sqrt_big_a #1{\XINT_sqrt_a {#1}\XINT_sqrt_big_d }%
-\def\XINT_sqrt_a #1%
+\def\XINT_sqrt_small_a #1.{\XINT_sqrt_a #1.\XINT_sqrt_small_d }%
+\def\XINT_sqrt_big_a #1.{\XINT_sqrt_a #1.\XINT_sqrt_big_d }%
+\def\XINT_sqrt_a #1.%
{%
\ifodd #1
- \expandafter\XINT_sqrt_bB
+ \expandafter\XINT_sqrt_bO
\else
- \expandafter\XINT_sqrt_bA
+ \expandafter\XINT_sqrt_bE
\fi
- {#1}%
+ #1.%
}%
-\def\XINT_sqrt_bA #1#2#3%
+\def\XINT_sqrt_bE #1.#2#3#4%
{%
- \XINT_sqrt_bA_b #3\Z #2{#1}{#3}%
+ \XINT_sqrt_c {#3#4}#2{#1}#3#4%
}%
-\def\XINT_sqrt_bA_b #1#2#3\Z
+\def\XINT_sqrt_bO #1.#2#3%
{%
- \XINT_sqrt_c {#1#2}%
+ \XINT_sqrt_c #3#2{#1}#3%
}%
-\def\XINT_sqrt_bB #1#2#3%
+\def\XINT_sqrt_c #1#2%
{%
- \XINT_sqrt_bB_b #3\Z #2{#1}{#3}%
+ \expandafter #2%
+ \the\numexpr \ifnum #1>\xint_c_ii
+ \ifnum #1>\xint_c_vi
+ \ifnum #1>12 \ifnum #1>20 \ifnum #1>30
+ \ifnum #1>42 \ifnum #1>56 \ifnum #1>72
+ \ifnum #1>90
+ 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 \else 1\fi .%
}%
-\def\XINT_sqrt_bB_b #1#2\Z
+\def\XINT_sqrt_small_d #1.#2%
{%
- \XINT_sqrt_c #1%
+ \expandafter\XINT_sqrt_small_e
+ \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_c #1#2%
+\def\XINT_sqrt_small_e #1.#2.%
{%
- \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 }%
+ \expandafter\XINT_sqrt_small_ea\the\numexpr #1*#1-#2.#1.%
}%
-\def\XINT_sqrt_small_d #1#2%
+\def\XINT_sqrt_small_ea #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 }%
+ \if0#1\xint_dothis\XINT_sqrt_small_ez\fi
+ \if-#1\xint_dothis\XINT_sqrt_small_eb\fi
+ \xint_orthat\XINT_sqrt_small_f #1%
}%
-\def\XINT_sqrt_small_e #1#2%
+\def\XINT_sqrt_small_ez 0.#1.{\expandafter{\the\numexpr#1+\xint_c_i
+ \expandafter}\expandafter{\the\numexpr #1*\xint_c_ii+\xint_c_i}}%
+\def\XINT_sqrt_small_eb -#1.#2.%
{%
- \expandafter\XINT_sqrt_small_f\expandafter {\the\numexpr #1*#1-#2}{#1}%
+ \expandafter\XINT_sqrt_small_ec \the\numexpr
+ (#1-\xint_c_i+#2)/(\xint_c_ii*#2).#1.#2.%
}%
-\def\XINT_sqrt_small_f #1#2%
+\def\XINT_sqrt_small_ec #1.#2.#3.%
{%
- \expandafter\XINT_sqrt_small_g\expandafter
- {\the\numexpr ((#1+#2)/(\xint_c_ii*#2))-\xint_c_i}{#1}{#2}%
+ \expandafter\XINT_sqrt_small_f \the\numexpr
+ -#2+\xint_c_ii*#3*#1+#1*#1\expandafter.\the\numexpr #3+#1.%
}%
-\def\XINT_sqrt_small_g #1%
+\def\XINT_sqrt_small_f #1.#2.%
{%
- \ifnum #1>\xint_c_
- \expandafter\XINT_sqrt_small_h
- \else
+ \expandafter\XINT_sqrt_small_g
+ \the\numexpr (#1+#2)/(\xint_c_ii*#2)-\xint_c_i.#1.#2.%
+}%
+\def\XINT_sqrt_small_g #1#2.%
+{%
+ \if 0#1%
\expandafter\XINT_sqrt_small_end
+ \else
+ \expandafter\XINT_sqrt_small_h
\fi
- {#1}%
+ #1#2.%
}%
-\def\XINT_sqrt_small_h #1#2#3%
+\def\XINT_sqrt_small_h #1.#2.#3.%
{%
- \expandafter\XINT_sqrt_small_f\expandafter
- {\the\numexpr #2-\xint_c_ii*#1*#3+#1*#1\expandafter}\expandafter
- {\the\numexpr #3-#1}%
+ \expandafter\XINT_sqrt_small_f
+ \the\numexpr #2-\xint_c_ii*#1*#3+#1*#1\expandafter.%
+ \the\numexpr #3-#1.%
}%
-\def\XINT_sqrt_small_end #1#2#3{ {#3}{#2}}%
-\def\XINT_sqrt_big_d #1#2%
+\def\XINT_sqrt_small_end #1.#2.#3.{{#3}{#2}}%
+\def\XINT_sqrt_big_d #1.#2%
{%
- \ifodd #2
- \expandafter\expandafter\expandafter\XINT_sqrt_big_eB
- \else
- \expandafter\expandafter\expandafter\XINT_sqrt_big_eA
- \fi
- \expandafter {\the\numexpr #2/\xint_c_ii }{#1}%
+ \ifodd #2 \xint_dothis{\expandafter\XINT_sqrt_big_eO}\fi
+ \xint_orthat{\expandafter\XINT_sqrt_big_eE}%
+ \the\numexpr (#2-\xint_c_i)/\xint_c_ii.#1;%
+}%
+\def\XINT_sqrt_big_eE #1;#2#3#4#5#6#7#8#9%
+{%
+ \XINT_sqrt_big_eE_a #1;{#2#3#4#5#6#7#8#9}%
+}%
+\def\XINT_sqrt_big_eE_a #1.#2;#3%
+{%
+ \expandafter\XINT_sqrt_bigormed_f
+ \romannumeral0\XINT_sqrt_small_e #2000.#3.#1;%
+}%
+\def\XINT_sqrt_big_eO #1;#2#3#4#5#6#7#8#9%
+{%
+ \XINT_sqrt_big_eO_a #1;{#2#3#4#5#6#7#8#9}%
}%
-\def\XINT_sqrt_big_eA #1#2#3%
+\def\XINT_sqrt_big_eO_a #1.#2;#3#4%
{%
- \XINT_sqrt_big_eA_a #3\Z {#2}{#1}{#3}%
+ \expandafter\XINT_sqrt_bigormed_f
+ \romannumeral0\XINT_sqrt_small_e #20000.#3#4.#1;%
}%
-\def\XINT_sqrt_big_eA_a #1#2#3#4#5#6#7#8#9\Z
+\def\XINT_sqrt_bigormed_f #1#2#3;%
{%
- \XINT_sqrt_big_eA_b {#1#2#3#4#5#6#7#8}%
+ \ifnum#3<\xint_c_ix
+ \xint_dothis {\csname XINT_sqrt_med_f\romannumeral#3\endcsname}%
+ \fi
+ \xint_orthat\XINT_sqrt_big_f #1.#2.#3;%
+}%
+\def\XINT_sqrt_med_fv {\XINT_sqrt_med_fa .}%
+\def\XINT_sqrt_med_fvi {\XINT_sqrt_med_fa 0.}%
+\def\XINT_sqrt_med_fvii {\XINT_sqrt_med_fa 00.}%
+\def\XINT_sqrt_med_fviii{\XINT_sqrt_med_fa 000.}%
+\def\XINT_sqrt_med_fa #1.#2.#3.#4;%
+{%
+ \expandafter\XINT_sqrt_med_fb
+ \the\numexpr (#30#1-5#1)/(\xint_c_ii*#2).#1.#2.#3.%
+}%
+\def\XINT_sqrt_med_fb #1.#2.#3.#4.#5.%
+{%
+ \expandafter\XINT_sqrt_small_ea
+ \the\numexpr (#40#2-\xint_c_ii*#3*#1)*10#2+(#1*#1-#5)\expandafter.%
+ \the\numexpr #30#2-#1.%
+}%
+\def\XINT_sqrt_big_f #1;#2#3#4#5#6#7#8#9%
+{%
+ \XINT_sqrt_big_fa #1;{#2#3#4#5#6#7#8#9}%
+}%
+\def\XINT_sqrt_big_fa #1.#2.#3;#4%
+{%
+ \expandafter\XINT_sqrt_big_ga
+ \the\numexpr #3-\xint_c_viii\expandafter.%
+ \romannumeral0\XINT_sqrt_med_fa 000.#1.#2.;#4.%
+}%
+\def\XINT_sqrt_big_ga #1.#2#3%
+{%
+ \ifnum #1>\xint_c_viii
+ \expandafter\XINT_sqrt_big_gb\else
+ \expandafter\XINT_sqrt_big_ka
+ \fi #1.#3.#2.%
+}%
+\def\XINT_sqrt_big_gb #1.#2.#3.%
+{%
+ \expandafter\XINT_sqrt_big_gc
+ \the\numexpr (\xint_c_ii*#2-\xint_c_i)*\xint_c_x^viii/(\xint_c_iv*#3).%
+ #3.#2.#1;%
+}%
+\def\XINT_sqrt_big_gc #1.#2.#3.%
+{%
+ \expandafter\XINT_sqrt_big_gd
+ \romannumeral0\xintiiadd
+ {\xintiiSub {#300000000}{\xintDouble{\xintiiMul{#2}{#1}}}00000000}%
+ {\xintiiSqr {#1}}.%
+ \romannumeral0\xintiisub{#200000000}{#1}.%
+}%
+\def\XINT_sqrt_big_gd #1.#2.%
+{%
+ \expandafter\XINT_sqrt_big_ge #2.#1.%
+}%
+\def\XINT_sqrt_big_ge #1;#2#3#4#5#6#7#8#9%
+ {\XINT_sqrt_big_gf #1.#2#3#4#5#6#7#8#9;}%
+\def\XINT_sqrt_big_gf #1;#2#3#4#5#6#7#8#9%
+ {\XINT_sqrt_big_gg #1#2#3#4#5#6#7#8#9.}%
+\def\XINT_sqrt_big_gg #1.#2.#3.#4.%
+{%
+ \expandafter\XINT_sqrt_big_gloop
+ \expandafter\xint_c_xvi\expandafter.%
+ \the\numexpr #3-\xint_c_viii\expandafter.%
+ \romannumeral0\xintiisub {#2}{\xintiNum{#4}}.#1.%
+}%
+\def\XINT_sqrt_big_gloop #1.#2.%
+{%
+ \unless\ifnum #1<#2 \xint_dothis\XINT_sqrt_big_ka \fi
+ \xint_orthat{\XINT_sqrt_big_gi #1.}#2.%
+}%
+\def\XINT_sqrt_big_gi #1.%
+{%
+ \expandafter\XINT_sqrt_big_gj
+ \romannumeral0\XINT_dsx_addzerosnofuss{#1}{}.#1.%
}%
-\def\XINT_sqrt_big_eA_b #1#2%
+\def\XINT_sqrt_big_gj #1.#2.#3.#4.#5.%
{%
- \expandafter\XINT_sqrt_big_f
- \romannumeral0\XINT_sqrt_small_e {#2000}{#1}{#1}%
+ \expandafter\XINT_sqrt_big_gk
+ \romannumeral0\xintiidivision {#4#1}{\XINT_dbl_pos #5\Z}.%
+ #1.#5.#2.#3.%
}%
-\def\XINT_sqrt_big_eB #1#2#3%
+\def\XINT_sqrt_big_gk #1#2.#3.#4.%
{%
- \XINT_sqrt_big_eB_a #3\Z {#2}{#1}{#3}%
+ \expandafter\XINT_sqrt_big_gl
+ \romannumeral0\xintiiadd {#2#3}{\xintiiSqr{#1}}.%
+ \romannumeral0\xintiisub {#4#3}{#1}.%
}%
-\def\XINT_sqrt_big_eB_a #1#2#3#4#5#6#7#8#9%
+\def\XINT_sqrt_big_gl #1.#2.%
{%
- \XINT_sqrt_big_eB_b {#1#2#3#4#5#6#7#8#9}%
+ \expandafter\XINT_sqrt_big_gm #2.#1.%
}%
-\def\XINT_sqrt_big_eB_b #1#2\Z #3%
+\def\XINT_sqrt_big_gm #1.#2.#3.#4.#5.%
{%
- \expandafter\XINT_sqrt_big_f
- \romannumeral0\XINT_sqrt_small_e {#30000}{#1}{#1}%
+ \expandafter\XINT_sqrt_big_gn
+ \romannumeral0\expandafter\XINT_split_fromleft_loop
+ \the\numexpr\xint_c_ii*#3.{}#5\W\W\W\W\W\W\W\W\Z
+ #1.#2.#3.#4.%
}%
-\def\XINT_sqrt_big_f #1#2#3#4%
+\def\XINT_sqrt_big_gn #1.#2.#3.#4.#5.#6.%
{%
- \expandafter\XINT_sqrt_big_f_a\expandafter
- {\the\numexpr #2+#3\expandafter}\expandafter
- {\romannumeral0\XINT_dsx_addzerosnofuss
- {\numexpr #4-\xint_c_iv\relax}{#1}}{#4}%
+ \expandafter\XINT_sqrt_big_gloop
+ \the\numexpr \xint_c_ii*#5\expandafter.%
+ \the\numexpr #6-#5\expandafter.%
+ \romannumeral0\xintiisub{#4}{\xintiNum{#1}}.#3.#2.%
}%
-\def\XINT_sqrt_big_f_a #1#2#3#4%
+\def\XINT_sqrt_big_ka #1.#2.#3.#4.%
{%
- \expandafter\XINT_sqrt_big_g\expandafter
- {\romannumeral0\xintiisub
- {\XINT_dsx_addzerosnofuss
- {\numexpr \xint_c_ii*#3-\xint_c_viii\relax}{#1}}{#4}}%
- {#2}{#3}%
+ \expandafter\XINT_sqrt_big_kb
+ \romannumeral0\XINT_dsx_addzerosnofuss {#1}{#3}.%
+ \romannumeral0\xintiisub
+ {\XINT_dsx_addzerosnofuss {\numexpr\xint_c_ii*#1}{#2}}%
+ {\xintiNum{#4}}.%
}%
-\def\XINT_sqrt_big_g #1#2%
+\def\XINT_sqrt_big_kb #1.#2.%
{%
- \expandafter\XINT_sqrt_big_j
+ \expandafter\XINT_sqrt_big_kc #2.#1.%
+}%
+\def\XINT_sqrt_big_kc #1%
+{%
+ \if0#1\xint_dothis\XINT_sqrt_big_kz\fi
+ \xint_orthat\XINT_sqrt_big_kloop #1%
+}%
+\def\XINT_sqrt_big_kz 0.#1.%
+{%
+ \expandafter\XINT_sqrt_big_kend
+ \romannumeral0\xintinc{\XINT_dbl_pos #1\Z}.#1.%
+}%
+\def\XINT_sqrt_big_kend #1.#2.%
+{%
+ \expandafter{\romannumeral0\xintinc{#2}}{#1}%
+}%
+\def\XINT_sqrt_big_kloop #1.#2.%
+{%
+ \expandafter\XINT_sqrt_big_ke
\romannumeral0\xintiidivision{#1}{\romannumeral0\XINT_dbl_pos #2\Z}{#2}%
}%
-\def\XINT_sqrt_big_j #1%
+\def\XINT_sqrt_big_ke #1%
{%
\if0\XINT_Sgn #1\Z
\expandafter \XINT_sqrt_big_end
- \else \expandafter \XINT_sqrt_big_k
+ \else \expandafter \XINT_sqrt_big_kf
\fi {#1}%
}%
-\def\XINT_sqrt_big_k #1#2#3%
+\def\XINT_sqrt_big_kf #1#2#3%
+{%
+ \expandafter\XINT_sqrt_big_kg
+ \romannumeral0\xintiisub {#3}{#1}.%
+ \romannumeral0\xintiiadd {#2}{\xintiiSqr {#1}}.%
+}%
+\def\XINT_sqrt_big_kg #1.#2.%
+{%
+ \expandafter\XINT_sqrt_big_kloop #2.#1.%
+}%
+\def\XINT_sqrt_big_end #1#2#3{{#3}{#2}}%
+\def\xintiiBinomial {\romannumeral0\xintiibinomial }%
+\def\xintiibinomial #1#2%
+{%
+ \expandafter\XINT_binom_pre\the\numexpr #1\expandafter.\the\numexpr #2.%
+}%
+\def\XINT_binom_pre #1.#2.%
+{%
+ \expandafter\XINT_binom_fork \the\numexpr#1-#2.#2.#1.%
+}%
+\def\xintiBinomial{\romannumeral0\xintibinomial}%
+\let\xintibinomial\xintiibinomial
+\def\XINT_binom_fork #1#2.#3#4.#5#6.%
+{%
+ \if-#1\xint_dothis {\xintError:OutOfRangeBinomial\space 0}\fi
+ \if-#3\xint_dothis {\xintError:OutOfRangeBinomial\space 0}\fi
+ \if0#1\xint_dothis{ 1}\fi
+ \if0#3\xint_dothis{ 1}\fi
+ \ifnum #5#6>\xint_c_x^viii_mone\xint_dothis{\xintError:OutOfRangeBinomial\space 0}\fi
+ \ifnum #1#2>#3#4 \xint_dothis{\XINT_binom_a #1#2.#3#4.}\fi
+ \xint_orthat{\XINT_binom_a #3#4.#1#2.}%
+}%
+\def\XINT_binom_a #1.#2.%
+{%
+ \expandafter\XINT_binom_b\the\numexpr \xint_c_i+#1.1.#2.100000001!1!\Z!0!%
+}%
+\def\XINT_binom_b #1.%
+{%
+ \ifnum #1>9999 \xint_dothis\XINT_binom_vbigloop \fi
+ \ifnum #1>463 \xint_dothis\XINT_binom_bigloop \fi
+ \ifnum #1>98 \xint_dothis\XINT_binom_medloop \fi
+ \ifnum #1>29 \xint_dothis\XINT_binom_smallloop \fi
+ \xint_orthat\XINT_binom_vsmallloop #1.%
+}%
+\def\XINT_binom_smallloop #1.#2.#3.%
+{%
+ \ifcase\numexpr #3-#2\relax
+ \expandafter\XINT_binom_end_
+ \or \expandafter\XINT_binom_end_i
+ \or \expandafter\XINT_binom_end_ii
+ \or \expandafter\XINT_binom_end_iii
+ \else\expandafter\XINT_binom_smallloop_a
+ \fi #1.#2.#3.%
+}%
+\def\XINT_binom_smallloop_a #1.#2.#3.%
+{%
+ \expandafter\XINT_binom_smallloop_b
+ \the\numexpr #1+\xint_c_iv\expandafter.%
+ \the\numexpr #2+\xint_c_iv\expandafter.%
+ \the\numexpr #3\expandafter.%
+ \the\numexpr\expandafter\XINT_binom_div
+ \the\numexpr #2*(#2+\xint_c_i)*(#2+\xint_c_ii)*(#2+\xint_c_iii)\expandafter
+ !\romannumeral0\expandafter\XINT_binom_mul
+ \the\numexpr #1*(#1+\xint_c_i)*(#1+\xint_c_ii)*(#1+\xint_c_iii)!%
+}%
+\def\XINT_binom_smallloop_b #1.%
+{%
+ \ifnum #1>98 \expandafter\XINT_binom_medloop \else
+ \expandafter\XINT_binom_smallloop \fi #1.%
+}%
+\def\XINT_binom_medloop #1.#2.#3.%
+{%
+ \ifcase\numexpr #3-#2\relax
+ \expandafter\XINT_binom_end_
+ \or \expandafter\XINT_binom_end_i
+ \or \expandafter\XINT_binom_end_ii
+ \else\expandafter\XINT_binom_medloop_a
+ \fi #1.#2.#3.%
+}%
+\def\XINT_binom_medloop_a #1.#2.#3.%
+{%
+ \expandafter\XINT_binom_medloop_b
+ \the\numexpr #1+\xint_c_iii\expandafter.%
+ \the\numexpr #2+\xint_c_iii\expandafter.%
+ \the\numexpr #3\expandafter.%
+ \the\numexpr\expandafter\XINT_binom_div
+ \the\numexpr #2*(#2+\xint_c_i)*(#2+\xint_c_ii)\expandafter
+ !\romannumeral0\expandafter\XINT_binom_mul
+ \the\numexpr #1*(#1+\xint_c_i)*(#1+\xint_c_ii)!%
+}%
+\def\XINT_binom_medloop_b #1.%
+{%
+ \ifnum #1>463 \expandafter\XINT_binom_bigloop \else
+ \expandafter\XINT_binom_medloop \fi #1.%
+}%
+\def\XINT_binom_bigloop #1.#2.#3.%
+{%
+ \ifcase\numexpr #3-#2\relax
+ \expandafter\XINT_binom_end_
+ \or \expandafter\XINT_binom_end_i
+ \else\expandafter\XINT_binom_bigloop_a
+ \fi #1.#2.#3.%
+}%
+\def\XINT_binom_bigloop_a #1.#2.#3.%
+{%
+ \expandafter\XINT_binom_bigloop_b
+ \the\numexpr #1+\xint_c_ii\expandafter.%
+ \the\numexpr #2+\xint_c_ii\expandafter.%
+ \the\numexpr #3\expandafter.%
+ \the\numexpr\expandafter\XINT_binom_div
+ \the\numexpr #2*(#2+\xint_c_i)\expandafter
+ !\romannumeral0\expandafter\XINT_binom_mul
+ \the\numexpr #1*(#1+\xint_c_i)!%
+}%
+\def\XINT_binom_bigloop_b #1.%
+{%
+ \ifnum #1>9999 \expandafter\XINT_binom_vbigloop \else
+ \expandafter\XINT_binom_bigloop \fi #1.%
+}%
+\def\XINT_binom_vbigloop #1.#2.#3.%
+{%
+ \ifnum #3=#2
+ \expandafter\XINT_binom_end_
+ \else\expandafter\XINT_binom_vbigloop_a
+ \fi #1.#2.#3.%
+}%
+\def\XINT_binom_vbigloop_a #1.#2.#3.%
+{%
+ \expandafter\XINT_binom_vbigloop
+ \the\numexpr #1+\xint_c_i\expandafter.%
+ \the\numexpr #2+\xint_c_i\expandafter.%
+ \the\numexpr #3\expandafter.%
+ \the\numexpr\expandafter\XINT_binom_div\the\numexpr #2\expandafter
+ !\romannumeral0\XINT_binom_mul #1!%
+}%
+\def\XINT_binom_vsmallloop #1.#2.#3.%
+{%
+ \ifcase\numexpr #3-#2\relax
+ \expandafter\XINT_binom_vsmallend_
+ \or \expandafter\XINT_binom_vsmallend_i
+ \or \expandafter\XINT_binom_vsmallend_ii
+ \or \expandafter\XINT_binom_vsmallend_iii
+ \else\expandafter\XINT_binom_vsmallloop_a
+ \fi #1.#2.#3.%
+}%
+\def\XINT_binom_vsmallloop_a #1.%
+{%
+ \ifnum #1>26 \expandafter\XINT_binom_smallloop_a \else
+ \expandafter\XINT_binom_vsmallloop_b \fi #1.%
+}%
+\def\XINT_binom_vsmallloop_b #1.#2.#3.%
+{%
+ \expandafter\XINT_binom_vsmallloop
+ \the\numexpr #1+\xint_c_iv\expandafter.%
+ \the\numexpr #2+\xint_c_iv\expandafter.%
+ \the\numexpr #3\expandafter.%
+ \the\numexpr \expandafter\XINT_binom_vsmallmuldiv
+ \the\numexpr #2*(#2+\xint_c_i)*(#2+\xint_c_ii)*(#2+\xint_c_iii)\expandafter
+ !\the\numexpr #1*(#1+\xint_c_i)*(#1+\xint_c_ii)*(#1+\xint_c_iii)!%
+}%
+\def\XINT_binom_mul #1!#21!\Z!0!%
+{%
+ \expandafter\XINT_rev_nounsep\expandafter{\expandafter}%
+ \the\numexpr\expandafter\XINT_smallmul
+ \the\numexpr\xint_c_x^viii+#1\expandafter
+ !\romannumeral0\XINT_rev_nounsep {}1\Z!#2%
+ \R!\R!\R!\R!\R!\R!\R!\R!\W
+ \R!\R!\R!\R!\R!\R!\R!\R!\W
+ 1\Z!%
+}%
+\def\XINT_binom_div #1!1\Z!%
+{%
+ \expandafter\XINT_smalldivx_a
+ \the\numexpr #1/\xint_c_ii\expandafter.%
+ \the\numexpr \xint_c_x^viii+#1!%
+}%
+\def\XINT_binom_vsmallmuldiv #1!#2!1#3!{\xint_c_x^viii+#2*#3/#1!}%
+\def\XINT_binom_end_iii #1.#2.#3.%
+{%
+ \expandafter\XINT_binom_finish
+ \the\numexpr\expandafter\XINT_binom_div
+ \the\numexpr #2*(#2+\xint_c_i)*(#2+\xint_c_ii)*(#2+\xint_c_iii)\expandafter
+ !\romannumeral0\expandafter\XINT_binom_mul
+ \the\numexpr #1*(#1+\xint_c_i)*(#1+\xint_c_ii)*(#1+\xint_c_iii)!%
+}%
+\def\XINT_binom_end_ii #1.#2.#3.%
+{%
+ \expandafter\XINT_binom_finish
+ \the\numexpr\expandafter\XINT_binom_div
+ \the\numexpr #2*(#2+\xint_c_i)*(#2+\xint_c_ii)\expandafter
+ !\romannumeral0\expandafter\XINT_binom_mul
+ \the\numexpr #1*(#1+\xint_c_i)*(#1+\xint_c_ii)!%
+}%
+\def\XINT_binom_end_i #1.#2.#3.%
+{%
+ \expandafter\XINT_binom_finish
+ \the\numexpr\expandafter\XINT_binom_div
+ \the\numexpr #2*(#2+\xint_c_i)\expandafter
+ !\romannumeral0\expandafter\XINT_binom_mul
+ \the\numexpr #1*(#1+\xint_c_i)!%
+}%
+\def\XINT_binom_end_ #1.#2.#3.%
+{%
+ \expandafter\XINT_binom_finish
+ \the\numexpr\expandafter\XINT_binom_div\the\numexpr #2\expandafter
+ !\romannumeral0\XINT_binom_mul #1!%
+}%
+\def\XINT_binom_finish #1\Z!0!%
+ {\XINT_unsep_cuzsmall #11\R!1\R!1\R!1\R!1\R!1\R!1\R!1\R!\W }%
+\def\XINT_binom_vsmallend_iii #1.%
+{%
+ \ifnum #1>26 \expandafter\XINT_binom_end_iii \else
+ \expandafter\XINT_binom_vsmallend_iiib \fi #1.%
+}%
+\def\XINT_binom_vsmallend_iiib #1.#2.#3.%
+{%
+ \expandafter\XINT_binom_vsmallfinish
+ \the\numexpr \expandafter\XINT_binom_vsmallmuldiv
+ \the\numexpr #2*(#2+\xint_c_i)*(#2+\xint_c_ii)*(#2+\xint_c_iii)\expandafter
+ !\the\numexpr #1*(#1+\xint_c_i)*(#1+\xint_c_ii)*(#1+\xint_c_iii)!%
+}%
+\def\XINT_binom_vsmallend_ii #1.%
+{%
+ \ifnum #1>27 \expandafter\XINT_binom_end_ii \else
+ \expandafter\XINT_binom_vsmallend_iib \fi #1.%
+}%
+\def\XINT_binom_vsmallend_iib #1.#2.#3.%
+{%
+ \expandafter\XINT_binom_vsmallfinish
+ \the\numexpr \expandafter\XINT_binom_vsmallmuldiv
+ \the\numexpr #2*(#2+\xint_c_i)*(#2+\xint_c_ii)\expandafter
+ !\the\numexpr #1*(#1+\xint_c_i)*(#1+\xint_c_ii)!%
+}%
+\def\XINT_binom_vsmallend_i #1.%
+{%
+ \ifnum #1>28 \expandafter\XINT_binom_end_i \else
+ \expandafter\XINT_binom_vsmallend_ib \fi #1.%
+}%
+\def\XINT_binom_vsmallend_ib #1.#2.#3.%
+{%
+ \expandafter\XINT_binom_vsmallfinish
+ \the\numexpr \expandafter\XINT_binom_vsmallmuldiv
+ \the\numexpr #2*(#2+\xint_c_i)\expandafter
+ !\the\numexpr #1*(#1+\xint_c_i)!%
+}%
+\def\XINT_binom_vsmallend_ #1.%
+{%
+ \ifnum #1>29 \expandafter\XINT_binom_end_ \else
+ \expandafter\XINT_binom_vsmallend_b \fi #1.%
+}%
+\def\XINT_binom_vsmallend_b #1.#2.#3.%
+{%
+ \expandafter\XINT_binom_vsmallfinish
+ \the\numexpr\XINT_binom_vsmallmuldiv #2!#1!%
+}%
+\edef\XINT_binom_vsmallfinish 1#1!1!\Z!0!%
+ {\noexpand\expandafter\space\noexpand\the\numexpr #1\relax}%
+\def\xintiiPFactorial {\romannumeral0\xintiipfactorial }%
+\def\xintiipfactorial #1#2%
+{%
+ \expandafter\XINT_pfac_fork\the\numexpr#1\expandafter.\the\numexpr #2.%
+}%
+\def\xintiPFactorial{\romannumeral0\xintipfactorial}%
+\let\xintipfactorial\xintiipfactorial
+\def\XINT_pfac_fork #1#2.#3.%
+{%
+ \if-#1\xint_dothis {\xintError:OutOfRangePFac\space 0}\fi
+ \ifnum #1#2=#3 \xint_dothis{ 1}\fi
+ \ifnum #1#2>#3 \xint_dothis{\xintError:OutOfRangePFac\space 0}\fi
+ \ifnum #3>\xint_c_x^viii_mone\xint_dothis{\xintError:OutOfRangePFac\space 0}\fi
+ \xint_orthat {\XINT_pfac_a #1#2.#3.}%
+}%
+\def\XINT_pfac_a #1.#2.%
+{%
+ \expandafter\XINT_pfac_b\the\numexpr \xint_c_i+#1.#2.100000001!1\Z!%
+ 1\R!1\R!1\R!1\R!1\R!1\R!1\R!1\R!\W
+}%
+\def\XINT_pfac_b #1.%
+{%
+ \ifnum #1>9999 \xint_dothis\XINT_pfac_vbigloop \fi
+ \ifnum #1>463 \xint_dothis\XINT_pfac_bigloop \fi
+ \ifnum #1>98 \xint_dothis\XINT_pfac_medloop \fi
+ \xint_orthat\XINT_pfac_smallloop #1.%
+}%
+\def\XINT_pfac_smallloop #1.#2.%
+{%
+ \ifcase\numexpr #2-#1\relax
+ \expandafter\XINT_pfac_end_
+ \or \expandafter\XINT_pfac_end_i
+ \or \expandafter\XINT_pfac_end_ii
+ \or \expandafter\XINT_pfac_end_iii
+ \else\expandafter\XINT_pfac_smallloop_a
+ \fi #1.#2.%
+}%
+\def\XINT_pfac_smallloop_a #1.#2.%
+{%
+ \expandafter\XINT_pfac_smallloop_b
+ \the\numexpr #1+\xint_c_iv\expandafter.%
+ \the\numexpr #2\expandafter.%
+ \the\numexpr\expandafter\XINT_smallmul
+ \the\numexpr \xint_c_x^viii+#1*(#1+\xint_c_i)*(#1+\xint_c_ii)*(#1+\xint_c_iii)!%
+}%
+\def\XINT_pfac_smallloop_b #1.%
+{%
+ \ifnum #1>98 \expandafter\XINT_pfac_medloop \else
+ \expandafter\XINT_pfac_smallloop \fi #1.%
+}%
+\def\XINT_pfac_medloop #1.#2.%
+{%
+ \ifcase\numexpr #2-#1\relax
+ \expandafter\XINT_pfac_end_
+ \or \expandafter\XINT_pfac_end_i
+ \or \expandafter\XINT_pfac_end_ii
+ \else\expandafter\XINT_pfac_medloop_a
+ \fi #1.#2.%
+}%
+\def\XINT_pfac_medloop_a #1.#2.%
+{%
+ \expandafter\XINT_pfac_medloop_b
+ \the\numexpr #1+\xint_c_iii\expandafter.%
+ \the\numexpr #2\expandafter.%
+ \the\numexpr\expandafter\XINT_smallmul
+ \the\numexpr \xint_c_x^viii+#1*(#1+\xint_c_i)*(#1+\xint_c_ii)!%
+}%
+\def\XINT_pfac_medloop_b #1.%
+{%
+ \ifnum #1>463 \expandafter\XINT_pfac_bigloop \else
+ \expandafter\XINT_pfac_medloop \fi #1.%
+}%
+\def\XINT_pfac_bigloop #1.#2.%
+{%
+ \ifcase\numexpr #2-#1\relax
+ \expandafter\XINT_pfac_end_
+ \or \expandafter\XINT_pfac_end_i
+ \else\expandafter\XINT_pfac_bigloop_a
+ \fi #1.#2.%
+}%
+\def\XINT_pfac_bigloop_a #1.#2.%
+{%
+ \expandafter\XINT_pfac_bigloop_b
+ \the\numexpr #1+\xint_c_ii\expandafter.%
+ \the\numexpr #2\expandafter.%
+ \the\numexpr\expandafter
+ \XINT_smallmul\the\numexpr \xint_c_x^viii+#1*(#1+\xint_c_i)!%
+}%
+\def\XINT_pfac_bigloop_b #1.%
+{%
+ \ifnum #1>9999 \expandafter\XINT_pfac_vbigloop \else
+ \expandafter\XINT_pfac_bigloop \fi #1.%
+}%
+\def\XINT_pfac_vbigloop #1.#2.%
+{%
+ \ifnum #2=#1
+ \expandafter\XINT_pfac_end_
+ \else\expandafter\XINT_pfac_vbigloop_a
+ \fi #1.#2.%
+}%
+\def\XINT_pfac_vbigloop_a #1.#2.%
+{%
+ \expandafter\XINT_pfac_vbigloop
+ \the\numexpr #1+\xint_c_i\expandafter.%
+ \the\numexpr #2\expandafter.%
+ \the\numexpr\expandafter\XINT_smallmul\the\numexpr\xint_c_x^viii+#1!%
+}%
+\def\XINT_pfac_end_iii #1.#2.%
+{%
+ \expandafter\XINT_mul_out
+ \the\numexpr\expandafter\XINT_smallmul
+ \the\numexpr \xint_c_x^viii+#1*(#1+\xint_c_i)*(#1+\xint_c_ii)*(#1+\xint_c_iii)!%
+}%
+\def\XINT_pfac_end_ii #1.#2.%
+{%
+ \expandafter\XINT_mul_out
+ \the\numexpr\expandafter\XINT_smallmul
+ \the\numexpr \xint_c_x^viii+#1*(#1+\xint_c_i)*(#1+\xint_c_ii)!%
+}%
+\def\XINT_pfac_end_i #1.#2.%
{%
- \expandafter\XINT_sqrt_big_l\expandafter
- {\romannumeral0\xintiisub {#3}{#1}}%
- {\romannumeral0\xintiiadd {#2}{\xintiiSqr {#1}}}%
+ \expandafter\XINT_mul_out
+ \the\numexpr\expandafter\XINT_smallmul
+ \the\numexpr \xint_c_x^viii+#1*(#1+\xint_c_i)!%
}%
-\def\XINT_sqrt_big_l #1#2%
+\def\XINT_pfac_end_ #1.#2.%
{%
- \expandafter\XINT_sqrt_big_g\expandafter
- {#2}{#1}%
+ \expandafter\XINT_mul_out
+ \the\numexpr\expandafter\XINT_smallmul\the\numexpr \xint_c_x^viii+#1!%
}%
-\def\XINT_sqrt_big_end #1#2#3#4{ {#3}{#2}}%
\def\xintiiE {\romannumeral0\xintiie }% used in \xintMod.
\def\xintiie #1#2%
{\expandafter\XINT_iie\the\numexpr #2\expandafter.\expandafter{\romannumeral`&&@#1}}%
diff --git a/Master/texmf-dist/tex/generic/xint/xintbinhex.sty b/Master/texmf-dist/tex/generic/xint/xintbinhex.sty
index b06dd6b8443..061e629acca 100644
--- a/Master/texmf-dist/tex/generic/xint/xintbinhex.sty
+++ b/Master/texmf-dist/tex/generic/xint/xintbinhex.sty
@@ -21,8 +21,8 @@
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%% ---------------------------------------------------------------
-%% The xint bundle v1.2e 2015/11/22
-%% Copyright (C) 2013-2015 by Jean-Francois Burnol
+%% The xint bundle 1.2f 2016/03/12
+%% Copyright (C) 2013-2016 by Jean-Francois Burnol
%% xintbinhex: Expandable binary and hexadecimal conversions
%% ---------------------------------------------------------------
\begingroup\catcode61\catcode48\catcode32=10\relax%
@@ -70,7 +70,7 @@
\XINTsetupcatcodes% defined in xintkernel.sty
\XINT_providespackage
\ProvidesPackage{xintbinhex}%
- [2015/11/22 v1.2e Expandable binary and hexadecimal conversions (jfB)]%
+ [2016/03/12 1.2f Expandable binary and hexadecimal conversions (JFB)]%
\newcount\xint_c_ii^xv \xint_c_ii^xv 32768
\newcount\xint_c_ii^xvi \xint_c_ii^xvi 65536
\newcount\xint_c_x^v \xint_c_x^v 100000
diff --git a/Master/texmf-dist/tex/generic/xint/xintcfrac.sty b/Master/texmf-dist/tex/generic/xint/xintcfrac.sty
index c2ee3e85658..6f516f56bfb 100644
--- a/Master/texmf-dist/tex/generic/xint/xintcfrac.sty
+++ b/Master/texmf-dist/tex/generic/xint/xintcfrac.sty
@@ -21,8 +21,8 @@
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%% ---------------------------------------------------------------
-%% The xint bundle v1.2e 2015/11/22
-%% Copyright (C) 2013-2015 by Jean-Francois Burnol
+%% The xint bundle 1.2f 2016/03/12
+%% Copyright (C) 2013-2016 by Jean-Francois Burnol
%% xintcfrac: Expandable continued fractions with xint package
%% ---------------------------------------------------------------
\begingroup\catcode61\catcode48\catcode32=10\relax%
@@ -70,7 +70,7 @@
\XINTsetupcatcodes% defined in xintkernel.sty
\XINT_providespackage
\ProvidesPackage{xintcfrac}%
- [2015/11/22 v1.2e Expandable continued fractions with xint package (jfB)]%
+ [2016/03/12 1.2f Expandable continued fractions with xint package (JFB)]%
\def\xintCFrac {\romannumeral0\xintcfrac }%
\def\xintcfrac #1%
{%
diff --git a/Master/texmf-dist/tex/generic/xint/xintcore.sty b/Master/texmf-dist/tex/generic/xint/xintcore.sty
index 94980e62be4..5088cdefa12 100644
--- a/Master/texmf-dist/tex/generic/xint/xintcore.sty
+++ b/Master/texmf-dist/tex/generic/xint/xintcore.sty
@@ -21,8 +21,8 @@
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%% ---------------------------------------------------------------
-%% The xint bundle v1.2e 2015/11/22
-%% Copyright (C) 2013-2015 by Jean-Francois Burnol
+%% The xint bundle 1.2f 2016/03/12
+%% Copyright (C) 2013-2016 by Jean-Francois Burnol
%% xintcore: Expandable arithmetic on big integers
%% ---------------------------------------------------------------
\begingroup\catcode61\catcode48\catcode32=10\relax%
@@ -70,7 +70,7 @@
\XINTsetupcatcodes% defined in xintkernel.sty
\XINT_providespackage
\ProvidesPackage{xintcore}%
- [2015/11/22 v1.2e Expandable arithmetic on big integers (jfB)]%
+ [2016/03/12 1.2f Expandable arithmetic on big integers (JFB)]%
\ifdefined\m@ne\let\xint_c_mone\m@ne
\else\csname newcount\endcsname\xint_c_mone \xint_c_mone -1 \fi
\newcount\xint_c_x^viii \xint_c_x^viii 100000000
@@ -122,28 +122,26 @@
{%
\noexpand\expandafter\space\noexpand\the\numexpr #1#2#3#4#5#6#7#8\relax
}%
-%%%%%%%%%%%%
\def\XINT_cuz #1#2#3#4#5#6#7#8#9%
{%
\xint_gob_til_R #9\XINT_cuz_e \R
\xint_gob_til_eightzeroes #1#2#3#4#5#6#7#8\XINT_cuz_z 00000000%
- \XINT_cuz_clean #1#2#3#4#5#6#7#8#9%
+ \XINT_cuz_done #1#2#3#4#5#6#7#8#9%
}%
-\edef\XINT_cuz_clean #1#2#3#4#5#6#7#8#9\R
+\def\XINT_cuz_z 00000000\XINT_cuz_done 00000000{\XINT_cuz }%
+\edef\XINT_cuz_done #1#2#3#4#5#6#7#8#9\R
{\noexpand\expandafter\space\noexpand\the\numexpr #1#2#3#4#5#6#7#8\relax #9}%
-\edef\XINT_cuz_e\R #1\XINT_cuz_clean #2\R
+\edef\XINT_cuz_e\R #1\XINT_cuz_done #2\R
{\noexpand\expandafter\space\noexpand\the\numexpr #2\relax }%
-\def\XINT_cuz_z 00000000\XINT_cuz_clean 00000000{\XINT_cuz }%
-%%%%%%%%%%%%
\def\XINT_cuz_byviii #1#2#3#4#5#6#7#8#9%
{%
\xint_gob_til_R #9\XINT_cuz_byviii_e \R
\xint_gob_til_eightzeroes #1#2#3#4#5#6#7#8\XINT_cuz_byviii_z 00000000%
- \XINT_cuz_byviii_clean #1#2#3#4#5#6#7#8#9%
+ \XINT_cuz_byviii_done #1#2#3#4#5#6#7#8#9%
}%
-\def\XINT_cuz_byviii_clean #1\R { #1}%
-\def\XINT_cuz_byviii_e\R #1\XINT_cuz_byviii_clean #2\R{ #2}%
-\def\XINT_cuz_byviii_z 00000000\XINT_cuz_byviii_clean 00000000{\XINT_cuz_byviii}%
+\def\XINT_cuz_byviii_z 00000000\XINT_cuz_byviii_done 00000000{\XINT_cuz_byviii}%
+\def\XINT_cuz_byviii_done #1\R { #1}%
+\def\XINT_cuz_byviii_e\R #1\XINT_cuz_byviii_done #2\R{ #2}%
\def\XINT_zeroes_forviii #1#2#3#4#5#6#7#8%
{%
\xint_gob_til_R #8\XINT_zeroes_forviii_end\R\XINT_zeroes_forviii
@@ -152,7 +150,6 @@
{%
\noexpand\expandafter\space\noexpand\xint_gob_til_one #2#3#4#5#6#7#8%
}%
-%%%%%%%%%%%%
\def\XINT_rsepbyviii #1#2#3#4#5#6#7#8%
{%
\XINT_rsepbyviii_b {#1#2#3#4#5#6#7#8}%
@@ -164,7 +161,6 @@
}%
\def\XINT_rsepbyviii_end_B #1\relax #2#3{#2.}%
\def\XINT_rsepbyviii_end_A #11#2\expandafter #3\relax #4#5{#2.1#5.}%
-%%%%%%%%%%%%
\def\XINT_sepandrev
{%
\expandafter\XINT_sepandrev_a\the\numexpr 1\XINT_rsepbyviii
@@ -177,7 +173,6 @@
}%
\def\XINT_sepandrev_end\R\XINT_sepandrev_b #1#2\W {\XINT_sepandrev_done #1}%
\def\XINT_sepandrev_done #11#2!{ }%
-%%%%%%%%%%%%
\def\XINT_sepandrev_andcount
{%
\expandafter\XINT_sepandrev_andcount_a\the\numexpr 1\XINT_rsepbyviii
@@ -220,13 +215,11 @@
{%
#2\expandafter!\the\numexpr#3\expandafter!\the\numexpr#4\expandafter
!\the\numexpr#5\expandafter!\the\numexpr#6\expandafter!\the\numexpr
- #7\expandafter
- !\the\numexpr#8\expandafter!\the\numexpr#9\expandafter!\the\numexpr
+ #7\expandafter!\the\numexpr#8\expandafter!\the\numexpr#9\expandafter!\the\numexpr
\expandafter\XINT_sepbyviii_andcount_b\the\numexpr #1+\xint_c_viii.%
}%
\def\XINT_sepbyviii_andcount_end #1\XINT_sepbyviii_andcount_b\the\numexpr
#2+\xint_c_viii.#3#4\W {\expandafter.\the\numexpr #2+#3.}%
-%%%%%%%%%%%%
\def\XINT_rev_nounsep #1#2!#3!#4!#5!#6!#7!#8!#9!%
{%
\xint_gob_til_R #9\XINT_rev_nounsep_end\R
@@ -234,13 +227,11 @@
}%
\def\XINT_rev_nounsep_end\R\XINT_rev_nounsep #1#2\W {\XINT_rev_nounsep_done #1}%
\def\XINT_rev_nounsep_done #11{ 1}%
-%%%%%%%%%%%%
\def\XINT_sepbyviii_Z #1#2#3#4#5#6#7#8%
{%
1#1#2#3#4#5#6#7#8\expandafter!\the\numexpr\XINT_sepbyviii_Z
}%
\def\XINT_sepbyviii_Z_end #1\relax {\relax\Z!}%
-%%%%%%%%%%%%
\def\XINT_unsep_cuzsmall #11#2!1#3!1#4!1#5!1#6!1#7!1#8!1#9!%
{%
\xint_gob_til_R #9\XINT_unsep_cuzsmall_end\R
@@ -250,7 +241,6 @@
\XINT_unsep_cuzsmall #1{\XINT_unsep_cuzsmall_done #1}%
\def\XINT_unsep_cuzsmall_done #1\R #2\W{\XINT_cuz_small #1}%
\def\XINT_unsep_delim {1\R!1\R!1\R!1\R!1\R!1\R!1\R!1\R!\W}%
-%%%%%%%%%%%%
\def\XINT_div_unsepQ #11#2!1#3!1#4!1#5!1#6!1#7!1#8!1#9!%
{%
\xint_gob_til_R #9\XINT_div_unsepQ_end\R
@@ -267,7 +257,6 @@
{\the\numexpr #1\relax \Z}%
\def\XINT_div_unsepQ_y #1.#2\R #3\W{\XINT_cuz_small #2\Z}%
\def\XINT_div_unsepQ_done #1.#2\R #3\W { #1#2\Z}%
-%%%%%%%%%%%%
\def\XINT_div_unsepR #11#2!1#3!1#4!1#5!1#6!1#7!1#8!1#9!%
{%
\xint_gob_til_R #9\XINT_div_unsepR_end\R
@@ -826,15 +815,24 @@
}%
\def\XINT_sub_l #1{\xint_UDzerofork #1\XINT_sub_l_carry 0\XINT_sub_l_nocarry\krof}%
\def\XINT_sub_l_nocarry 1{1\relax }%
-\def\XINT_sub_l_carry #1!{\expandafter\XINT_sub_m\the\numexpr 1#1-\xint_c_i!}%
-\def\XINT_sub_m 1#1{\xint_UDzerofork #1\XINT_sub_n_carry 0\XINT_sub_n_nocarry\krof}%
-\def\XINT_sub_n_carry #1!{1#1\expandafter!\the\numexpr\XINT_sub_l_carry }%
-\def\XINT_sub_n_nocarry #1!#2#3!%
+\def\XINT_sub_l_carry 1#1!{\ifcase #1
+ \expandafter \XINT_sub_l_zeroa\or\expandafter\XINT_sub_l_one\else
+ \expandafter \XINT_sub_l_done\fi 1#1!}%
+\def\XINT_sub_l_done {-\xint_c_i+}%
+\def\XINT_sub_l_one 1#1!#2%
{%
- \xint_gob_til_Z #2\xint_gob_til_eightzeroes #1\XINT_sub_n_zero
- 00000000\xint_gob_til_Z\Z 1\relax #1!#2#3!%
+ \xint_gob_til_Z #2\XINT_sub_l_oneone\Z 1\relax 00000000!#2%
}%
-\def\XINT_sub_n_zero 00000000\xint_gob_til_Z\Z 1\relax 00000000!{1!}%
+\def\XINT_sub_l_oneone #1\W {1\relax \XINT_cuz_byviii!\Z 0\W\R }%
+\def\XINT_sub_l_zeroa 1#1!{199999999\expandafter!\the\numexpr \XINT_sub_l_zerob }%
+\def\XINT_sub_l_zerob 1#1!{\ifcase #1
+ \expandafter \XINT_sub_l_zeroa\or\expandafter\XINT_sub_l_zone\else
+ \expandafter \XINT_sub_l_done\fi 1#1!}%
+\def\XINT_sub_l_zone 1#1!#2%
+{%
+ \xint_gob_til_Z #2\XINT_sub_l_zoneone\Z 1\relax 00000000!#2%
+}%
+\def\XINT_sub_l_zoneone\Z 1\relax 00000000{1}%
\def\XINT_sub_p\Z\XINT_sub_l #1#2\W
{%
\xint_UDzerofork
@@ -1085,62 +1083,55 @@
1\R!1\R!1\R!1\R!1\R!1\R!1\R!1\R!\W
}%
\def\xintiiPow {\romannumeral0\xintiipow }%
-\def\xintiipow #1%
+\def\xintiipow #1#2%
{%
- \expandafter\xint_pow\romannumeral`&&@#1\Z%
+ \expandafter\xint_pow\the\numexpr #2\expandafter.\romannumeral`&&@#1\Z%
}%
-\def\xintiPow {\romannumeral0\xintipow }%
-\def\xintipow #1%
+\def\xintiPow {\romannumeral0\xintipow }%
+\def\xintipow #1#2%
{%
- \expandafter\xint_pow\romannumeral0\xintnum{#1}\Z%
+ \expandafter\xint_pow\the\numexpr #2\expandafter.\romannumeral0\xintnum{#1}\Z%
}%
-\def\xint_pow #1#2\Z
+\def\xint_pow #1.#2%#3\Z
{%
- \xint_UDsignfork
- #1\XINT_pow_Aneg
- -\XINT_pow_Anonneg
- \krof
- #1{#2}%
+ \xint_UDzerominusfork
+ #2-\XINT_pow_AisZero
+ 0#2\XINT_pow_Aneg
+ 0-{\XINT_pow_Apos #2}%
+ \krof {#1}%
}%
-\def\XINT_pow_Aneg #1#2#3%
+\def\XINT_pow_AisZero #1#2\Z
{%
- \expandafter\XINT_pow_Aneg_\expandafter{\the\numexpr #3}#2\Z
+ \ifcase\XINT_cntSgn #1\Z
+ \xint_afterfi { 1}%
+ \or
+ \xint_afterfi { 0}%
+ \else
+ \xint_afterfi {\xintError:DivisionByZero\space 0}%
+ \fi
}%
-\def\XINT_pow_Aneg_ #1%
+\def\XINT_pow_Aneg #1%
{%
\ifodd #1
- \expandafter\XINT_pow_Aneg_Bodd
+ \expandafter\XINT_opp\romannumeral0%
\fi
- \XINT_pow_Anonneg_ {#1}%
-}%
-\def\XINT_pow_Aneg_Bodd #1%
-{%
- \expandafter\XINT_opp\romannumeral0\XINT_pow_Anonneg_
+ \XINT_pow_Apos {}{#1}%
}%
-\def\XINT_pow_Anonneg #1#2#3%
+\def\XINT_pow_Apos #1#2{\XINT_pow_Apos_a {#2}#1}%
+\def\XINT_pow_Apos_a #1#2#3%
{%
- \expandafter\XINT_pow_Anonneg_\expandafter {\the\numexpr #3}#1#2\Z
+ \xint_gob_til_Z #3\XINT_pow_Apos_short\Z
+ \XINT_pow_AatleastTwo {#1}#2#3%
}%
-\def\XINT_pow_Anonneg_ #1#2#3\Z
+\def\XINT_pow_Apos_short\Z\XINT_pow_AatleastTwo #1#2\Z
{%
- \if\relax #3\relax\xint_dothis
- {\ifcase #2 \expandafter\XINT_pow_AisZero
- \or\expandafter\XINT_pow_AisOne
- \else\expandafter\XINT_pow_AatleastTwo
- \fi }\fi
- \xint_orthat \XINT_pow_AatleastTwo {#1}{#2#3}%
-}%
-\def\XINT_pow_AisOne #1#2{ 1}%
-\def\XINT_pow_AisZero #1#2%
-{%
- \ifcase\XINT_cntSgn #1\Z
- \xint_afterfi { 1}%
- \or
- \xint_afterfi { 0}%
- \else
- \xint_afterfi {\xintError:DivisionByZero\space 0}%
- \fi
+ \ifcase #2
+ \xintError:thiscannothappen!
+ \or \expandafter\XINT_pow_AisOne
+ \else\expandafter\XINT_pow_AatleastTwo
+ \fi {#1}#2\Z
}%
+\def\XINT_pow_AisOne #1\Z{ 1}%
\def\XINT_pow_AatleastTwo #1%
{%
\ifcase\XINT_cntSgn #1\Z
@@ -1152,10 +1143,10 @@
\fi
{#1}%
}%
-\edef\XINT_pow_BisNegative #1#2%
+\edef\XINT_pow_BisNegative #1\Z
{\noexpand\xintError:FractionRoundedToZero\space 0}%
-\def\XINT_pow_BisZero #1#2{ 1}%
-\def\XINT_pow_I_in #1#2%
+\def\XINT_pow_BisZero #1\Z{ 1}%
+\def\XINT_pow_I_in #1#2\Z
{%
\expandafter\XINT_pow_I_loop
\the\numexpr #1\expandafter.%
@@ -1229,33 +1220,24 @@
\the\numexpr #1\expandafter.%
\the\numexpr\XINT_pow_mulbutcheckifsmall #3\W #3\W #2\W
}%
-\def\xintiFac {\romannumeral0\xintifac }%
-\def\xintifac #1%
-{%
- \expandafter\XINT_fac_fork\expandafter {\the\numexpr#1}%
-}%
\def\xintiiFac {\romannumeral0\xintiifac }%
-\def\xintiifac #1%
-{%
- \expandafter\XINT_fac_fork\expandafter {\romannumeral`&&@#1}%
-}%
-\let\xintFac\xintiFac \let\xintfac\xintifac
-\def\XINT_fac_fork #1%
+\def\xintiifac #1{\expandafter\XINT_fac_fork\the\numexpr#1.}%
+\def\xintiFac {\romannumeral0\xintifac }%
+\let\xintifac\xintiifac
+\def\XINT_fac_fork #1#2.%
{%
- \ifcase\XINT_cntSgn #1\Z
- \xint_afterfi{\expandafter\space\expandafter 1\xint_gobble_i }%
- \or
- \expandafter\XINT_fac_checksize
- \else
- \xint_afterfi{\expandafter\xintError:FactorialOfNegativeNumber
- \expandafter\space\expandafter 1\xint_gobble_i }%
- \fi
- {#1}%
+ \xint_UDzerominusfork
+ #1-\XINT_fac_zero
+ 0#1\XINT_fac_neg
+ 0-\XINT_fac_checksize
+ \krof #1#2.%
}%
-\def\XINT_fac_checksize #1%
+\def\XINT_fac_zero #1.{ 1}%
+\edef\XINT_fac_neg #1.{\noexpand\xintError:FactorialOfNegative\space 1}%
+\def\XINT_fac_checksize #1.%
{%
- \ifnum #1>9999
- \xint_dothis{\expandafter\xintError:FactorialOfTooBigNumber
+ \ifnum #1>\xint_c_x^iv
+ \xint_dothis{\expandafter\xintError:TooBigFactorial
\expandafter\space\expandafter 1\xint_gob_til_W }\fi
\ifnum #1>465 \xint_dothis{\XINT_fac_bigloop_a #1.}\fi
\ifnum #1>101 \xint_dothis{\XINT_fac_medloop_a #1.\XINT_mul_out}\fi
@@ -1401,7 +1383,6 @@
\expandafter\xint_exchangetwo_keepbraces
\expandafter{\romannumeral0\XINT_sub_mm_a {}{}#3\Z #2\Z}{#1}% r-> b-r
}%
-%%%%%%%%%%%%
\def\XINT_div_prepare #1%
{%
\XINT_div_prepare_a #1\R\R\R\R\R\R\R\R {10}0000001\W !{#1}%
@@ -1411,7 +1392,6 @@
\xint_gob_til_R #9\XINT_div_prepare_small\R
\XINT_div_prepare_b #9%
}%
-%%%%%%%%%%%%
\def\XINT_div_prepare_small\R #1!#2%
{%
\ifcase #2
@@ -1462,7 +1442,6 @@
{\the\numexpr #1\expandafter}\expandafter{\the\numexpr #3-#1*#2}}%
\def\XINT_div_dosmalldiv
{{\expandafter\XINT_sdiv_out\the\numexpr\XINT_smalldivx_a}}%
-%%%%%%%%%%%%
\def\XINT_div_prepare_b
{\expandafter\XINT_div_prepare_c\romannumeral0\XINT_zeroes_forviii }%
\def\XINT_div_prepare_c #1!%
@@ -1854,8 +1833,7 @@
{%
-\ifnum 0#1=\xint_c_ 1\else2\fi\relax
}%
-%%%%%%%%%%%%
-\def\XINT_sdiv_out #1\Z #2\W%
+\def\XINT_sdiv_out #1\Z!#2!%
{\expandafter
{\romannumeral0\XINT_unsep_cuzsmall#11\R!1\R!1\R!1\R!1\R!1\R!1\R!1\R!\W}%
{#2}}%
@@ -1864,22 +1842,22 @@
\expandafter\XINT_smalldivx_b
\the\numexpr (#3+#1)/#2-\xint_c_i!#1.#2!#3!%
}%
-\def\XINT_smalldivx_b #1!%
+\def\XINT_smalldivx_b #1#2!%
{%
\if0#1\else
- \xint_c_x^viii+#1\xint_afterfi{\expandafter!\the\numexpr}\fi
- \XINT_smalldiv_c #1!%
+ \xint_c_x^viii+#1#2\xint_afterfi{\expandafter!\the\numexpr}\fi
+ \XINT_smalldiv_c #1#2!%
}%
\def\XINT_smalldiv_c #1!#2.#3!#4!%
{%
\expandafter\XINT_smalldiv_d\the\numexpr #4-#1*#3!#2.#3!%
}%
-\def\XINT_smalldiv_d #1!#2!#3#4!%
+\def\XINT_smalldiv_d #1!#2!1#3#4!%
{%
- \xint_gob_til_Z #4\XINT_smalldiv_end \Z
- \XINT_smalldiv_e #1!#2!#3#4!%
+ \xint_gob_til_Z #3\XINT_smalldiv_end \Z
+ \XINT_smalldiv_e #1!#2!1#3#4!%
}%
-\def\XINT_smalldiv_end\Z\XINT_smalldiv_e #1!#2!1\Z!{1!\Z #1\W }%
+\def\XINT_smalldiv_end\Z\XINT_smalldiv_e #1!#2!1\Z!{1!\Z!#1!}%
\def\XINT_smalldiv_e #1!#2.#3!%
{%
\expandafter\XINT_smalldiv_f\the\numexpr
@@ -1899,18 +1877,15 @@
}%
\def\XINT_smalldiv_g 1#1!1#2!#3!#4!#5!#6!%
{%
- \expandafter\XINT_smalldiv_h
- \the\numexpr 1#6-#1.#2!#5!#3!#4!%
+ \expandafter\XINT_smalldiv_h\the\numexpr 1#6-#1.#2!#5!#3!#4!%
}%
\def\XINT_smalldiv_h 1#1#2.#3!#4!%
{%
- \expandafter\XINT_smalldiv_i
- \the\numexpr #4-#3+#1-\xint_c_i.#2!%
+ \expandafter\XINT_smalldiv_i\the\numexpr #4-#3+#1-\xint_c_i.#2!%
}%
\def\XINT_smalldiv_i #1.#2!#3!#4.#5!%
{%
- \expandafter\XINT_smalldiv_j
- \the\numexpr (#1#2+#4)/#5-\xint_c_i!#3!#1#2!#4.#5!%
+ \expandafter\XINT_smalldiv_j\the\numexpr (#1#2+#4)/#5-\xint_c_i!#3!#1#2!#4.#5!%
}%
\def\XINT_smalldiv_j #1!#2!%
{%
diff --git a/Master/texmf-dist/tex/generic/xint/xintexpr.sty b/Master/texmf-dist/tex/generic/xint/xintexpr.sty
index 5c2f726146b..ab7896f4fe0 100644
--- a/Master/texmf-dist/tex/generic/xint/xintexpr.sty
+++ b/Master/texmf-dist/tex/generic/xint/xintexpr.sty
@@ -21,8 +21,8 @@
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%% ---------------------------------------------------------------
-%% The xint bundle v1.2e 2015/11/22
-%% Copyright (C) 2013-2015 by Jean-Francois Burnol
+%% The xint bundle 1.2f 2016/03/12
+%% Copyright (C) 2013-2016 by Jean-Francois Burnol
%% xintexpr: Expandable expression parser
%% ---------------------------------------------------------------
\begingroup\catcode61\catcode48\catcode32=10\relax%
@@ -81,7 +81,7 @@
\XINTsetupcatcodes%
\XINT_providespackage
\ProvidesPackage{xintexpr}%
- [2015/11/22 v1.2e Expandable expression parser (jfB)]%
+ [2016/03/12 1.2f Expandable expression parser (JFB)]%
\catcode`! 11
\def\xint_gob_til_! #1!{}% catcode 11 ! default in xintexpr.sty code.
\edef\XINT_expr_lockscan#1!% not used for decimal numbers in xintexpr 1.2
@@ -98,7 +98,6 @@
[\the\numexpr-4*\xintLength{#3}]%
\fi
}%
-%%%%%%%%%%%%
\def\XINT_expr_unlock {\expandafter\XINT_expr_unlock_a\string }%
\def\XINT_expr_unlock_a #1.={}%
\def\XINT_expr_unexpectedtoken {\xintError:ignored }%
@@ -583,7 +582,7 @@
\def\XINT_expr_unknown_operator #1{\xintError:removed \xint_gobble_i {#1}}%
\def\XINT_expr_foundop #1{\csname XINT_expr_precedence_#1\endcsname #1}%
\catcode`) 11
-\def\XINT_tmpa #1#2#3#4% (avant #4#5)
+\def\XINT_tmpa #1#2#3#4%
{%
\def#1##1%
{%
@@ -660,7 +659,7 @@
\do {\expandafter\def\csname XINT_expr_itself_#1\endcsname {#1}}%
\catcode`& 7
\expandafter\let\csname XINT_expr_precedence_***\endcsname \xint_c_viii
-\def\XINT_tmpc #1#2#3#4#5#6#7#8%
+\def\XINT_expr_defbin_c #1#2#3#4#5#6#7#8%
{%
\def #1##1% \XINT_expr_op_<op> ou flexpr ou iiexpr
{% keep value, get next number and operator, then do until
@@ -672,7 +671,7 @@
\krof }%
\def #3##1##2##3##4% \XINT_expr_until_<op>_b ou flexpr ou iiexpr
{% either execute next operation now, or first do next (possibly unary)
- \ifnum ##2>#5%
+ \ifnum ##2>#7%
\xint_afterfi {\expandafter #2\expandafter ##1\romannumeral`&&@%
\csname XINT_#8_op_##3\endcsname {##4}}%
\else \xint_afterfi {\expandafter ##2\expandafter ##3%
@@ -680,80 +679,74 @@
\fi }%
\let #7#5%
}%
-\def\XINT_tmpb #1#2#3#4#5#6%
+\def\XINT_expr_defbin_b #1#2#3#4#5%
{%
- \expandafter\XINT_tmpc
- \csname XINT_#1_op_#3\expandafter\endcsname
- \csname XINT_#1_until_#3_a\expandafter\endcsname
- \csname XINT_#1_until_#3_b\expandafter\endcsname
- \csname XINT_#1_op_-#5\expandafter\endcsname
- \csname xint_c_#4\expandafter\endcsname
- \csname #2#6\expandafter\endcsname
- \csname XINT_expr_precedence_#3\endcsname {#1}%
-}%
-\catcode`& 12
-\xintFor #1 in {expr, flexpr} \do {%
- \def\XINT_tmpa ##1{\XINT_tmpb {#1}{xint}##1}%
- \xintApplyInline {\XINT_tmpa }{%
- {|{iii}{vi}{OR}}%
- {&{iv}{vi}{AND}}%
- {{xor}{iii}{vi}{XOR}}%
- {<{v}{vi}{Lt}}%
- {>{v}{vi}{Gt}}%
- {={v}{vi}{Eq}}%
- {{<=}{v}{vi}{LtorEq}}%
- {{>=}{v}{vi}{GtorEq}}%
- {{!=}{v}{vi}{Neq}}%
- {{..}{iii}{vi}{Seq::csv}}%
- {{//}{vii}{vii}{DivTrunc}}%
- {{/:}{vii}{vii}{Mod}}%
- }%
-}%
-\catcode`& 7
-\def\XINT_tmpa #1{\XINT_tmpb {expr}{xint}#1}%
-\xintApplyInline {\XINT_tmpa }{%
- {+{vi}{vi}{Add}}%
- {-{vi}{vi}{Sub}}%
- {*{vii}{vii}{Mul}}%
- {/{vii}{vii}{Div}}%
- {^{ix}{ix}{Pow}}%
- {{..[}{iii}{vi}{SeqA::csv}}%
- {{]..}{iii}{vi}{SeqB::csv}}%
-}%
-\def\XINT_tmpa #1{\XINT_tmpb {flexpr}{XINTinFloat}#1}%
-\xintApplyInline {\XINT_tmpa }{%
- {+{vi}{vi}{Add}}%
- {-{vi}{vi}{Sub}}%
- {*{vii}{vii}{Mul}}%
- {/{vii}{vii}{Div}}%
- {^{ix}{ix}{Power}}%
- {{..[}{iii}{vi}{SeqA::csv}}%
- {{]..}{iii}{vi}{SeqB::csv}}%
-}%
-\def\XINT_tmpa #1{\XINT_tmpb {iiexpr}{xint}#1}%
-\catcode`& 12
-\xintApplyInline {\XINT_tmpa }{%
- {|{iii}{vi}{OR}}%
- {&{iv}{vi}{AND}}%
- {{xor}{iii}{vi}{XOR}}%
- {<{v}{vi}{iiLt}}%
- {>{v}{vi}{iiGt}}%
- {={v}{vi}{iiEq}}%
- {{<=}{v}{vi}{iiLtorEq}}%
- {{>=}{v}{vi}{iiGtorEq}}%
- {{!=}{v}{vi}{iiNeq}}%
- {+{vi}{vi}{iiAdd}}%
- {-{vi}{vi}{iiSub}}%
- {*{vii}{vii}{iiMul}}%
- {/{vii}{vii}{iiDivRound}}% CHANGED IN 1.1! PREVIOUSLY DID EUCLIDEAN QUOTIENT
- {^{ix}{ix}{iiPow}}%
- {{..[}{iii}{vi}{iiSeqA::csv}}%
- {{]..}{iii}{vi}{iiSeqB::csv}}%
- {{..}{iii}{vi}{iiSeq::csv}}%
- {{//}{vii}{vii}{iiDivTrunc}}%
- {{/:}{vii}{vii}{iiMod}}%
+ \expandafter\XINT_expr_defbin_c
+ \csname XINT_#1_op_#2\expandafter\endcsname
+ \csname XINT_#1_until_#2_a\expandafter\endcsname
+ \csname XINT_#1_until_#2_b\expandafter\endcsname
+ \csname XINT_#1_op_-#4\expandafter\endcsname
+ \csname xint_c_#3\expandafter\endcsname
+ \csname #5\expandafter\endcsname
+ \csname XINT_expr_precedence_#2\endcsname {#1}%
}%
-\catcode`& 7
+\XINT_expr_defbin_b {expr} | {iii}{vi} {xintOR}%
+\XINT_expr_defbin_b {flexpr} | {iii}{vi} {xintOR}%
+\XINT_expr_defbin_b {iiexpr} | {iii}{vi} {xintOR}%
+\XINT_expr_defbin_b {expr} & {iv}{vi} {xintAND}%
+\XINT_expr_defbin_b {flexpr} & {iv}{vi} {xintAND}%
+\XINT_expr_defbin_b {iiexpr} & {iv}{vi} {xintAND}%
+\XINT_expr_defbin_b {expr} {xor}{iii}{vi} {xintXOR}%
+\XINT_expr_defbin_b {flexpr}{xor}{iii}{vi} {xintXOR}%
+\XINT_expr_defbin_b {iiexpr}{xor}{iii}{vi} {xintXOR}%
+\XINT_expr_defbin_b {expr} < {v}{vi} {xintLt}%
+\XINT_expr_defbin_b {flexpr} < {v}{vi} {xintLt}%
+\XINT_expr_defbin_b {iiexpr} < {v}{vi} {xintiiLt}%
+\XINT_expr_defbin_b {expr} > {v}{vi} {xintGt}%
+\XINT_expr_defbin_b {flexpr} > {v}{vi} {xintGt}%
+\XINT_expr_defbin_b {iiexpr} > {v}{vi} {xintiiGt}%
+\XINT_expr_defbin_b {expr} = {v}{vi} {xintEq}%
+\XINT_expr_defbin_b {flexpr} = {v}{vi} {xintEq}%
+\XINT_expr_defbin_b {iiexpr} = {v}{vi} {xintiiEq}%
+\XINT_expr_defbin_b {expr} {<=} {v}{vi} {xintLtorEq}%
+\XINT_expr_defbin_b {flexpr}{<=} {v}{vi} {xintLtorEq}%
+\XINT_expr_defbin_b {iiexpr}{<=} {v}{vi} {xintiiLtorEq}%
+\XINT_expr_defbin_b {expr} {>=} {v}{vi} {xintGtorEq}%
+\XINT_expr_defbin_b {flexpr}{>=} {v}{vi} {xintGtorEq}%
+\XINT_expr_defbin_b {iiexpr}{>=} {v}{vi} {xintiiGtorEq}%
+\XINT_expr_defbin_b {expr} {!=} {v}{vi} {xintNeq}%
+\XINT_expr_defbin_b {flexpr}{!=} {v}{vi} {xintNeq}%
+\XINT_expr_defbin_b {iiexpr}{!=} {v}{vi} {xintiiNeq}%
+\XINT_expr_defbin_b {expr} {..} {iii}{vi} {xintSeq::csv}%
+\XINT_expr_defbin_b {flexpr}{..} {iii}{vi} {xintSeq::csv}%
+\XINT_expr_defbin_b {iiexpr}{..} {iii}{vi} {xintiiSeq::csv}%
+\XINT_expr_defbin_b {expr} {//} {vii}{vii}{xintDivTrunc}%
+\XINT_expr_defbin_b {flexpr}{//} {vii}{vii}{xintDivTrunc}%
+\XINT_expr_defbin_b {iiexpr}{//} {vii}{vii}{xintiiDivTrunc}%
+\XINT_expr_defbin_b {expr} {/:} {vii}{vii}{xintMod}%
+\XINT_expr_defbin_b {flexpr}{/:} {vii}{vii}{xintMod}%
+\XINT_expr_defbin_b {iiexpr}{/:} {vii}{vii}{xintiiMod}%
+\XINT_expr_defbin_b {expr} + {vi}{vi} {xintAdd}%
+\XINT_expr_defbin_b {flexpr} + {vi}{vi} {XINTinFloatAdd}%
+\XINT_expr_defbin_b {iiexpr} + {vi}{vi} {xintiiAdd}%
+\XINT_expr_defbin_b {expr} - {vi}{vi} {xintSub}%
+\XINT_expr_defbin_b {flexpr} - {vi}{vi} {XINTinFloatSub}%
+\XINT_expr_defbin_b {iiexpr} - {vi}{vi} {xintiiSub}%
+\XINT_expr_defbin_b {expr} * {vii}{vii}{xintMul}%
+\XINT_expr_defbin_b {flexpr} * {vii}{vii}{XINTinFloatMul}%
+\XINT_expr_defbin_b {iiexpr} * {vii}{vii}{xintiiMul}%
+\XINT_expr_defbin_b {expr} / {vii}{vii}{xintDiv}%
+\XINT_expr_defbin_b {flexpr} / {vii}{vii}{XINTinFloatDiv}%
+\XINT_expr_defbin_b {iiexpr} / {vii}{vii}{xintiiDivRound}% CHANGED IN 1.1!
+\XINT_expr_defbin_b {expr} ^ {ix}{ix} {xintPow}%
+\XINT_expr_defbin_b {flexpr} ^ {ix}{ix} {XINTinFloatPowerH}%
+\XINT_expr_defbin_b {iiexpr} ^ {ix}{ix} {xintiiPow}%
+\XINT_expr_defbin_b {expr} {..[}{iii}{vi} {xintSeqA::csv}%
+\XINT_expr_defbin_b {flexpr}{..[}{iii}{vi} {XINTinFloatSeqA::csv}%
+\XINT_expr_defbin_b {iiexpr}{..[}{iii}{vi} {xintiiSeqA::csv}%
+\XINT_expr_defbin_b {expr} {]..}{iii}{vi} {xintSeqB::csv}%
+\XINT_expr_defbin_b {flexpr}{]..}{iii}{vi} {XINTinFloatSeqB::csv}%
+\XINT_expr_defbin_b {iiexpr}{]..}{iii}{vi} {xintiiSeqB::csv}%
\def\XINT_expr_binop_inline_a
{\expandafter\xint_gobble_i\romannumeral`&&@\XINT_expr_binop_inline_b }%
\def\XINT_expr_binop_inline_b #1#2,{\XINT_expr_binop_inline_c #2,{#1}}%
@@ -764,7 +757,7 @@
\def\XINT_expr_binop_inline_d #1,#2{,#2{#1}\XINT_expr_binop_inline_b {#2}}%
\def\XINT_expr_binop_inline_e #1,#2{,\XINT_expr_binop_inline_b {#2}}%
\def\XINT_expr_binop_inline_end #1,#2{}%
-\def\XINT_tmpc #1#2#3#4#5#6#7#8%
+\def\XINT_expr_deflistopr_c #1#2#3#4#5#6#7#8%
{%
\def #1##1% \XINT_expr_op_<op> ou flexpr ou iiexpr
{% keep value, get next number and operator, then do until
@@ -776,7 +769,7 @@
\krof }%
\def #3##1##2##3##4% \XINT_expr_until_<op>_b ou flexpr ou iiexpr
{% either execute next operation now, or first do next (possibly unary)
- \ifnum ##2>#5%
+ \ifnum ##2>#7%
\xint_afterfi {\expandafter #2\expandafter ##1\romannumeral`&&@%
\csname XINT_#8_op_##3\endcsname {##4}}%
\else \xint_afterfi {\expandafter ##2\expandafter ##3%
@@ -788,9 +781,9 @@
\fi }%
\let #7#5%
}%
-\def\XINT_tmpb #1#2#3#4%
+\def\XINT_expr_deflistopr_b #1#2#3#4%
{%
- \expandafter\XINT_tmpc
+ \expandafter\XINT_expr_deflistopr_c
\csname XINT_#1_op_#2\expandafter\endcsname
\csname XINT_#1_until_#2_a\expandafter\endcsname
\csname XINT_#1_until_#2_b\expandafter\endcsname
@@ -799,30 +792,28 @@
\csname #4\expandafter\endcsname
\csname XINT_expr_precedence_#2\endcsname {#1}%
}%
-\xintApplyInline {\expandafter\XINT_tmpb \xint_firstofone}{%
- {{expr}{a+}{vi}{xintAdd}}%
- {{expr}{a-}{vi}{xintSub}}%
- {{expr}{a*}{vii}{xintMul}}%
- {{expr}{a/}{vii}{xintDiv}}%
- {{expr}{a^}{ix}{xintPow}}%
- {{iiexpr}{a+}{vi}{xintiiAdd}}%
- {{iiexpr}{a-}{vi}{xintiiSub}}%
- {{iiexpr}{a*}{vii}{xintiiMul}}%
- {{iiexpr}{a/}{vii}{xintiiDivRound}}%
- {{iiexpr}{a^}{ix}{xintiiPow}}%
- {{flexpr}{a+}{vi}{XINTinFloatAdd}}%
- {{flexpr}{a-}{vi}{XINTinFloatSub}}%
- {{flexpr}{a*}{vii}{XINTinFloatMul}}%
- {{flexpr}{a/}{vii}{XINTinFloatDiv}}%
- {{flexpr}{a^}{ix}{XINTinFloatPower}}%
-}%
-\def\XINT_tmpc #1#2#3#4#5#6#7%
+\XINT_expr_deflistopr_b {expr} {a+}{vi} {xintAdd}%
+\XINT_expr_deflistopr_b {expr} {a-}{vi} {xintSub}%
+\XINT_expr_deflistopr_b {expr} {a*}{vii}{xintMul}%
+\XINT_expr_deflistopr_b {expr} {a/}{vii}{xintDiv}%
+\XINT_expr_deflistopr_b {expr} {a^}{ix} {xintPow}%
+\XINT_expr_deflistopr_b {iiexpr}{a+}{vi} {xintiiAdd}%
+\XINT_expr_deflistopr_b {iiexpr}{a-}{vi} {xintiiSub}%
+\XINT_expr_deflistopr_b {iiexpr}{a*}{vii}{xintiiMul}%
+\XINT_expr_deflistopr_b {iiexpr}{a/}{vii}{xintiiDivRound}%
+\XINT_expr_deflistopr_b {iiexpr}{a^}{ix} {xintiiPow}%
+\XINT_expr_deflistopr_b {flexpr}{a+}{vi} {XINTinFloatAdd}%
+\XINT_expr_deflistopr_b {flexpr}{a-}{vi} {XINTinFloatSub}%
+\XINT_expr_deflistopr_b {flexpr}{a*}{vii}{XINTinFloatMul}%
+\XINT_expr_deflistopr_b {flexpr}{a/}{vii}{XINTinFloatDiv}%
+\XINT_expr_deflistopr_b {flexpr}{a^}{ix} {XINTinFloatPowerH}%
+\def\XINT_expr_deflistopl_c #1#2#3#4#5#6#7%
{%
\def #1##1{\expandafter#2\expandafter##1\romannumeral`&&@%
\expandafter #3\romannumeral`&&@\XINT_expr_getnext }%
\def #2##1##2##3##4%
{% either execute next operation now, or first do next (possibly unary)
- \ifnum ##2>#4%
+ \ifnum ##2>#6%
\xint_afterfi {\expandafter #2\expandafter ##1\romannumeral`&&@%
\csname XINT_#7_op_##3\endcsname {##4}}%
\else \xint_afterfi {\expandafter ##2\expandafter ##3%
@@ -833,9 +824,9 @@
\fi }%
\let #6#4%
}%
-\def\XINT_tmpb #1#2#3#4%
+\def\XINT_expr_deflistopl_b #1#2#3#4%
{%
- \expandafter\XINT_tmpc
+ \expandafter\XINT_expr_deflistopl_c
\csname XINT_#1_op_#2\expandafter\endcsname
\csname XINT_#1_until_#2\expandafter\endcsname
\csname XINT_#1_until_)_a\expandafter\endcsname
@@ -843,23 +834,21 @@
\csname #4\expandafter\endcsname
\csname XINT_expr_precedence_#2\endcsname {#1}%
}%
-\xintApplyInline {\expandafter\XINT_tmpb\xint_firstofone }{%
- {{expr}{+[}{vi}{xintAdd}}%
- {{expr}{-[}{vi}{xintSub}}%
- {{expr}{*[}{vii}{xintMul}}%
- {{expr}{/[}{vii}{xintDiv}}%
- {{expr}{^[}{ix}{xintPow}}%
- {{iiexpr}{+[}{vi}{xintiiAdd}}%
- {{iiexpr}{-[}{vi}{xintiiSub}}%
- {{iiexpr}{*[}{vii}{xintiiMul}}%
- {{iiexpr}{/[}{vii}{xintiiDivRound}}%
- {{iiexpr}{^[}{ix}{xintiiPow}}%
- {{flexpr}{+[}{vi}{XINTinFloatAdd}}%
- {{flexpr}{-[}{vi}{XINTinFloatSub}}%
- {{flexpr}{*[}{vii}{XINTinFloatMul}}%
- {{flexpr}{/[}{vii}{XINTinFloatDiv}}%
- {{flexpr}{^[}{ix}{XINTinFloatPower}}%
-}%
+\XINT_expr_deflistopl_b {expr} {+[}{vi} {xintAdd}%
+\XINT_expr_deflistopl_b {expr} {-[}{vi} {xintSub}%
+\XINT_expr_deflistopl_b {expr} {*[}{vii}{xintMul}%
+\XINT_expr_deflistopl_b {expr} {/[}{vii}{xintDiv}%
+\XINT_expr_deflistopl_b {expr} {^[}{ix} {xintPow}%
+\XINT_expr_deflistopl_b {iiexpr}{+[}{vi} {xintiiAdd}%
+\XINT_expr_deflistopl_b {iiexpr}{-[}{vi} {xintiiSub}%
+\XINT_expr_deflistopl_b {iiexpr}{*[}{vii}{xintiiMul}%
+\XINT_expr_deflistopl_b {iiexpr}{/[}{vii}{xintiiDivRound}%
+\XINT_expr_deflistopl_b {iiexpr}{^[}{ix} {xintiiPow}%
+\XINT_expr_deflistopl_b {flexpr}{+[}{vi} {XINTinFloatAdd}%
+\XINT_expr_deflistopl_b {flexpr}{-[}{vi} {XINTinFloatSub}%
+\XINT_expr_deflistopl_b {flexpr}{*[}{vii}{XINTinFloatMul}%
+\XINT_expr_deflistopl_b {flexpr}{/[}{vii}{XINTinFloatDiv}%
+\XINT_expr_deflistopl_b {flexpr}{^[}{ix} {XINTinFloatPowerH}%
\xintFor #1 in {and,or,xor,mod} \do {%
\expandafter\def\csname XINT_expr_itself_#1\endcsname {#1}}%
\expandafter\let\csname XINT_expr_precedence_and\expandafter\endcsname
@@ -915,7 +904,7 @@
\krof }%
\def #3##1##2##3##4% \XINT_expr_until_][_b
{%
- \ifnum ##2>\xint_c_ii
+ \ifnum ##2>#5%
\xint_afterfi {\expandafter #2\expandafter ##1\romannumeral`&&@%
\csname XINT_#6_op_##3\endcsname {##4}}%
\else
@@ -949,7 +938,7 @@
\krof }%
\def #3##1##2##3##4% \XINT_expr_until_:_b
{%
- \ifnum ##2>\xint_c_iii
+ \ifnum ##2>#5%
\xint_afterfi {\expandafter #2\expandafter ##1\romannumeral`&&@%
\csname XINT_#6_op_##3\endcsname {##4}}%
\else
@@ -1243,7 +1232,7 @@
}%
\let\XINT_expr_precedence_! \xint_c_x
\def\XINT_expr_op_! #1{\expandafter\XINT_expr_getop
- \csname .=\xintFac{\XINT_expr_unlock #1}\endcsname }%
+ \csname .=\xintiFac{\XINT_expr_unlock #1}\endcsname }%
\def\XINT_flexpr_op_! #1{\expandafter\XINT_expr_getop
\csname .=\XINTinFloatFac{\XINT_expr_unlock #1}\endcsname }%
\def\XINT_iiexpr_op_! #1{\expandafter\XINT_expr_getop
@@ -1435,7 +1424,7 @@
{\expandafter\XINT_expr_onlitteral_seq_f\romannumeral`&&@\XINT_expr_onlitteral_seq_a {}}%
\def\XINT_expr_onlitteral_seq_f #1#2{\xint_c_xviii `{seqx}#2)\relax #1}%
\def\XINT_expr_onlitteral_seq_a #1#2,%
-{% checks balancing of parentheses
+{%
\ifcase\XINT_isbalanced_a \relax #1#2(\xint_bye)\xint_bye
\expandafter\XINT_expr_onlitteral_seq_c
\or\expandafter\XINT_expr_onlitteral_seq_b
@@ -1807,8 +1796,9 @@
\expandafter\xint_firstofone\romannumeral`&&@#1,^,1}%
\def\xintiiLCMof:csv #1{\expandafter\XINT_oncsv:_a\expandafter\xintiilcm
\expandafter\xint_firstofone\romannumeral`&&@#1,^,0}%
-\def\XINTinFloatdigits {\XINTinFloat [\XINTdigits]}%
-\def\XINTinFloatSqrtdigits {\XINTinFloatSqrt [\XINTdigits]}%
+\def\XINTinFloatdigits {\XINTinFloat [\XINTdigits]}%
+\def\XINTinFloatSqrtdigits {\XINTinFloatSqrt[\XINTdigits]}%
+\def\XINTinFloatFacdigits {\XINTinFloatFac [\XINTdigits]}%
\def\XINTinFloatMaxof:csv #1{\expandafter\XINT_oncsv:_a\expandafter\xintmax
\expandafter\XINTinFloatdigits\romannumeral`&&@#1,^,{0[0]}}%
\def\XINTinFloatMinof:csv #1{\expandafter\XINT_oncsv:_a\expandafter\xintmin
@@ -1876,6 +1866,24 @@
\expandafter #1\expandafter #2\csname
.=\XINTinFloatMul{\XINT_expr_unlock #3}{\XINT_expr_unlock #3}\endcsname
}%
+\def\XINT_expr_func_factorial #1#2#3%
+{%
+ \expandafter #1\expandafter #2\csname .=%
+ \expandafter\XINT_expr_argandopt
+ \romannumeral`&&@\XINT_expr_unlock#3,,.\xintiFac\XINTinFloatFac
+ \endcsname
+}%
+\def\XINT_flexpr_func_factorial #1#2#3%
+{%
+ \expandafter #1\expandafter #2\csname .=%
+ \expandafter\XINT_expr_argandopt
+ \romannumeral`&&@\XINT_expr_unlock#3,,.\XINTinFloatFacdigits\XINTinFloatFac
+ \endcsname
+}%
+\def\XINT_iiexpr_func_factorial #1#2#3%
+{%
+ \expandafter #1\expandafter #2\csname.=\xintiiFac{\XINT_expr_unlock #3}\endcsname
+}%
\def\XINT_iiexpr_func_sqr #1#2#3%
{\expandafter #1\expandafter #2\csname.=\xintiiSqr {\XINT_expr_unlock #3}\endcsname }%
\def\XINT_expr_func_sqrt #1#2#3%
@@ -1947,6 +1955,48 @@
\expandafter\XINT_expr_twoargs
\romannumeral`&&@\XINT_expr_unlock #3,\endcsname
}%
+\def\XINT_expr_func_binomial #1#2#3%
+{%
+ \expandafter #1\expandafter #2\csname .=%
+ \expandafter\expandafter\expandafter\xintiBinomial
+ \expandafter\XINT_expr_twoargs
+ \romannumeral`&&@\XINT_expr_unlock #3,\endcsname
+}%
+\def\XINT_flexpr_func_binomial #1#2#3%
+{%
+ \expandafter #1\expandafter #2\csname .=%
+ \expandafter\expandafter\expandafter\XINTinFloatBinomial
+ \expandafter\XINT_expr_twoargs
+ \romannumeral`&&@\XINT_expr_unlock #3,\endcsname
+}%
+\def\XINT_iiexpr_func_binomial #1#2#3%
+{%
+ \expandafter #1\expandafter #2\csname .=%
+ \expandafter\expandafter\expandafter\xintiiBinomial
+ \expandafter\XINT_expr_twoargs
+ \romannumeral`&&@\XINT_expr_unlock #3,\endcsname
+}%
+\def\XINT_expr_func_pfactorial #1#2#3%
+{%
+ \expandafter #1\expandafter #2\csname .=%
+ \expandafter\expandafter\expandafter\xintiPFactorial
+ \expandafter\XINT_expr_twoargs
+ \romannumeral`&&@\XINT_expr_unlock #3,\endcsname
+}%
+\def\XINT_flexpr_func_pfactorial #1#2#3%
+{%
+ \expandafter #1\expandafter #2\csname .=%
+ \expandafter\expandafter\expandafter\XINTinFloatPFactorial
+ \expandafter\XINT_expr_twoargs
+ \romannumeral`&&@\XINT_expr_unlock #3,\endcsname
+}%
+\def\XINT_iiexpr_func_pfactorial #1#2#3%
+{%
+ \expandafter #1\expandafter #2\csname .=%
+ \expandafter\expandafter\expandafter\xintiiPFactorial
+ \expandafter\XINT_expr_twoargs
+ \romannumeral`&&@\XINT_expr_unlock #3,\endcsname
+}%
\def\XINT_expr_func_quo #1#2#3%
{%
\expandafter #1\expandafter #2\csname .=%
@@ -2195,7 +2245,7 @@
\edef\XINT_expr_tmpa {##1}%
\edef\XINT_expr_tmpa {\xint_zapspaces_o \XINT_expr_tmpa}%
\def\XINT_expr_tmpb {0}%
- \def\XINT_expr_tmpc {##4}%
+ \def\XINT_expr_tmpc {(##4)}%
\xintFor ####1 in {##2} \do
{\edef\XINT_expr_tmpb {\the\numexpr\XINT_expr_tmpb+\xint_c_i}%
\edef\XINT_expr_tmpc {subs(\unexpanded\expandafter{\XINT_expr_tmpc},%
@@ -2274,9 +2324,15 @@
\xint_orthat {\csname #4NE\endcsname #6}{#1#2}%
}%
\toks0 {}%
-\xintFor #1 in {DivTrunc,iiDivTrunc,iiDivRound,Mod,iiMod,iRound,Round,iTrunc,Trunc,%
- Lt,Gt,Eq,LtorEq,GtorEq,Neq,AND,OR,XOR,iQuo,iRem,Add,Sub,Mul,Div,Pow,E,%
- iiAdd,iiSub,iiMul,iiPow,iiQuo,iiRem,iiE,SeqA::csv,iiSeqA::csv}\do
+\xintFor #1 in
+ {DivTrunc,Mod,Round,Trunc,iRound,iTrunc,iQuo,iRem,
+ iiDivTrunc,iiDivRound,iiMod,iiQuo,iiRem,%
+ Lt,Gt,Eq,LtorEq,GtorEq,Neq,%
+ iiLt,iiGt,iiEq,iiLtorEq,iiGtorEq,iiNeq,%
+ Add,Sub,Mul,Div,Pow,E,%
+ iiAdd,iiSub,iiMul,iiPow,iiE,%
+ AND,OR,XOR,%
+ SeqA::csv,iiSeqA::csv}\do
{\toks0
\expandafter{\the\toks0% no space!
\expandafter\let\csname xint#1NE\expandafter\endcsname\csname xint#1\expandafter
@@ -2285,14 +2341,14 @@
\romannumeral`&&@\expandafter\XINT_xptwo_getab_b
\romannumeral`&&@####2!{####1}{~xint#1}{xint#1}}%
}%
-}% cela aurait-il un sens d'ajouter Raw et iNum (à cause de qint, qfrac,
- % qfloat?). Pas le temps d'y réfléchir. Je ne fais rien.
+}%
\xintFor #1 in {Num,Irr,Abs,iiAbs,Sgn,iiSgn,TFrac,Floor,iFloor,Ceil,iCeil,%
- Sqr,iiSqr,iiSqrt,iiSqrtR,iiIsZero,iiIsNotZero,iiifNotZero,iiifSgn,%
- Odd,Even,iiOdd,iiEven,Opp,iiOpp,iiifZero,Fac,iiFac,Bool,Toggle}\do
-{\toks0
- \expandafter{\the\toks0%
- \expandafter\let\csname xint#1NE\expandafter\endcsname\csname xint#1\expandafter
+ Sqr,iiSqr,iiSqrt,iiSqrtR,iiIsZero,iiIsNotZero,iiifNotZero,iiifSgn,%
+ Odd,Even,iiOdd,iiEven,Opp,iiOpp,iiifZero,iFac,iBinomial,%
+ iPFactorial,iiFac,iiBinomial,iiPFactorial,Bool,Toggle}\do
+{\toks0 \expandafter{\the\toks0%
+ \expandafter\let\csname xint#1NE\expandafter\endcsname\csname
+ xint#1\expandafter
\endcsname\expandafter\def\csname xint#1\endcsname ####1{%
\expandafter\XINT_NEfork_one\romannumeral`&&@####1!{~xint#1}{xint#1}{}{}}%
}%
@@ -2304,7 +2360,7 @@
\expandafter\XINT_NEfork_one
\romannumeral`&&@##1!{~XINTinFloatFac}{XINTinFloatFac}{}{}}%
}%
-\xintFor #1 in {Add,Sub,Mul,Div,Power,E,Mod,SeqA::csv}\do
+\xintFor #1 in {Add,Sub,Mul,Div,Binomial,PFactorial,PowerH,E,Mod,SeqA::csv}\do
{\toks0
\expandafter{\the\toks0%
\expandafter\let\csname XINTinFloat#1NE\expandafter\endcsname
@@ -2315,7 +2371,7 @@
\romannumeral`&&@####2!{####1}{~XINTinFloat#1}{XINTinFloat#1}}%
}%
}%
-\xintFor #1 in {XINTinFloatdigits,XINTinFloatFracdigits,XINTinFloatSqrtdigits}\do
+\xintFor #1 in {XINTinFloatdigits,XINTinFloatFracdigits,XINTinFloatSqrtdigits,XINTinFloatFacdigits}\do
{\toks0
\expandafter{\the\toks0%
\expandafter\let\csname #1NE\expandafter\endcsname\csname #1\expandafter
@@ -2353,6 +2409,10 @@
\def\XINTinFloatSqrt [##1]##2{%
\expandafter\XINT_NEfork_one
\romannumeral`&&@##2!{~XINTinFloatSqrt[##1]}{XINTinFloatSqrt}{}{[##1]}}%
+ \let\XINTinFloatFacNE\XINTinFloatFac
+ \def\XINTinFloatFac [##1]##2{%
+ \expandafter\XINT_NEfork_one
+ \romannumeral`&&@##2!{~XINTinFloatFac[##1]}{XINTinFloatFac}{}{[##1]}}%
}%
\xintFor #1 in {ANDof,ORof,XORof,iiMaxof,iiMinof,iiSum,iiPrd,
GCDof,LCMof,Sum,Prd,Maxof,Minof}\do
@@ -2391,39 +2451,48 @@
\def\xintRound::csv {~xintRound::csv }%
}%
\toks0 {}%
-\def\xintNewExpr {\XINT_NewExpr{}\XINT_expr_redefineprints\xint_firstofone\xinttheexpr }%
-\def\xintNewFloatExpr {\XINT_NewExpr{}\XINT_expr_redefineprints\xint_firstofone\xintthefloatexpr }%
-\def\xintNewIExpr {\XINT_NewExpr{}\XINT_expr_redefineprints\xint_firstofone\xinttheiexpr }%
-\def\xintNewIIExpr {\XINT_NewExpr{}\XINT_expr_redefineprints\xint_firstofone\xinttheiiexpr }%
-\def\xintNewBoolExpr {\XINT_NewExpr{}\XINT_expr_redefineprints\xint_firstofone\xinttheboolexpr }%
-\def\XINT_NewFunc {\XINT_NewExpr,{}\xint_gobble_i\xintthebareeval }%
-\def\XINT_NewFloatFunc {\XINT_NewExpr,{}\xint_gobble_i\xintthebarefloateval }%
-\def\XINT_NewIIFunc {\XINT_NewExpr,{}\xint_gobble_i\xintthebareiieval }%
+\def\xintNewExpr {\XINT_NewExpr{}\XINT_expr_redefineprints\xint_firstofone
+ \xinttheexpr\XINT_newexpr_clean}%
+\def\xintNewFloatExpr{\XINT_NewExpr{}\XINT_expr_redefineprints\xint_firstofone
+ \xintthefloatexpr\XINT_newexpr_clean}%
+\def\xintNewIExpr {\XINT_NewExpr{}\XINT_expr_redefineprints\xint_firstofone
+ \xinttheiexpr\XINT_newexpr_clean}%
+\def\xintNewIIExpr {\XINT_NewExpr{}\XINT_expr_redefineprints\xint_firstofone
+ \xinttheiiexpr\XINT_newexpr_clean}%
+\def\xintNewBoolExpr {\XINT_NewExpr{}\XINT_expr_redefineprints\xint_firstofone
+ \xinttheboolexpr\XINT_newexpr_clean}%
\def\XINT_newexpr_clean #1>{\noexpand\romannumeral`&&@}%
-\def\XINT_NewExpr #1#2#3#4#5#6[#7]%
+\def\XINT_NewFunc
+ {\XINT_NewExpr,{}\xint_gobble_i\xintthebareeval \XINT_newfunc_clean }%
+\def\XINT_NewFloatFunc
+ {\XINT_NewExpr,{}\xint_gobble_i\xintthebarefloateval\XINT_newfunc_clean }%
+\def\XINT_NewIIFunc
+ {\XINT_NewExpr,{}\xint_gobble_i\xintthebareiieval \XINT_newfunc_clean }%
+\def\XINT_newfunc_clean #1>{}%
+\def\XINT_NewExpr #1#2#3#4#5#6#7[#8]%
{%
\begingroup
- \ifcase #7\relax
- \toks0 {\endgroup\def#5}%
- \or \toks0 {\endgroup\def#5##1#1}%
- \or \toks0 {\endgroup\def#5##1#1##2#1}%
- \or \toks0 {\endgroup\def#5##1#1##2#1##3#1}%
- \or \toks0 {\endgroup\def#5##1#1##2#1##3#1##4#1}%
- \or \toks0 {\endgroup\def#5##1#1##2#1##3#1##4#1##5#1}%
- \or \toks0 {\endgroup\def#5##1#1##2#1##3#1##4#1##5#1##6#1}%
- \or \toks0 {\endgroup\def#5##1#1##2#1##3#1##4#1##5#1##6#1##7#1}%
- \or \toks0 {\endgroup\def#5##1#1##2#1##3#1##4#1##5#1##6#1##7#1##8#1}%
- \or \toks0 {\endgroup\def#5##1#1##2#1##3#1##4#1##5#1##6#1##7#1##8#1##9#1}%
+ \ifcase #8\relax
+ \toks0 {\endgroup\def#6}%
+ \or \toks0 {\endgroup\def#6##1#1}%
+ \or \toks0 {\endgroup\def#6##1#1##2#1}%
+ \or \toks0 {\endgroup\def#6##1#1##2#1##3#1}%
+ \or \toks0 {\endgroup\def#6##1#1##2#1##3#1##4#1}%
+ \or \toks0 {\endgroup\def#6##1#1##2#1##3#1##4#1##5#1}%
+ \or \toks0 {\endgroup\def#6##1#1##2#1##3#1##4#1##5#1##6#1}%
+ \or \toks0 {\endgroup\def#6##1#1##2#1##3#1##4#1##5#1##6#1##7#1}%
+ \or \toks0 {\endgroup\def#6##1#1##2#1##3#1##4#1##5#1##6#1##7#1##8#1}%
+ \or \toks0 {\endgroup\def#6##1#1##2#1##3#1##4#1##5#1##6#1##7#1##8#1##9#1}%
\fi
\xintexprSafeCatcodes
\XINT_expr_redefinemacros
#2%
- \XINT_NewExpr_a #3#4#5%
+ \XINT_NewExpr_a #3#4#5#6%
}%
\catcode`~ 13 \catcode`@ 14 \catcode`\% 6 \catcode`# 12 \catcode`$ 11 @ $
-\def\XINT_NewExpr_a %1%2%3%4@
+\def\XINT_NewExpr_a %1%2%3%4%5@
{@
- \def\XINT_tmpa %%1%%2%%3%%4%%5%%6%%7%%8%%9{%4}@
+ \def\XINT_tmpa %%1%%2%%3%%4%%5%%6%%7%%8%%9{%5}@
\def~{$noexpand$}@
\catcode`: 11 \catcode`_ 11
\catcode`# 12 \catcode`~ 13 \escapechar 126
@@ -2434,11 +2503,11 @@
}@
\escapechar 92 \catcode`# 6 \catcode`$ 0 @ $
\edef\XINT_tmpa %%1%%2%%3%%4%%5%%6%%7%%8%%9@
- {\scantokens\expandafter{\expandafter\XINT_newexpr_clean\meaning\XINT_tmpb}}@
+ {\scantokens\expandafter{\expandafter%3\meaning\XINT_tmpb}}@
\the\toks0\expandafter{\XINT_tmpa{%%1}{%%2}{%%3}{%%4}{%%5}{%%6}{%%7}{%%8}{%%9}}@
%1{\ifxintverbose
\xintMessage{xintexpr}{Info}@
- {\string%3\space now with meaning \meaning%3}@
+ {\string%4\space now with meaning \meaning%4}@
\fi}@
}@
\catcode`% 14
diff --git a/Master/texmf-dist/tex/generic/xint/xintfrac.sty b/Master/texmf-dist/tex/generic/xint/xintfrac.sty
index 50a961d49cd..39b9785986f 100644
--- a/Master/texmf-dist/tex/generic/xint/xintfrac.sty
+++ b/Master/texmf-dist/tex/generic/xint/xintfrac.sty
@@ -21,8 +21,8 @@
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%% ---------------------------------------------------------------
-%% The xint bundle v1.2e 2015/11/22
-%% Copyright (C) 2013-2015 by Jean-Francois Burnol
+%% The xint bundle 1.2f 2016/03/12
+%% Copyright (C) 2013-2016 by Jean-Francois Burnol
%% xintfrac: Expandable operations on fractions
%% ---------------------------------------------------------------
\begingroup\catcode61\catcode48\catcode32=10\relax%
@@ -70,7 +70,7 @@
\XINTsetupcatcodes% defined in xintkernel.sty
\XINT_providespackage
\ProvidesPackage{xintfrac}%
- [2015/11/22 v1.2e Expandable operations on fractions (jfB)]%
+ [2016/03/12 1.2f Expandable operations on fractions (JFB)]%
\def\XINT_cntSgnFork #1%
{%
\ifcase #1\expandafter\xint_secondofthree
@@ -88,17 +88,16 @@
\expandafter\space
\the\numexpr -1+\XINT_Abs {#1}+\XINT_Len {#2}+\XINT_Len {#3}\relax
}%
-\def\XINT_lenrord_loop #1#2#3#4#5#6#7#8#9%
-{% faire \romannumeral`&&@\XINT_lenrord_loop 0{}#1\Z\W\W\W\W\W\W\W\Z
+\def\XINT_lenrord_loop #1.#2#3#4#5#6#7#8#9%
+{%
\xint_gob_til_W #9\XINT_lenrord_W\W
- \expandafter\XINT_lenrord_loop\expandafter
- {\the\numexpr #1+7}{#9#8#7#6#5#4#3#2}%
+ \expandafter\XINT_lenrord_loop\the\numexpr #1+\xint_c_vii.{#9#8#7#6#5#4#3#2}%
}%
-\def\XINT_lenrord_W\W\expandafter\XINT_lenrord_loop\expandafter #1#2#3\Z
+\def\XINT_lenrord_W\W\expandafter\XINT_lenrord_loop #1.#2#3\Z
{%
- \expandafter\XINT_lenrord_X\expandafter {#1}#2\Z
+ \expandafter\XINT_lenrord_X #1.#2\Z
}%
-\def\XINT_lenrord_X #1#2\Z
+\def\XINT_lenrord_X #1.#2\Z
{%
\XINT_lenrord_Y #2\R\R\R\R\R\R\T {#1}%
}%
@@ -113,10 +112,7 @@
#2\XINT_lenrord_Z \xint_c_iii
\W\XINT_lenrord_Z \xint_c_ii \Z
}%
-\def\XINT_lenrord_Z #1#2\Z #3% retourne: {longueur}renverse\Z
-{%
- \expandafter{\the\numexpr #3-#1\relax}%
-}%
+\def\XINT_lenrord_Z #1#2\Z #3{\the\numexpr #3-#1.}%
\def\XINT_outfrac #1#2#3%
{%
\ifcase\XINT_cntSgn #3\Z
@@ -173,11 +169,11 @@
#1/#2%
}%
\def\XINT_infrac_res_ca #1[#2]/\XINT_W[\XINT_W\XINT_T
- {\expandafter{\the\numexpr 0#2}{#1}{1}}%
+ {\expandafter{\the\numexpr #2}{#1}{1}}%
\def\XINT_infrac_res_cb #1/#2[%
{\expandafter\XINT_infrac_res_cc\romannumeral`&&@#2~#1[}%
\def\XINT_infrac_res_cc #1~#2[#3]/\XINT_W[\XINT_W\XINT_T
- {\expandafter{\the\numexpr 0#3}{#2}{#1}}%
+ {\expandafter{\the\numexpr #3}{#2}{#1}}%
\def\XINT_frac_gen #1/#2%
{%
\xint_UDXINTWfork
@@ -201,14 +197,14 @@
#1.#2%
}%
\def\XINT_frac_gen_Bb #1e#2e#3\XINT_Z
- {\expandafter\XINT_frac_gen_C\the\numexpr 0#2~#1!}%
+ {\expandafter\XINT_frac_gen_C\the\numexpr #2+\xint_c_~#1!}%
\def\XINT_frac_gen_Bc #1.#2e%
{%
\expandafter\XINT_frac_gen_Bd\romannumeral`&&@#2.#1e%
}%
\def\XINT_frac_gen_Bd #1.#2e#3e#4\XINT_Z
{%
- \expandafter\XINT_frac_gen_C\the\numexpr 0#3-\romannumeral0\expandafter
+ \expandafter\XINT_frac_gen_C\the\numexpr #3-\romannumeral0\expandafter
\XINT_length_loop
0.#1\xint_relax\xint_relax\xint_relax\xint_relax
\xint_relax\xint_relax\xint_relax\xint_relax\xint_bye~#2#1!%
@@ -370,10 +366,10 @@
}%
\def\XINT_addm_A #1#2#3#4#5#6%
{%
- \xint_gob_til_W #3\xint_addm_az\W
+ \xint_gob_til_W #3\XINT_addm_az\W
\XINT_addm_AB #1{#3#4#5#6}{#2}%
}%
-\def\xint_addm_az\W\XINT_addm_AB #1#2%
+\def\XINT_addm_az\W\XINT_addm_AB #1#2%
{%
\XINT_addm_AC_checkcarry #1%
}%
@@ -391,9 +387,9 @@
}%
\def\XINT_addm_AC_checkcarry #1%
{%
- \xint_gob_til_zero #1\xint_addm_AC_nocarry 0\XINT_addm_C
+ \xint_gob_til_zero #1\XINT_addm_AC_nocarry 0\XINT_addm_C
}%
-\def\xint_addm_AC_nocarry 0\XINT_addm_C #1#2\W\X\Y\Z
+\def\XINT_addm_AC_nocarry 0\XINT_addm_C #1#2\W\X\Y\Z
{%
\expandafter
\xint_cleanupzeros_andstop
@@ -408,10 +404,10 @@
\def\XINT_addm_C #1#2#3#4#5%
{%
\xint_gob_til_W
- #5\xint_addm_cw
- #4\xint_addm_cx
- #3\xint_addm_cy
- #2\xint_addm_cz
+ #5\XINT_addm_cw
+ #4\XINT_addm_cx
+ #3\XINT_addm_cy
+ #2\XINT_addm_cz
\W\XINT_addm_CD {#5#4#3#2}{#1}%
}%
\def\XINT_addm_CD #1%
@@ -422,10 +418,10 @@
{%
\XINT_addm_AC_checkcarry #2{#3#4}%
}%
-\def\xint_addm_cw
- #1\xint_addm_cx
- #2\xint_addm_cy
- #3\xint_addm_cz
+\def\XINT_addm_cw
+ #1\XINT_addm_cx
+ #2\XINT_addm_cy
+ #3\XINT_addm_cz
\W\XINT_addm_CD
{%
\expandafter\XINT_addm_CDw\the\numexpr 1+#1#2#3.%
@@ -434,9 +430,9 @@
{%
\XINT_addm_end #1#3%
}%
-\def\xint_addm_cx
- #1\xint_addm_cy
- #2\xint_addm_cz
+\def\XINT_addm_cx
+ #1\XINT_addm_cy
+ #2\XINT_addm_cz
\W\XINT_addm_CD
{%
\expandafter\XINT_addm_CDx\the\numexpr 1+#1#2.%
@@ -445,8 +441,8 @@
{%
\XINT_addm_end #1#3%
}%
-\def\xint_addm_cy
- #1\xint_addm_cz
+\def\XINT_addm_cy
+ #1\XINT_addm_cz
\W\XINT_addm_CD
{%
\expandafter\XINT_addm_CDy\the\numexpr 1+#1.%
@@ -455,7 +451,7 @@
{%
\XINT_addm_end #1#3%
}%
-\def\xint_addm_cz\W\XINT_addm_CD #1#2#3{\XINT_addm_end #1#3}%
+\def\XINT_addm_cz\W\XINT_addm_CD #1#2#3{\XINT_addm_end #1#3}%
\edef\XINT_addm_end #1#2#3#4#5%
{\noexpand\expandafter\space\noexpand\the\numexpr #1#2#3#4#5\relax}%
\def\xintRaw {\romannumeral0\xintraw }%
@@ -690,38 +686,9 @@
}%
\def\XINT_e #1#2#3#4%
{%
- \expandafter\XINT_e_end\expandafter{\the\numexpr #1+#4}{#2}{#3}%
-}%
-\def\XINT_e_end #1#2#3{ #2/#3[#1]}%
-\def\xintFloatE {\romannumeral0\xintfloate }%
-\def\xintfloate #1{\XINT_floate_chkopt #1\xint_relax }%
-\def\XINT_floate_chkopt #1%
-{%
- \ifx [#1\expandafter\XINT_floate_opt
- \else\expandafter\XINT_floate_noopt
- \fi #1%
-}%
-\def\XINT_floate_noopt #1\xint_relax
-{%
- \expandafter\XINT_floate_a\expandafter\XINTdigits
- \romannumeral0\XINT_infrac {#1}%
-}%
-\def\XINT_floate_opt [\xint_relax #1]#2%
-{%
- \expandafter\XINT_floate_a\expandafter
- {\the\numexpr #1\expandafter}\romannumeral0\XINT_infrac {#2}%
-}%
-\def\XINT_floate_a #1#2#3#4#5%
-{%
- \expandafter\expandafter\expandafter\XINT_float_a
- \expandafter\xint_exchangetwo_keepbraces\expandafter
- {\the\numexpr #2+#5}{#1}{#3}{#4}\XINT_float_Q
+ \expandafter\XINT_e_end\the\numexpr #1+#4.{#2}{#3}%
}%
-\def\XINTinFloatE {\romannumeral0\XINTinfloate }%
-\def\XINTinfloate {\expandafter\XINT_infloate\romannumeral0\XINTinfloat [\XINTdigits]}%
-\def\XINT_infloate #1[#2]#3%
- {\expandafter\XINT_infloate_end\expandafter {\the\numexpr #3+#2}{#1}}%
-\def\XINT_infloate_end #1#2{ #2[#1]}%
+\def\XINT_e_end #1.#2#3{ #2/#3[#1]}%
\def\xintIrr {\romannumeral0\xintirr }%
\def\xintirr #1%
{%
@@ -767,9 +734,9 @@
}%
\def\XINT_irr_loop_e #1#2\Z
{%
- \xint_gob_til_zero #1\xint_irr_loop_exit0\XINT_irr_loop_a {#1#2}%
+ \xint_gob_til_zero #1\XINT_irr_loop_exit0\XINT_irr_loop_a {#1#2}%
}%
-\def\xint_irr_loop_exit0\XINT_irr_loop_a #1#2#3#4%
+\def\XINT_irr_loop_exit0\XINT_irr_loop_a #1#2#3#4%
{%
\expandafter\XINT_irr_loop_exitb\expandafter
{\romannumeral0\xintiiquo {#3}{#2}}%
@@ -845,9 +812,9 @@
}%
\def\XINT_jrr_loop_e #1#2\Z
{%
- \xint_gob_til_zero #1\xint_jrr_loop_exit0\XINT_jrr_loop_a {#1#2}%
+ \xint_gob_til_zero #1\XINT_jrr_loop_exit0\XINT_jrr_loop_a {#1#2}%
}%
-\def\xint_jrr_loop_exit0\XINT_jrr_loop_a #1#2#3#4#5#6%
+\def\XINT_jrr_loop_exit0\XINT_jrr_loop_a #1#2#3#4#5#6%
{%
\XINT_irr_finish {#3}{#4}%
}%
@@ -864,12 +831,6 @@
\def\XINT_tfrac_zero #1\Z { 0/1[0]}%
\def\XINT_tfrac_P #1/#2\Z {\expandafter\XINT_rez_AB
\romannumeral0\xintiirem{#1}{#2}\Z {0}{#2}}%
-\def\XINTinFloatFracdigits {\romannumeral0\XINTinfloatfracdigits }%
-\def\XINTinfloatfracdigits #1%
-{%
- \expandafter\XINT_infloatfracdg_a\expandafter {\romannumeral0\xinttfrac{#1}}%
-}%
-\def\XINT_infloatfracdg_a {\XINTinfloat [\XINTdigits]}%
\def\xintTrunc {\romannumeral0\xinttrunc }%
\def\xintiTrunc {\romannumeral0\xintitrunc }%
\def\xinttrunc #1%
@@ -916,13 +877,13 @@
\def\XINT_trunc_C #1#2#3%
{%
\expandafter\XINT_trunc_CE\expandafter
- {\romannumeral0\XINT_dsx_zeroloop {-#1}{}\Z {#3}}{#2}%
+ {\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_E
- \romannumeral0\XINT_dsx_zeroloop {#1}{}\Z {#2}.%
+ \romannumeral0\XINT_dsx_zeroloop #1.{}\Z {#2}.%
}%
\def\XINT_trunc_E #1%
{%
@@ -965,7 +926,7 @@
\def\XINT_trunc_Hb #1#2#3%
{%
\expandafter #3\expandafter0\expandafter.%
- \romannumeral0\XINT_dsx_zeroloop {#1}{}\Z {}#2% #1=-0 autoris\'e !
+ \romannumeral0\XINT_dsx_zeroloop #1.{}\Z {}#2% #1=-0 autoris\'e !
}%
\def\xintTTrunc {\romannumeral0\xintttrunc }%
\def\xintttrunc #1%
@@ -1075,8 +1036,8 @@
}%
\def\XINT_xtrunc_zero .#1#2#3#4#5%
{%
- 0.\romannumeral0\expandafter\XINT_dsx_zeroloop\expandafter
- {\the\numexpr #5}{}\Z {}%
+ 0.\romannumeral0\expandafter\XINT_dsx_zeroloop
+ \the\numexpr #5.{}\Z {}%
\xintiloop [#4+-1]
\ifnum \xintiloopindex>\xint_c_
0000000000000000000000000000000000000000000000000000000000000000%
@@ -1136,12 +1097,12 @@
\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
+ \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_negNDb #1.#2.{#1.#2}%
\def\XINT_xtrunc_negNE #1#2%
{%
- 0.\romannumeral0\XINT_dsx_zeroloop {-#1}{}\Z {}#2%
+ 0.\romannumeral0\XINT_dsx_zeroloop -#1.{}\Z {}#2%
}%
\def\XINT_xtrunc_negNW #1#2#3#4#5#6%
{%
@@ -1153,11 +1114,10 @@
\expandafter\XINT_xtrunc_negNC\expandafter
{\the\numexpr\xintLength {#1}-#2}{#1}%
}%
-%%%%%%%%%%%%
\def\XINT_xtrunc_BisOne #1#2#3#4#5#6#7%
{%
- #5.\romannumeral0\expandafter\XINT_dsx_zeroloop\expandafter
- {\the\numexpr #7}{}\Z {}%
+ #5.\romannumeral0\expandafter\XINT_dsx_zeroloop
+ \the\numexpr #7.{}\Z {}%
\xintiloop [#6+-1]
\ifnum \xintiloopindex>\xint_c_
0000000000000000000000000000000000000000000000000000000000000000%
@@ -1166,18 +1126,17 @@
\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 {}%
+ \romannumeral0\expandafter\XINT_dsx_zeroloop
+ \the\numexpr #7-\xint_c_i.{}\Z {}%
\xintiloop [#6+-1]
\ifnum \xintiloopindex>\xint_c_
0000000000000000000000000000000000000000000000000000000000000000%
\repeat
}%
-%%%%%%%%%%%%
\def\XINT_xtrunc_Q #1%
{%
\expandafter\XINT_xtrunc_prepare
- \romannumeral0\XINT_dsx_zeroloop {#1}{}\Z
+ \romannumeral0\XINT_dsx_zeroloop #1.{}\Z
}%
\def\XINT_xtrunc_prepare #1.#2#3%
{%
@@ -1185,7 +1144,6 @@
{\romannumeral0%
\XINT_xtrunc_prepare_a #2\R\R\R\R\R\R\R\R {10}0000001\W !{#2}}{#1}%
}%
-%%%%%%%%%%%%
\def\XINT_xtrunc_prepare_a #1#2#3#4#5#6#7#8#9%
{%
\xint_gob_til_R #9\XINT_xtrunc_prepare_small\R
@@ -1205,7 +1163,6 @@
\the\numexpr #1/\xint_c_ii\expandafter
.\the\numexpr \xint_c_x^viii+#1!%
}%
-%%%%%%%%%%%%
\def\XINT_xtrunc_small_a #1.#2!#3%
{%
\expandafter\XINT_div_small_b\the\numexpr #1\expandafter
@@ -1213,7 +1170,6 @@
\romannumeral0\XINT_div_small_ba #3\R\R\R\R\R\R\R\R{10}0000001\W
#3\XINT_sepbyviii_Z_end 2345678\relax
}%
-%%%%%%%%%%%%
\def\XINT_xtrunc_prepare_b
{\expandafter\XINT_xtrunc_prepare_c\romannumeral0\XINT_zeroes_forviii }%
\def\XINT_xtrunc_prepare_c #1!%
@@ -1242,7 +1198,6 @@
\R.\xint_c_ii\R.\xint_c_i\R.\xint_c_\W
\X
}%
-%%%%%%%%%%%%
\def\XINT_xtrunc_Pa #1#2%
{%
\expandafter\XINT_xtrunc_Pb\romannumeral0#1{#2}{#1}%
@@ -1261,8 +1216,8 @@
}%
\def\XINT_xtrunc_D #1#2#3%
{%
- \romannumeral0\expandafter\XINT_dsx_zeroloop\expandafter
- {\the\numexpr \xint_c_ii^vi-\xintLength{#1}}{}\Z {}#1%
+ \romannumeral0\expandafter\XINT_dsx_zeroloop
+ \the\numexpr \xint_c_ii^vi-\xintLength{#1}.{}\Z {}#1%
\XINT_xtrunc_A {#3}{#2}%
}%
\def\XINT_xtrunc_transition\fi
@@ -1271,7 +1226,7 @@
\fi
\ifnum #4=\xint_c_ \XINT_xtrunc_abort\fi
\expandafter\XINT_xtrunc_x\expandafter
- {\romannumeral0\XINT_dsx_zeroloop {#4}{}\Z {#2}}{#3}{#4}%
+ {\romannumeral0\XINT_dsx_zeroloop #4.{}\Z {#2}}{#3}{#4}%
}%
\def\XINT_xtrunc_x #1#2%
{%
@@ -1279,330 +1234,17 @@
}%
\def\XINT_xtrunc_y #1#2#3%
{%
- \romannumeral0\expandafter\XINT_dsx_zeroloop\expandafter
- {\the\numexpr #3-\xintLength{#1}}{}\Z {}#1%
+ \romannumeral0\expandafter\XINT_dsx_zeroloop
+ \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=}%
\def\xinttheDigits {\number\XINTdigits }%
-\def\xintFloat {\romannumeral0\xintfloat }%
-\def\xintfloat #1{\XINT_float_chkopt #1\xint_relax }%
-\def\XINT_float_chkopt #1%
-{%
- \ifx [#1\expandafter\XINT_float_opt
- \else\expandafter\XINT_float_noopt
- \fi #1%
-}%
-\def\XINT_float_noopt #1\xint_relax
-{%
- \expandafter\XINT_float_a\expandafter\XINTdigits
- \romannumeral0\XINT_infrac {#1}\XINT_float_Q
-}%
-\def\XINT_float_opt [\xint_relax #1]#2%
-{%
- \expandafter\XINT_float_a\expandafter
- {\the\numexpr #1\expandafter}%
- \romannumeral0\XINT_infrac {#2}\XINT_float_Q
-}%
-\def\XINT_float_a #1#2#3% #1=P, #2=n, #3=A, #4=B
-{%
- \XINT_float_fork #3\Z {#1}{#2}% #1 = precision, #2=n
-}%
-\def\XINT_float_fork #1%
-{%
- \xint_UDzerominusfork
- #1-\XINT_float_zero
- 0#1\XINT_float_J
- 0-{\XINT_float_K #1}%
- \krof
-}%
-\def\XINT_float_zero #1\Z #2#3#4#5{ 0.e0}%
-\def\XINT_float_J {\expandafter\xint_minus_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
- {\the\numexpr\xintLength{#1}\expandafter}\expandafter
- {\the\numexpr #2+\xint_c_ii}{#1}{#2}%
-}%
-\def\XINT_float_L #1#2%
-{%
- \ifnum #1>#2
- \expandafter\XINT_float_Ma
- \else
- \expandafter\XINT_float_Mc
- \fi {#1}{#2}%
-}%
-\def\XINT_float_Ma #1#2#3%
-{%
- \expandafter\XINT_float_Mb\expandafter
- {\the\numexpr #1-#2\expandafter\expandafter\expandafter}%
- \expandafter\expandafter\expandafter
- {\expandafter\xint_firstoftwo
- \romannumeral0\XINT_split_fromleft_loop {#2}{}#3\W\W\W\W\W\W\W\W\Z
- }{#2}%
-}%
-\def\XINT_float_Mb #1#2#3#4#5#6% #2=A', #3=P+2, #4=P, #5=n, #6=B
-{%
- \expandafter\XINT_float_N\expandafter
- {\the\numexpr\xintLength{#6}\expandafter}\expandafter
- {\the\numexpr #3\expandafter}\expandafter
- {\the\numexpr #1+#5}%
- {#6}{#3}{#2}{#4}%
-}% long de B, P+2, n', B, |A'|=P+2, A', P
-\def\XINT_float_Mc #1#2#3#4#5#6%
-{%
- \expandafter\XINT_float_N\expandafter
- {\romannumeral0\xintlength{#6}}{#2}{#5}{#6}{#1}{#3}{#4}%
-}% long de B, P+2, n, B, |A|, A, P
-\def\XINT_float_N #1#2%
-{%
- \ifnum #1>#2
- \expandafter\XINT_float_O
- \else
- \expandafter\XINT_float_P
- \fi {#1}{#2}%
-}%
-\def\XINT_float_O #1#2#3#4%
-{%
- \expandafter\XINT_float_P\expandafter
- {\the\numexpr #2\expandafter}\expandafter
- {\the\numexpr #2\expandafter}\expandafter
- {\the\numexpr #3-#1+#2\expandafter\expandafter\expandafter}%
- \expandafter\expandafter\expandafter
- {\expandafter\xint_firstoftwo
- \romannumeral0\XINT_split_fromleft_loop {#2}{}#4\W\W\W\W\W\W\W\W\Z
- }%
-}% |B|,P+2,n,B,|A|,A,P
-\def\XINT_float_P #1#2#3#4#5#6#7#8%
-{%
- \expandafter #8\expandafter {\the\numexpr #1-#5+#2-\xint_c_i}%
- {#6}{#4}{#7}{#3}%
-}% |B|-|A|+P+1,A,B,P,n
-\def\XINT_float_Q #1%
-{%
- \ifnum #1<\xint_c_
- \expandafter\XINT_float_Ri
- \else
- \expandafter\XINT_float_Rii
- \fi {#1}%
-}%
-\def\XINT_float_Ri #1#2#3%
-{%
- \expandafter\XINT_float_Sa
- \romannumeral0\xintiiquo {#2}%
- {\XINT_dsx_addzerosnofuss {-#1}{#3}}\Z {#1}%
-}%
-\def\XINT_float_Rii #1#2#3%
-{%
- \expandafter\XINT_float_Sa
- \romannumeral0\xintiiquo
- {\XINT_dsx_addzerosnofuss {#1}{#2}}{#3}\Z {#1}%
-}%
-\def\XINT_float_Sa #1%
-{%
- \if #19%
- \xint_afterfi {\XINT_float_Sb\XINT_float_Wb }%
- \else
- \xint_afterfi {\XINT_float_Sb\XINT_float_Wa }%
- \fi #1%
-}%
-\def\XINT_float_Sb #1#2\Z #3#4%
-{%
- \expandafter\XINT_float_T\expandafter
- {\the\numexpr #4+\xint_c_i\expandafter}%
- \romannumeral`&&@\XINT_lenrord_loop 0{}#2\Z\W\W\W\W\W\W\W\Z #1{#3}{#4}%
-}%
-\def\XINT_float_T #1#2#3%
-{%
- \ifnum #2>#1
- \xint_afterfi{\XINT_float_U\XINT_float_Xb}%
- \else
- \xint_afterfi{\XINT_float_U\XINT_float_Xa #3}%
- \fi
-}%
-\def\XINT_float_U #1#2%
-{%
- \ifnum #2<\xint_c_v
- \expandafter\XINT_float_Va
- \else
- \expandafter\XINT_float_Vb
- \fi #1%
-}%
-\def\XINT_float_Va #1#2\Z #3%
-{%
- \expandafter#1%
- \romannumeral0\expandafter\XINT_float_Wa
- \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 \Z
-}%
-\def\XINT_float_Vb #1#2\Z #3%
-{%
- \expandafter #1%
- \romannumeral0\expandafter #3%
- \romannumeral0\XINT_addm_A 0{}1000\W\X\Y\Z #2000\W\X\Y\Z \Z
-}%
-\def\XINT_float_Wa #1{ #1.}%
-\def\XINT_float_Wb #1#2%
- {\if #11\xint_afterfi{ 10.}\else\xint_afterfi{ #1.#2}\fi }%
-\def\XINT_float_Xa #1\Z #2#3#4%
-{%
- \expandafter\XINT_float_Y\expandafter
- {\the\numexpr #3+#4-#2}{#1}%
-}%
-\def\XINT_float_Xb #1\Z #2#3#4%
-{%
- \expandafter\XINT_float_Y\expandafter
- {\the\numexpr #3+#4+\xint_c_i-#2}{#1}%
-}%
-\def\XINT_float_Y #1#2{ #2e#1}%
-\def\xintPFloat {\romannumeral0\xintpfloat }%
-\def\xintpfloat #1{\XINT_pfloat_chkopt #1\xint_relax }%
-\def\XINT_pfloat_chkopt #1%
-{%
- \ifx [#1\expandafter\XINT_pfloat_opt
- \else\expandafter\XINT_pfloat_noopt
- \fi #1%
-}%
-\def\XINT_pfloat_noopt #1\xint_relax
-{%
- \expandafter\XINT_pfloat_a\expandafter\XINTdigits
- \romannumeral0\XINTinfloat [\XINTdigits]{#1}%
-}%
-\def\XINT_pfloat_opt [\xint_relax #1]%#2%
-{%
- \expandafter\XINT_pfloat_a\expandafter {\the\numexpr #1\expandafter}%
- \romannumeral0\XINTinfloat [\numexpr #1\relax]%{#2}%
-}%
-\def\XINT_pfloat_a #1#2%
-{%
- \xint_UDzerominusfork
- #2-\XINT_pfloat_zero
- 0#2\XINT_pfloat_neg
- 0-{\XINT_pfloat_pos #2}%
- \krof {#1}%
-}%
-\def\XINT_pfloat_zero #1[#2]{ 0}%
-\def\XINT_pfloat_neg
- {\expandafter\xint_minus_thenstop\romannumeral0\XINT_pfloat_pos {}}%
-\def\XINT_pfloat_pos #1#2#3[#4]%
-{%
- \ifnum#4>0 \xint_dothis\XINT_pfloat_no\fi
- \ifnum#4>\numexpr-#2\relax \xint_dothis\XINT_pfloat_b\fi
- \ifnum#4>\numexpr-#2-\xint_c_v\relax \xint_dothis\XINT_pfloat_B\fi
- \xint_orthat\XINT_pfloat_no {#2}{#4}{#1#3}%
-}%
-\def\XINT_pfloat_no #1#2%
-{%
- \expandafter\XINT_pfloat_no_b\expandafter{\the\numexpr #2+#1-\xint_c_i\relax}%
-}%
-\def\XINT_pfloat_no_b #1#2{\XINT_pfloat_no_c #2e#1}%
-\def\XINT_pfloat_no_c #1{ #1.}%
-\def\XINT_pfloat_b #1#2#3%
- {\expandafter\XINT_pfloat_c
- \romannumeral0\expandafter\XINT_split_fromleft_loop
- \expandafter {\the\numexpr #1+#2-\xint_c_i}#3\W\W\W\W\W\W\W\W\Z }%
-\def\XINT_pfloat_c #1#2{ #1.#2}% #2 peut \^etre vide
-\def\XINT_pfloat_B #1#2#3%
- {\expandafter\XINT_pfloat_C
- \romannumeral0\XINT_dsx_zeroloop {\numexpr -#1-#2}{}\Z {}#3}%
-\def\XINT_pfloat_C { 0.}%
-\def\XINTinFloat {\romannumeral0\XINTinfloat }%
-\def\XINTinfloat [#1]#2%
-{%
- \expandafter\XINT_infloat_a\expandafter
- {\the\numexpr #1\expandafter}%
- \romannumeral0\XINT_infrac {#2}\XINT_infloat_Q
-}%
-\def\XINT_infloat_a #1#2#3% #1=P, #2=n, #3=A, #4=B
-{%
- \XINT_infloat_fork #3\Z {#1}{#2}% #1 = precision, #2=n
-}%
-\def\XINT_infloat_fork #1%
-{%
- \xint_UDzerominusfork
- #1-\XINT_infloat_zero
- 0#1\XINT_infloat_J
- 0-{\XINT_float_K #1}%
- \krof
-}%
-\def\XINT_infloat_zero #1\Z #2#3#4#5{ 0[0]}%
-\def\XINT_infloat_J {\expandafter-\romannumeral0\XINT_float_K }%
-\def\XINT_infloat_Q #1%
-{%
- \ifnum #1<\xint_c_
- \expandafter\XINT_infloat_Ri
- \else
- \expandafter\XINT_infloat_Rii
- \fi {#1}%
-}%
-\def\XINT_infloat_Ri #1#2#3%
-{%
- \expandafter\XINT_infloat_S\expandafter
- {\romannumeral0\xintiiquo {#2}%
- {\XINT_dsx_addzerosnofuss {-#1}{#3}}}{#1}%
-}%
-\def\XINT_infloat_Rii #1#2#3%
-{%
- \expandafter\XINT_infloat_S\expandafter
- {\romannumeral0\xintiiquo
- {\XINT_dsx_addzerosnofuss {#1}{#2}}{#3}}{#1}%
-}%
-\def\XINT_infloat_S #1#2#3%
-{%
- \expandafter\XINT_infloat_T\expandafter
- {\the\numexpr #3+\xint_c_i\expandafter}%
- \romannumeral`&&@\XINT_lenrord_loop 0{}#1\Z\W\W\W\W\W\W\W\Z
- {#2}%
-}%
-\def\XINT_infloat_T #1#2#3%
-{%
- \ifnum #2>#1
- \xint_afterfi{\XINT_infloat_U\XINT_infloat_Wb}%
- \else
- \xint_afterfi{\XINT_infloat_U\XINT_infloat_Wa #3}%
- \fi
-}%
-\def\XINT_infloat_U #1#2%
-{%
- \ifnum #2<\xint_c_v
- \expandafter\XINT_infloat_Va
- \else
- \expandafter\XINT_infloat_Vb
- \fi #1%
-}%
-\def\XINT_infloat_Va #1#2\Z
-{%
- \expandafter#1%
- \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 \Z
-}%
-\def\XINT_infloat_Vb #1#2\Z
-{%
- \expandafter #1%
- \romannumeral0\XINT_addm_A 0{}1000\W\X\Y\Z #2000\W\X\Y\Z \Z
-}%
-\def\XINT_infloat_Wa #1\Z #2#3%
-{%
- \expandafter\XINT_infloat_X\expandafter
- {\the\numexpr #3+\xint_c_i-#2}{#1}%
-}%
-\def\XINT_infloat_Wb #1\Z #2#3%
-{%
- \expandafter\XINT_infloat_X\expandafter
- {\the\numexpr #3+\xint_c_ii-#2}{#1}%
-}%
-\def\XINT_infloat_X #1#2{ #2[#1]}%
\def\xintAdd {\romannumeral0\xintadd }%
-\def\xintadd #1{\expandafter\xint_fadd\romannumeral0\xintraw {#1}}%
-\def\xint_fadd #1{\xint_gob_til_zero #1\XINT_fadd_Azero 0\XINT_fadd_a #1}%
+\def\xintadd #1{\expandafter\XINT_fadd\romannumeral0\xintraw {#1}}%
+\def\XINT_fadd #1{\xint_gob_til_zero #1\XINT_fadd_Azero 0\XINT_fadd_a #1}%
\def\XINT_fadd_Azero #1]{\xintraw }%
\def\XINT_fadd_a #1/#2[#3]#4%
{\expandafter\XINT_fadd_b\romannumeral0\xintraw {#4}{#3}{#1}{#2}}%
@@ -1626,13 +1268,13 @@
\def\XINT_fadd_Ba #1#2#3#4#5#6#7%
{%
\expandafter\XINT_fadd_C\expandafter
- {\romannumeral0\XINT_dsx_zeroloop {#1}{}\Z {#6}}%
+ {\romannumeral0\XINT_dsx_zeroloop #1.{}\Z {#6}}%
{#7}{#5}{#4}[#2]%
}%
\def\XINT_fadd_Bb #1#2#3#4#5#6#7%
{%
\expandafter\XINT_fadd_C\expandafter
- {\romannumeral0\XINT_dsx_zeroloop {-#1}{}\Z {#4}}%
+ {\romannumeral0\XINT_dsx_zeroloop -#1.{}\Z {#4}}%
{#5}{#7}{#6}[#3]%
}%
\def\XINT_fadd_C #1#2#3%
@@ -1693,8 +1335,8 @@
\def\XINT_fadd_N #1#2{ #2/#1}%
\edef\XINT_fadd_iszero\fi #1[#2]{\noexpand\fi\space 0/1[0]}% ou [#2] originel?
\def\xintSub {\romannumeral0\xintsub }%
-\def\xintsub #1{\expandafter\xint_fsub\romannumeral0\xintraw {#1}}%
-\def\xint_fsub #1{\xint_gob_til_zero #1\XINT_fsub_Azero 0\XINT_fsub_a #1}%
+\def\xintsub #1{\expandafter\XINT_fsub\romannumeral0\xintraw {#1}}%
+\def\XINT_fsub #1{\xint_gob_til_zero #1\XINT_fsub_Azero 0\XINT_fsub_a #1}%
\def\XINT_fsub_Azero #1]{\xintopp }%
\def\XINT_fsub_a #1/#2[#3]#4%
{\expandafter\XINT_fsub_b\romannumeral0\xintraw {#4}{#3}{#1}{#2}}%
@@ -1723,8 +1365,8 @@
}%
\def\XINT_fsum_finished #1\Z #2{ #2}%
\def\xintMul {\romannumeral0\xintmul }%
-\def\xintmul #1{\expandafter\xint_fmul\romannumeral0\xintraw {#1}.}%
-\def\xint_fmul #1{\xint_gob_til_zero #1\XINT_fmul_zero 0\XINT_fmul_a #1}%
+\def\xintmul #1{\expandafter\XINT_fmul\romannumeral0\xintraw {#1}.}%
+\def\XINT_fmul #1{\xint_gob_til_zero #1\XINT_fmul_zero 0\XINT_fmul_a #1}%
\def\XINT_fmul_a #1[#2].#3%
{\expandafter\XINT_fmul_b\romannumeral0\xintraw {#3}#1[#2.]}%
\def\XINT_fmul_b #1{\xint_gob_til_zero #1\XINT_fmul_zero 0\XINT_fmul_c #1}%
@@ -1742,9 +1384,9 @@
\def\XINT_fmul_e #1#2{\XINT_outfrac {#2}{#1}}%
\def\XINT_fmul_zero #1.#2{ 0/1[0]}%
\def\xintSqr {\romannumeral0\xintsqr }%
-\def\xintsqr #1{\expandafter\xint_fsqr\romannumeral0\xintraw {#1}}%
-\def\xint_fsqr #1{\xint_gob_til_zero #1\XINT_fsqr_zero 0\XINT_fsqr_a #1}%
-\def\xint_fsqr_a #1/#2[#3]%
+\def\xintsqr #1{\expandafter\XINT_fsqr\romannumeral0\xintraw {#1}}%
+\def\XINT_fsqr #1{\xint_gob_til_zero #1\XINT_fsqr_zero 0\XINT_fsqr_a #1}%
+\def\XINT_fsqr_a #1/#2[#3]%
{%
\expandafter\XINT_fsqr_b
\expandafter{\the\numexpr #3+#3\expandafter}%
@@ -1753,12 +1395,16 @@
}%
\def\XINT_fsqr_b #1#2#3{\expandafter \XINT_fmul_e \expandafter{#3}{#1}{#2}}%
\def\XINT_fsqr_zero #1]{ 0/1[0]}%
+\def\xintipow #1#2%
+{%
+ \expandafter\xint_pow\the\numexpr \xintNum{#2}\expandafter.\romannumeral0\xintnum{#1}\Z%
+}%
\def\xintPow {\romannumeral0\xintpow }%
\def\xintpow #1%
{%
- \expandafter\xint_fpow\expandafter {\romannumeral0\XINT_infrac {#1}}%
+ \expandafter\XINT_fpow\expandafter {\romannumeral0\XINT_infrac {#1}}%
}%
-\def\xint_fpow #1#2%
+\def\XINT_fpow #1#2%
{%
\expandafter\XINT_fpow_fork\the\numexpr \xintNum{#2}\relax\Z #1%
}%
@@ -1791,10 +1437,16 @@
\expandafter\XINT_fpow_pos_B\expandafter {#3}{#1}{#2}%
}%
\def\XINT_fpow_pos_B #1#2{\XINT_outfrac {#2}{#1}}%
-\def\xintFac {\romannumeral0\xintfac }%
-\def\xintfac #1%
+\def\xintifac #1{\expandafter\XINT_fac_fork\the\numexpr \xintNum{#1}.}%
+\def\xintibinomial #1#2%
+{%
+ \expandafter\XINT_binom_pre
+ \the\numexpr\xintNum{#1}\expandafter.\the\numexpr\xintNum{#2}.%
+}%
+\def\xintipfactorial #1#2%
{%
- \expandafter\XINT_fac_fork\expandafter{\the\numexpr \xintNum{#1}}%
+ \expandafter\XINT_pfac_fork
+ \the\numexpr\xintNum{#1}\expandafter.\the\numexpr\xintNum{#2}.%
}%
\def\xintPrd {\romannumeral0\xintprd }%
\def\xintprd #1{\xintprdexpr #1\relax }%
@@ -1818,9 +1470,9 @@
\def\xintDiv {\romannumeral0\xintdiv }%
\def\xintdiv #1%
{%
- \expandafter\xint_fdiv\expandafter {\romannumeral0\XINT_infrac {#1}}%
+ \expandafter\XINT_fdiv\expandafter {\romannumeral0\XINT_infrac {#1}}%
}%
-\def\xint_fdiv #1#2%
+\def\XINT_fdiv #1#2%
{\expandafter\XINT_fdiv_A\romannumeral0\XINT_infrac {#2}#1}%
\def\XINT_fdiv_A #1#2#3#4#5#6%
{%
@@ -1877,12 +1529,6 @@
{\xintiiE{\xintiiMul {#2}{#6}}{#4-#7}}% t fois n
}%
\def\XINT_mod_pos_a #1.#2#3#4{\xintiirem {#3}{#4}/#2[#1]}%
-\def\XINTinFloatMod {\romannumeral0\XINTinfloatmod [\XINTdigits]}%
-\def\XINTinfloatmod [#1]#2#3{\expandafter\XINT_infloatmod\expandafter
- {\romannumeral0\XINTinfloat[#1]{#2}}%
- {\romannumeral0\XINTinfloat[#1]{#3}}{#1}}%
-\def\XINT_infloatmod #1#2{\expandafter\XINT_infloatmod_a\expandafter {#2}{#1}}%
-\def\XINT_infloatmod_a #1#2#3{\XINTinfloat [#3]{\xintMod {#2}{#1}}}%
\def\xintIsOne {\romannumeral0\xintisone }%
\def\xintisone #1{\expandafter\XINT_fracisone
\romannumeral0\xintrawwithzeros{#1}\Z }%
@@ -1891,9 +1537,9 @@
\def\xintGeq {\romannumeral0\xintgeq }%
\def\xintgeq #1%
{%
- \expandafter\xint_fgeq\expandafter {\romannumeral0\xintabs {#1}}%
+ \expandafter\XINT_fgeq\expandafter {\romannumeral0\xintabs {#1}}%
}%
-\def\xint_fgeq #1#2%
+\def\XINT_fgeq #1#2%
{%
\expandafter\XINT_fgeq_A \romannumeral0\xintabs {#2}#1%
}%
@@ -1944,9 +1590,9 @@
\def\xintMax {\romannumeral0\xintmax }%
\def\xintmax #1%
{%
- \expandafter\xint_fmax\expandafter {\romannumeral0\xintraw {#1}}%
+ \expandafter\XINT_fmax\expandafter {\romannumeral0\xintraw {#1}}%
}%
-\def\xint_fmax #1#2%
+\def\XINT_fmax #1#2%
{%
\expandafter\XINT_fmax_A\romannumeral0\xintraw {#2}#1%
}%
@@ -1988,9 +1634,9 @@
\def\xintMin {\romannumeral0\xintmin }%
\def\xintmin #1%
{%
- \expandafter\xint_fmin\expandafter {\romannumeral0\xintraw {#1}}%
+ \expandafter\XINT_fmin\expandafter {\romannumeral0\xintraw {#1}}%
}%
-\def\xint_fmin #1#2%
+\def\XINT_fmin #1#2%
{%
\expandafter\XINT_fmin_A\romannumeral0\xintraw {#2}#1%
}%
@@ -2031,9 +1677,9 @@
\def\XINT_minof_e #1\Z #2\Z { #2}%
\def\xintcmp #1%
{%
- \expandafter\xint_fcmp\expandafter {\romannumeral0\xintraw {#1}}%
+ \expandafter\XINT_fcmp\expandafter {\romannumeral0\xintraw {#1}}%
}%
-\def\xint_fcmp #1#2%
+\def\XINT_fcmp #1#2%
{%
\expandafter\XINT_fcmp_A\romannumeral0\xintraw {#2}#1%
}%
@@ -2109,6 +1755,422 @@
\def\xintopp #1{\expandafter\XINT_opp\romannumeral0\xintraw {#1}}%
\def\xintSgn {\romannumeral0\xintsgn }%
\def\xintsgn #1{\expandafter\XINT_sgn\romannumeral0\xintraw {#1}\Z }%
+\def\xintFloat {\romannumeral0\xintfloat }%
+\def\xintfloat #1{\XINT_float_chkopt #1\xint_relax }%
+\def\XINT_float_chkopt #1%
+{%
+ \ifx [#1\expandafter\XINT_float_opt
+ \else\expandafter\XINT_float_noopt
+ \fi #1%
+}%
+\def\XINT_float_noopt #1\xint_relax
+{%
+ \expandafter\XINT_float_a\expandafter\XINTdigits\expandafter.%
+ \romannumeral0\XINT_infrac {#1}\XINT_float_Q
+}%
+\def\XINT_float_opt [\xint_relax #1]#2%
+{%
+ \expandafter\XINT_float_a\the\numexpr #1\expandafter.%
+ \romannumeral0\XINT_infrac {#2}\XINT_float_Q
+}%
+\def\XINT_float_a #1.#2#3% #1=P, #2=n, #3=A, #4=B
+{%
+ \XINT_float_fork #3\Z {#1}{#2}% #1 = precision, #2=n
+}%
+\def\XINT_float_fork #1%
+{%
+ \xint_UDzerominusfork
+ #1-\XINT_float_zero
+ 0#1\XINT_float_J
+ 0-{\XINT_float_K #1}%
+ \krof
+}%
+\def\XINT_float_zero #1\Z #2#3#4#5{ 0.e0}%
+\def\XINT_float_J {\expandafter\xint_minus_thenstop\romannumeral0\XINT_float_K }%
+\def\XINT_float_K #1\Z #2% #1=A, #2=P, #3=n, #4=B
+{%
+ \expandafter\XINT_float_L
+ \the\numexpr\xintLength{#1}\expandafter.\the\numexpr #2+\xint_c_ii.{#1}{#2}%
+}%
+\def\XINT_float_L #1.#2.%
+{%
+ \ifnum #1>#2
+ \expandafter\XINT_float_Ma
+ \else
+ \expandafter\XINT_float_Mb
+ \fi #1.#2.%
+}%
+\def\XINT_float_Ma #1.#2.#3%
+{%
+ \expandafter\XINT_float_MatoN
+ \the\numexpr #1-#2\expandafter.%
+ \romannumeral0\XINT_split_fromleft_loop #2.{}#3\W\W\W\W\W\W\W\W\Z
+ {#2}%
+}%
+\def\XINT_float_MatoN #1.#2.#3.#4#5#6#7%
+{%
+ \expandafter\XINT_float_N
+ \the\numexpr\xintLength{#7}\expandafter.\the\numexpr #1+#6.#4.%
+ {#7}{#4}{#2}{#5}%
+}%
+\def\XINT_float_Mb #1.#2.#3#4#5#6%
+{%
+ \expandafter\XINT_float_N
+ \romannumeral0\xintlength{#6}.#5.#2.{#6}{#1}{#3}{#4}%
+}%
+\def\XINT_float_N #1.#2.#3.%
+{%
+ \ifnum #1>#3 \xint_dothis\XINT_float_N_Blong\fi
+ \ifnum #1=\xint_c_i\xint_dothis\XINT_float_N_Bshort\fi
+ \xint_orthat{\XINT_float_P 0.}%
+ #1.#2.#3.%
+}%
+\def\XINT_float_N_Blong #1.#2.#3.#4%
+{%
+ \expandafter\XINT_float_NaP
+ \the\numexpr #2-#1+#3\expandafter.%
+ \romannumeral0\XINT_split_fromleft_loop #3.{}#4\W\W\W\W\W\W\W\W\Z {#3}%
+}%
+\def\XINT_float_NaP #1.#2.#3.#4{\XINT_float_P 0.#4.#1.#4.{#2}}%
+\def\XINT_float_N_Bshort 1.#1.#2.#3%
+{%
+ \ifnum #3=\xint_c_i \xint_dothis{\XINT_float_P 1.}\fi
+ \xint_orthat{\XINT_float_P 0.}1.#1.#2.#3%
+}%
+\def\XINT_float_P #1.#2.#3.#4.#5#6#7#8#9%
+{%
+ \expandafter #9\expandafter#1%
+ \the\numexpr #2-#6+#4-\xint_c_i.{#7}{#5}{#8}{#3}%
+}%
+\def\XINT_float_Q #1%
+{%
+ \if 1#1\expandafter\XINT_float_Ri\else\expandafter\XINT_float_Rii\fi
+}%
+\def\XINT_float_Ri #1.#2#3%
+{%
+ \expandafter\XINT_float_Sa
+ \romannumeral0\XINT_dsx_addzerosnofuss {#1}{#2}\Z {#1}%
+}%
+\def\XINT_float_Rii #1.#2#3%
+{%
+ \expandafter\XINT_float_Sa
+ \romannumeral0\xintiiquo{\XINT_dsx_addzerosnofuss {#1}{#2}}{#3}\Z {#1}%
+}%
+\def\XINT_float_Sa #1%
+{%
+ \if #19\xint_dothis {\XINT_float_Sb\XINT_float_Wb }\fi
+ \xint_orthat {\XINT_float_Sb\XINT_float_Wa }#1%
+}%
+\def\XINT_float_Sb #1#2\Z #3#4%
+{%
+ \expandafter\XINT_float_T
+ \the\numexpr #4+\xint_c_i\expandafter.%
+ \romannumeral`&&@\XINT_lenrord_loop 0.{}#2\Z\W\W\W\W\W\W\W\Z #1{#3}{#4}%
+}%
+\def\XINT_float_T #1.#2.#3%
+{%
+ \ifnum #2>#1 \xint_dothis{\XINT_float_U\XINT_float_Xb}\fi
+ \xint_orthat{\XINT_float_U\XINT_float_Xa #3}%
+}%
+\def\XINT_float_U #1#2%
+{%
+ \ifnum #2<\xint_c_v
+ \expandafter\XINT_float_Va
+ \else
+ \expandafter\XINT_float_Vb
+ \fi #1%
+}%
+\def\XINT_float_Va #1#2\Z #3%
+{%
+ \expandafter#1%
+ \romannumeral0\expandafter\XINT_float_Wa
+ \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 \Z
+}%
+\def\XINT_float_Vb #1#2\Z #3%
+{%
+ \expandafter #1%
+ \romannumeral0\expandafter #3%
+ \romannumeral0\XINT_addm_A 0{}1000\W\X\Y\Z #2000\W\X\Y\Z \Z
+}%
+\def\XINT_float_Wa #1{ #1.}%
+\def\XINT_float_Wb #1#2{\if #11\xint_dothis{ 10.}\fi\xint_orthat{ #1.#2}}%
+\def\XINT_float_Xa #1\Z #2#3#4%
+{%
+ \expandafter\XINT_float_Y\the\numexpr #3+#4-#2.{#1}%
+}%
+\def\XINT_float_Xb #1\Z #2#3#4%
+{%
+ \expandafter\XINT_float_Y\the\numexpr #3+#4+\xint_c_i-#2.{#1}%
+}%
+\def\XINT_float_Y #1.#2{ #2e#1}%
+\def\XINTinFloat {\romannumeral0\XINTinfloat }%
+\def\XINTinfloat [#1]#2%
+{%
+ \expandafter\XINT_infloat\the\numexpr #1\expandafter.%
+ \romannumeral0\expandafter\XINT_infloat_in
+ \romannumeral`&&@#2/\XINT_W[\XINT_W\XINT_T\XINT_infloat_Q
+}%
+\def\XINT_infloat #1.#2{#2#1.}%
+\def\XINT_infloat_in #1[#2%
+{%
+ \xint_UDXINTWfork
+ #2\XINT_infloat_gen
+ \XINT_W\XINT_infloat_res_a
+ \krof
+ #1[#2%
+}%
+\edef\XINT_infloat_gen {\noexpand\expandafter\space\noexpand\expandafter
+ \noexpand\XINT_infloat_a
+ \noexpand\romannumeral0\noexpand\XINT_frac_gen }%
+\def\XINT_infloat_res_a #1%
+{%
+ \xint_gob_til_zero #1\XINT_infloat_res_zero 0\XINT_infloat_res_b #1%
+}%
+\def\XINT_infloat_res_zero #1\XINT_infloat_Q { \XINT_infloat_sp_zero}%
+\def\XINT_infloat_sp_zero #1.{ 0[0]}%
+\def\XINT_infloat_res_b #1/#2%
+{%
+ \xint_UDXINTWfork
+ #2\XINT_infloat_res_ca
+ \XINT_W\XINT_infloat_res_cb
+ \krof
+ #1/#2%
+}%
+\def\XINT_infloat_res_ca #1[#2]/\XINT_W[\XINT_W\XINT_T\XINT_infloat_Q
+ { \XINT_infloat_sp #1.#2.}%
+\def\XINT_infloat_res_cb #1/#2[%
+ {\expandafter\XINT_infloat_res_cc\romannumeral`&&@#2~#1[}%
+\edef\XINT_infloat_res_cc #1~#2[#3]/\XINT_W[\XINT_W\XINT_T
+ {\noexpand\expandafter\space\noexpand\expandafter
+ \noexpand\XINT_infloat_a\noexpand\expandafter
+ {\noexpand\the\numexpr #3}{#2}{#1}}%
+\def\XINT_infloat_sp #1.#2%
+{%
+ \if-#2\xint_dothis{\expandafter-\romannumeral0\XINT_infloat_sp_a {}}\fi
+ \xint_orthat{\XINT_infloat_sp_a #2}#1.%
+}%
+\def\XINT_infloat_sp_a #1#2.#3.%
+{%
+ \expandafter\XINT_infloat_sp_b\the\numexpr#2-\xintLength{#1#3}.#1#3.#2.%
+}%
+\def\XINT_infloat_sp_b #1%
+{%
+ \xint_UDzerominusfork
+ #1-\XINT_infloat_sp_quick
+ 0#1\XINT_infloat_sp_c
+ 0-{\XINT_infloat_sp_addzeroes #1}%
+ \krof
+}%
+\def\XINT_infloat_sp_quick .#1.#2.#3.{ #1[#3]}%
+\def\XINT_infloat_sp_addzeroes #1.#2.#3.#4.%
+{%
+ \expandafter\XINT_infloat_sp_done
+ \the\numexpr #4-#1\expandafter.%
+ \romannumeral0\XINT_dsx_addzerosnofuss {#1}{#2};%
+}%
+\def\XINT_infloat_sp_done #1.#2;{ #2[#1]}%
+\def\XINT_infloat_sp_c #1.#2%
+{%
+ \if #29\xint_dothis {\XINT_infloat_sp_d\XINT_infloat_Wb }\fi
+ \xint_orthat {\XINT_infloat_sp_d\xint_c_ }#1.#2%
+}%
+\def\XINT_infloat_sp_d #1#2.#3.#4.%#5.%
+{%
+ \expandafter\XINT_infloat_sp_e
+ \romannumeral0\expandafter\XINT_split_fromleft_loop
+ \the\numexpr #4+\xint_c_i.{}#3\W\W\W\W\W\W\W\W\Z #1#2.%
+}%
+\def\XINT_infloat_sp_e #1.#2.%
+{%
+ \expandafter\XINT_infloat_sp_f
+ \romannumeral0\XINT_rord_main {}#1%
+ \xint_relax
+ \xint_bye\xint_bye\xint_bye\xint_bye
+ \xint_bye\xint_bye\xint_bye\xint_bye
+ \xint_relax ;%
+}%
+\def\XINT_infloat_sp_f #1%
+{%
+ \ifnum #1<\xint_c_v
+ \expandafter\XINT_infloat_sp_ga\else\expandafter\XINT_infloat_sp_h\fi
+}%
+\def\XINT_infloat_sp_ga #1;#2#3.#4.%
+{%
+ \expandafter\XINT_infloat_sp_done\the\numexpr #3+#4\expandafter.%
+ \romannumeral0\XINT_rord_main {}#1%
+ \xint_relax
+ \xint_bye\xint_bye\xint_bye\xint_bye
+ \xint_bye\xint_bye\xint_bye\xint_bye
+ \xint_relax ;%
+}%
+\def\XINT_infloat_sp_h #1;#2%
+{%
+ \expandafter\XINT_infloat_sp_i
+ \romannumeral0\expandafter#2%
+ \romannumeral0\XINT_addm_A 0{}1000\W\X\Y\Z #1000\W\X\Y\Z;%
+}%
+\def\XINT_infloat_sp_i #1#2;#3.#4.%
+{%
+ \expandafter\XINT_infloat_sp_done\the\numexpr #1+#3+#4.#2;%
+}%
+\def\XINT_infloat_a #1.#2#3% #1=P, #2=n, #3=A, #4=B
+{%
+ \XINT_infloat_fork #3\Z {#1}{#2}% #1 = precision, #2=n
+}%
+\def\XINT_infloat_fork #1%
+{%
+ \xint_UDzerominusfork
+ #1-\XINT_infloat_zero
+ 0#1\XINT_infloat_J
+ 0-{\XINT_float_K #1}%
+ \krof
+}%
+\def\XINT_infloat_zero #1\Z #2#3#4#5{ 0[0]}%
+\def\XINT_infloat_J {\expandafter-\romannumeral0\XINT_float_K }%
+\def\XINT_infloat_Q #1%
+{%
+ \if 1#1\expandafter\XINT_infloat_Ri\else\expandafter\XINT_infloat_Rii\fi
+}%
+\def\XINT_infloat_Ri #1.#2#3%
+{%
+ \expandafter\XINT_infloat_Sa
+ \romannumeral0\XINT_dsx_addzerosnofuss {#1}{#2}\Z {#1}%
+}%
+\def\XINT_infloat_Rii #1.#2#3%
+{%
+ \expandafter\XINT_infloat_Sa
+ \romannumeral0\xintiiquo{\XINT_dsx_addzerosnofuss {#1}{#2}}{#3}\Z {#1}%
+}%
+\def\XINT_infloat_Sa #1%
+{%
+ \if #19\xint_dothis {\XINT_infloat_Sb\XINT_infloat_Wb }\fi
+ \xint_orthat {\XINT_infloat_Sb\xint_c_ }#1%
+}%
+\def\XINT_infloat_Sb #1#2\Z #3#4%
+{%
+ \expandafter\XINT_infloat_T
+ \the\numexpr #4+\xint_c_i\expandafter.%
+ \romannumeral`&&@\XINT_lenrord_loop 0.{}#2\Z\W\W\W\W\W\W\W\Z #1{#3}%
+}%
+\def\XINT_infloat_T #1.#2.#3%
+{%
+ \ifnum #2>#1 \xint_dothis{\XINT_infloat_U\XINT_infloat_Xb}\fi
+ \xint_orthat{\XINT_infloat_U\XINT_infloat_Xa #3}%
+}%
+\def\XINT_infloat_U #1#2%
+{%
+ \ifnum #2<\xint_c_v
+ \expandafter\XINT_infloat_Va
+ \else
+ \expandafter\XINT_infloat_Vb
+ \fi #1%
+}%
+\def\XINT_infloat_Va #1#2\Z #3%
+{%
+ \expandafter#1%
+ \romannumeral0\expandafter\xint_c_
+ \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 \Z
+}%
+\def\XINT_infloat_Vb #1#2\Z #3%
+{%
+ \expandafter #1%
+ \romannumeral0\expandafter #3%
+ \romannumeral0\XINT_addm_A 0{}1000\W\X\Y\Z #2000\W\X\Y\Z \Z
+}%
+\def\XINT_infloat_Wb #1#2%
+ {\if #11\xint_dothis{\xint_c_i1}\fi\xint_orthat{\xint_c_#1#2}}%
+\def\XINT_infloat_Xa #1#2\Z #3#4%
+{%
+ \expandafter\XINT_infloat_Y\the\numexpr #1+\xint_c_i+#4-#3.{#2}%
+}%
+\def\XINT_infloat_Xb #1#2\Z #3#4%
+{%
+ \expandafter\XINT_infloat_Y\the\numexpr #1+\xint_c_ii+#4-#3.{#2}%
+}%
+\def\XINT_infloat_Y #1.#2{ #2[#1]}%
+\def\xintPFloat {\romannumeral0\xintpfloat }%
+\def\xintpfloat #1{\XINT_pfloat_chkopt #1\xint_relax }%
+\def\XINT_pfloat_chkopt #1%
+{%
+ \ifx [#1\expandafter\XINT_pfloat_opt
+ \else\expandafter\XINT_pfloat_noopt
+ \fi #1%
+}%
+\def\XINT_pfloat_noopt #1\xint_relax
+{%
+ \expandafter\XINT_pfloat_a
+ \romannumeral0\xintfloat [\XINTdigits]{#1};\XINTdigits.%
+}%
+\def\XINT_pfloat_opt [\xint_relax #1]%#2%
+{%
+ \expandafter\XINT_pfloat_opt_a \the\numexpr #1.%
+}%
+\def\XINT_pfloat_opt_a #1.#2%
+{%
+ \expandafter\XINT_pfloat_a\romannumeral0\xintfloat [#1]{#2};#1.%
+}%
+\def\XINT_pfloat_a #1%
+{%
+ \xint_UDzerominusfork
+ #1-\XINT_pfloat_zero
+ 0#1\XINT_pfloat_neg
+ 0-{\XINT_pfloat_pos #1}%
+ \krof
+}%
+\def\XINT_pfloat_zero #1;#2.{ 0.}%
+\def\XINT_pfloat_neg
+ {\expandafter\xint_minus_thenstop\romannumeral0\XINT_pfloat_pos }%
+\def\XINT_pfloat_pos #1e#2;#3.%
+{%
+ \ifnum #2>\xint_c_v \xint_dothis\XINT_pfloat_no\fi
+ \ifnum #2<-\xint_c_v \xint_dothis\XINT_pfloat_no\fi
+ \ifnum #2<\xint_c_ \xint_dothis\XINT_pfloat_N\fi
+ \ifnum #2>\numexpr #3-\xint_c_i\relax \xint_dothis\XINT_pfloat_Ps\fi
+ \xint_orthat\XINT_pfloat_P #1e#2;%
+}%
+\def\XINT_pfloat_no #1;{ #1}%
+\def\XINT_pfloat_N #1#2.#3e#4;%
+{%
+ \csname XINT_pfloat_N\romannumeral-#4\endcsname #2#10.#3;%
+}%
+\def\XINT_pfloat_Ni #1#2#3.#4;{ #2.#1#4}%
+\def\XINT_pfloat_Nii #1#2#3.#4;{ 0.#2#1#4}%
+\def\XINT_pfloat_Niii#1#2#3.#4;{ 0.0#2#1#4}%
+\def\XINT_pfloat_Niv #1#2#3.#4;{ 0.00#2#1#4}%
+\def\XINT_pfloat_Nv #1#2#3.#4;{ 0.000#2#1#4}%
+\def\XINT_pfloat_P #1#2.#3e#4;%
+{%
+ \csname XINT_pfloat_P_\romannumeral#4\endcsname #3.#1#2;%
+}%
+\def\XINT_pfloat_P_ #1.#2;{ #2.#1}%
+\def\XINT_pfloat_P_i #1#2.#3;{ #3#1.#2}%
+\def\XINT_pfloat_P_ii #1#2#3.#4;{ #4#1#2.#3}%
+\def\XINT_pfloat_P_iii#1#2#3#4.#5;{ #5#1#2#3.#4}%
+\def\XINT_pfloat_P_iv #1#2#3#4#5.#6;{ #6#1#2#3#4.#5}%
+\def\XINT_pfloat_P_v #1#2#3#4#5#6.#7;{ #7#1#2#3#4#5.#6}%
+\def\XINT_pfloat_Ps #1#2.#3e#4;%
+{%
+ \csname XINT_pfloat_Ps\romannumeral#4\endcsname #300000.#1#2;%
+}%
+\def\XINT_pfloat_Psi #1#2.#3;{ #3#1.}%
+\def\XINT_pfloat_Psii #1#2#3.#4;{ #4#1#2.}%
+\def\XINT_pfloat_Psiii#1#2#3#4.#5;{ #5#1#2#3.}%
+\def\XINT_pfloat_Psiv #1#2#3#4#5.#6;{ #6#1#2#3#4.}%
+\def\XINT_pfloat_Psv #1#2#3#4#5#6.#7;{ #7#1#2#3#4#5.}%
+\def\XINTinFloatFracdigits {\romannumeral0\XINTinfloatfracdigits }%
+\def\XINTinfloatfracdigits #1%
+{%
+ \expandafter\XINT_infloatfracdg_a\expandafter {\romannumeral0\xinttfrac{#1}}%
+}%
+\def\XINT_infloatfracdg_a {\XINTinfloat [\XINTdigits]}%
\def\xintFloatAdd {\romannumeral0\xintfloatadd }%
\def\xintfloatadd #1{\XINT_fladd_chkopt \xintfloat #1\xint_relax }%
\def\XINTinFloatAdd {\romannumeral0\XINTinfloatadd }%
@@ -2121,46 +2183,41 @@
}%
\def\XINT_fladd_noopt #1#2\xint_relax #3%
{%
- #1[\XINTdigits]{\XINT_FL_Add {\XINTdigits+\xint_c_ii}{#2}{#3}}%
+ #1[\XINTdigits]%
+ {\expandafter\XINT_FL_add_a
+ \romannumeral0\XINTinfloat[\XINTdigits]{#2}\XINTdigits.{#3}}%
}%
-\def\XINT_fladd_opt #1[\xint_relax #2]#3#4%
+\def\XINT_fladd_opt #1[\xint_relax #2]%#3#4%
{%
- #1[#2]{\XINT_FL_Add {#2+\xint_c_ii}{#3}{#4}}%
+ \expandafter\XINT_fladd_opt_a\the\numexpr #2.#1%
}%
-\def\XINT_FL_Add #1#2%
+\def\XINT_fladd_opt_a #1.#2#3#4%
{%
- \expandafter\XINT_FL_Add_a\expandafter{\the\numexpr #1\expandafter}%
- \expandafter{\romannumeral0\XINTinfloat [#1]{#2}}%
+ #2[#1]{\expandafter\XINT_FL_add_a\romannumeral0\XINTinfloat[#1]{#3}#1.{#4}}%
}%
-\def\XINT_FL_Add_a #1#2#3%
+\def\XINT_FL_add_a #1%
{%
- \expandafter\XINT_FL_Add_b\romannumeral0\XINTinfloat [#1]{#3}#2{#1}%
+ \xint_gob_til_zero #1\XINT_FL_add_zero 0\XINT_FL_add_b #1%
}%
-\def\XINT_FL_Add_b #1%
+\def\XINT_FL_add_zero #1.#2{#2}%
+\def\XINT_FL_add_b #1]#2.#3%
{%
- \xint_gob_til_zero #1\XINT_FL_Add_zero 0\XINT_FL_Add_c #1%
+ \expandafter\XINT_FL_add_c\romannumeral0\XINTinfloat[#2]{#3}#2.#1]%
}%
-\def\XINT_FL_Add_c #1[#2]#3%
+\def\XINT_FL_add_c #1%
{%
- \xint_gob_til_zero #3\XINT_FL_Add_zerobis 0\XINT_FL_Add_d #1[#2]#3%
+ \xint_gob_til_zero #1\XINT_FL_add_zero 0\XINT_FL_add_d #1%
}%
-\def\XINT_FL_Add_d #1[#2]#3[#4]#5%
+\def\XINT_FL_add_d #1[#2]#3.#4[#5]%
{%
- \ifnum \numexpr #2-#4-#5>\xint_c_i
- \expandafter \xint_secondofthree_thenstop
- \else
- \ifnum \numexpr #4-#2-#5>\xint_c_i
- \expandafter\expandafter\expandafter\xint_thirdofthree_thenstop
- \fi
- \fi
- \xintadd {#1[#2]}{#3[#4]}%
+ \ifnum\numexpr #2-#3-#5>\xint_c_\xint_dothis\xint_firstoftwo\fi
+ \ifnum\numexpr #5-#3-#2>\xint_c_\xint_dothis\xint_secondoftwo\fi
+ \xint_orthat\xintAdd {#1[#2]}{#4[#5]}%
}%
-\def\XINT_FL_Add_zero 0\XINT_FL_Add_c 0[0]#1[#2]#3{#1[#2]}%
-\def\XINT_FL_Add_zerobis 0\XINT_FL_Add_d #1[#2]0[0]#3{#1[#2]}%
-\def\xintFloatSub {\romannumeral0\xintfloatsub }%
+\def\xintFloatSub {\romannumeral0\xintfloatsub }%
\def\xintfloatsub #1{\XINT_flsub_chkopt \xintfloat #1\xint_relax }%
-\def\XINTinFloatSub {\romannumeral0\XINTinfloatsub }%
-\def\XINTinfloatsub #1{\XINT_flsub_chkopt \XINTinfloat #1\xint_relax }%
+\def\XINTinFloatSub {\romannumeral0\XINTinfloatsub }%
+\def\XINTinfloatsub #1{\XINT_flsub_chkopt \XINTinfloat #1\xint_relax }%
\def\XINT_flsub_chkopt #1#2%
{%
\ifx [#2\expandafter\XINT_flsub_opt
@@ -2169,14 +2226,20 @@
}%
\def\XINT_flsub_noopt #1#2\xint_relax #3%
{%
- #1[\XINTdigits]{\XINT_FL_Add {\XINTdigits+\xint_c_ii}{#2}{\xintOpp{#3}}}%
+ #1[\XINTdigits]%
+ {\expandafter\XINT_FL_add_a
+ \romannumeral0\XINTinfloat[\XINTdigits]{#2}\XINTdigits.{\xintOpp{#3}}}%
+}%
+\def\XINT_flsub_opt #1[\xint_relax #2]%#3#4%
+{%
+ \expandafter\XINT_flsub_opt_a\the\numexpr #2.#1%
}%
-\def\XINT_flsub_opt #1[\xint_relax #2]#3#4%
+\def\XINT_flsub_opt_a #1.#2#3#4%
{%
- #1[#2]{\XINT_FL_Add {#2+\xint_c_ii}{#3}{\xintOpp{#4}}}%
+ #2[#1]{\expandafter\XINT_FL_add_a\romannumeral0\XINTinfloat[#1]{#3}#1.{\xintOpp{#4}}}%
}%
-\def\xintFloatMul {\romannumeral0\xintfloatmul}%
-\def\xintfloatmul #1{\XINT_flmul_chkopt \xintfloat #1\xint_relax }%
+\def\xintFloatMul {\romannumeral0\xintfloatmul }%
+\def\xintfloatmul #1{\XINT_flmul_chkopt \xintfloat #1\xint_relax }%
\def\XINTinFloatMul {\romannumeral0\XINTinfloatmul }%
\def\XINTinfloatmul #1{\XINT_flmul_chkopt \XINTinfloat #1\xint_relax }%
\def\XINT_flmul_chkopt #1#2%
@@ -2187,26 +2250,27 @@
}%
\def\XINT_flmul_noopt #1#2\xint_relax #3%
{%
- #1[\XINTdigits]{\XINT_FL_Mul {\XINTdigits+\xint_c_ii}{#2}{#3}}%
+ #1[\XINTdigits]%
+ {\expandafter\XINT_FL_mul_a
+ \romannumeral0\XINTinfloat[\XINTdigits]{#2}\XINTdigits.{#3}}%
}%
-\def\XINT_flmul_opt #1[\xint_relax #2]#3#4%
+\def\XINT_flmul_opt #1[\xint_relax #2]%#3#4%
{%
- #1[#2]{\XINT_FL_Mul {#2+\xint_c_ii}{#3}{#4}}%
+ \expandafter\XINT_flmul_opt_a\the\numexpr #2.#1%
}%
-\def\XINT_FL_Mul #1#2%
+\def\XINT_flmul_opt_a #1.#2#3#4%
{%
- \expandafter\XINT_FL_Mul_a\expandafter{\the\numexpr #1\expandafter}%
- \expandafter{\romannumeral0\XINTinfloat [#1]{#2}}%
+ #2[#1]{\expandafter\XINT_FL_mul_a\romannumeral0\XINTinfloat[#1]{#3}#1.{#4}}%
}%
-\def\XINT_FL_Mul_a #1#2#3%
+\def\XINT_FL_mul_a #1[#2]#3.#4%
{%
- \expandafter\XINT_FL_Mul_b\romannumeral0\XINTinfloat [#1]{#3}#2%
+ \expandafter\XINT_FL_mul_b\romannumeral0\XINTinfloat [#3]{#4}#1[#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\xint_relax }%
-\def\XINTinFloatDiv {\romannumeral0\XINTinfloatdiv }%
-\def\XINTinfloatdiv #1{\XINT_fldiv_chkopt \XINTinfloat #1\xint_relax }%
+\def\XINT_FL_mul_b #1[#2]#3[#4]{\xintE{\xintiiMul {#3}{#1}}{#4+#2}}%
+\def\xintFloatDiv {\romannumeral0\xintfloatdiv }%
+\def\xintfloatdiv #1{\XINT_fldiv_chkopt \xintfloat #1\xint_relax }%
+\def\XINTinFloatDiv {\romannumeral0\XINTinfloatdiv }%
+\def\XINTinfloatdiv #1{\XINT_fldiv_chkopt \XINTinfloat #1\xint_relax }%
\def\XINT_fldiv_chkopt #1#2%
{%
\ifx [#2\expandafter\XINT_fldiv_opt
@@ -2215,23 +2279,24 @@
}%
\def\XINT_fldiv_noopt #1#2\xint_relax #3%
{%
- #1[\XINTdigits]{\XINT_FL_Div {\XINTdigits+\xint_c_ii}{#2}{#3}}%
+ #1[\XINTdigits]%
+ {\expandafter\XINT_FL_div_a
+ \romannumeral0\XINTinfloat[\XINTdigits]{#2}\XINTdigits.{#3}}%
}%
-\def\XINT_fldiv_opt #1[\xint_relax #2]#3#4%
+\def\XINT_fldiv_opt #1[\xint_relax #2]%#3#4%
{%
- #1[#2]{\XINT_FL_Div {#2+\xint_c_ii}{#3}{#4}}%
+ \expandafter\XINT_fldiv_opt_a\the\numexpr #2.#1%
}%
-\def\XINT_FL_Div #1#2%
+\def\XINT_fldiv_opt_a #1.#2#3#4%
{%
- \expandafter\XINT_FL_Div_a\expandafter{\the\numexpr #1\expandafter}%
- \expandafter{\romannumeral0\XINTinfloat [#1]{#2}}%
+ #2[#1]{\expandafter\XINT_FL_div_a\romannumeral0\XINTinfloat[#1]{#3}#1.{#4}}%
}%
-\def\XINT_FL_Div_a #1#2#3%
+\def\XINT_FL_div_a #1[#2]#3.#4%
{%
- \expandafter\XINT_FL_Div_b\romannumeral0\XINTinfloat [#1]{#3}#2%
+ \expandafter\XINT_FL_div_b\romannumeral0\XINTinfloat[#3]{#4}#1[#2]%
}%
-\def\XINT_FL_Div_b #1[#2]#3[#4]{\xintE{#3/#1}{#4-#2}}%
-\def\xintFloatPow {\romannumeral0\xintfloatpow}%
+\def\XINT_FL_div_b #1[#2]#3[#4]{\xintE{#3/#1}{#4-#2}}%
+\def\xintFloatPow {\romannumeral0\xintfloatpow}%
\def\xintfloatpow #1{\XINT_flpow_chkopt \xintfloat #1\xint_relax }%
\def\XINTinFloatPow {\romannumeral0\XINTinfloatpow }%
\def\XINTinfloatpow #1{\XINT_flpow_chkopt \XINTinfloat #1\xint_relax }%
@@ -2240,253 +2305,302 @@
\ifx [#2\expandafter\XINT_flpow_opt
\else\expandafter\XINT_flpow_noopt
\fi
- #1#2%
+ #1#2%
}%
\def\XINT_flpow_noopt #1#2\xint_relax #3%
{%
- \expandafter\XINT_flpow_checkB_start\expandafter
- {\the\numexpr #3\expandafter}\expandafter
- {\the\numexpr \XINTdigits}{#2}{#1[\XINTdigits]}%
+ \expandafter\XINT_flpow_checkB_a
+ \the\numexpr #3.\XINTdigits.{#2}{#1[\XINTdigits]}%
+}%
+\def\XINT_flpow_opt #1[\xint_relax #2]%
+{%
+ \expandafter\XINT_flpow_opt_a\the\numexpr #2.#1%
}%
-\def\XINT_flpow_opt #1[\xint_relax #2]#3#4%
+\def\XINT_flpow_opt_a #1.#2#3#4%
{%
- \expandafter\XINT_flpow_checkB_start\expandafter
- {\the\numexpr #4\expandafter}\expandafter
- {\the\numexpr #2}{#3}{#1[#2]}%
+ \expandafter\XINT_flpow_checkB_a\the\numexpr #4.#1.{#3}{#2[#1]}%
}%
-\def\XINT_flpow_checkB_start #1{\XINT_flpow_checkB_a #1\Z }%
\def\XINT_flpow_checkB_a #1%
{%
\xint_UDzerominusfork
#1-\XINT_flpow_BisZero
- 0#1{\XINT_flpow_checkB_b 1}%
- 0-{\XINT_flpow_checkB_b 0#1}%
+ 0#1{\XINT_flpow_checkB_b -}%
+ 0-{\XINT_flpow_checkB_b {}#1}%
\krof
}%
-\def\XINT_flpow_BisZero \Z #1#2#3{#3{1/1[0]}}%
-\def\XINT_flpow_checkB_b #1#2\Z #3%
+\def\XINT_flpow_BisZero .#1.#2#3{#3{1[0]}}%
+\def\XINT_flpow_checkB_b #1#2.#3.%
{%
- \expandafter\XINT_flpow_checkB_c \expandafter
- {\romannumeral0\xintlength{#2}}{#3}{#2}#1%
+ \expandafter\XINT_flpow_checkB_c
+ \the\numexpr\xintLength{#2}+\xint_c_iii.#3.#2.{#1}%
}%
-\def\XINT_flpow_checkB_c #1#2%
+\def\XINT_flpow_checkB_c #1.#2.%
{%
- \expandafter\XINT_flpow_checkB_d \expandafter
- {\the\numexpr \expandafter\xintLength\expandafter
- {\the\numexpr #1*20/\xint_c_iii }+#1+#2+\xint_c_i }%
+ \expandafter\XINT_flpow_checkB_d\the\numexpr#1+#2.#1.#2.%
}%
-\def\XINT_flpow_checkB_d #1#2#3#4%
+\def\XINT_flpow_checkB_d #1.#2.#3.#4.#5#6%
{%
- \expandafter \XINT_flpow_a
- \romannumeral0\XINTinfloat [#1]{#4}{#1}{#2}#3%
+ \expandafter \XINT_flpow_aa
+ \romannumeral0\XINTinfloat [#3]{#6}{#2}{#1}{#4}{#5}%
}%
+\def\XINT_flpow_aa #1[#2]#3%
+{%
+ \expandafter\XINT_flpow_ab\the\numexpr #2-#3\expandafter.%
+ \romannumeral0\XINT_dsx_addzerosnofuss {#3}{}.#1.%
+}%
+\def\XINT_flpow_ab #1.#2.#3.{\XINT_flpow_a #3#2[#1]}%
\def\XINT_flpow_a #1%
{%
\xint_UDzerominusfork
#1-\XINT_flpow_zero
- 0#1{\XINT_flpow_b 1}%
- 0-{\XINT_flpow_b 0#1}%
+ 0#1{\XINT_flpow_b \iftrue}%
+ 0-{\XINT_flpow_b \iffalse#1}%
\krof
}%
+\def\XINT_flpow_zero #1[#2]#3#4#5#6%
+{%
+ \if 1#51\xint_afterfi {#6{0[0]}}\else
+ \xint_afterfi {\xintError:DivisionByZero #6{1[2147483648]}}\fi
+}%
\def\XINT_flpow_b #1#2[#3]#4#5%
{%
- \XINT_flpow_loopI {#5}{#2[#3]}{\romannumeral0\XINTinfloatmul [#4]}%
- {#1*\ifodd #5 1\else 0\fi}%
+ \XINT_flpow_loopI #5.#3.#2.#4.{#1\ifodd #5 \xint_c_i\fi\fi}%
}%
-\def\XINT_flpow_zero [#1]#2#3#4#5%
+\def\XINT_flpow_truncate #1.#2.#3.%
{%
- \if #41\xint_afterfi {\xintError:DivisionByZero #5{1[2147483648]}}%
- \else \xint_afterfi {#5{0[0]}}\fi
+ \expandafter\XINT_flpow_truncate_a
+ \romannumeral0\XINT_split_fromleft_loop #3.{}#2\W\W\W\W\W\W\W\W\Z
+ #1.#3.%
}%
-\def\XINT_flpow_loopI #1%
+\def\XINT_flpow_truncate_a #1.#2.#3.{#3+\xintLength{#2}.#1.}%
+\def\XINT_flpow_loopI #1.%
{%
- \ifnum #1=\xint_c_i\XINT_flpow_ItoIII\fi
+ \ifnum #1=\xint_c_i\expandafter\XINT_flpow_ItoIII\fi
\ifodd #1
\expandafter\XINT_flpow_loopI_odd
\else
\expandafter\XINT_flpow_loopI_even
\fi
- {#1}%
+ #1.%
}%
-\def\XINT_flpow_ItoIII\fi #1\fi #2#3#4#5%
+\def\XINT_flpow_ItoIII\ifodd #1\fi #2.#3.#4.#5.#6%
{%
- \fi\expandafter\XINT_flpow_III\the\numexpr #5\relax #3%
+ \expandafter\XINT_flpow_III\the\numexpr #6+\xint_c_.#3.#4.#5.%
}%
-\def\XINT_flpow_loopI_even #1#2#3%
+\def\XINT_flpow_loopI_even #1.#2.#3.%#4.%
{%
- \expandafter\XINT_flpow_loopI\expandafter
- {\the\numexpr #1/\xint_c_ii\expandafter}\expandafter
- {#3{#2}{#2}}{#3}%
+ \expandafter\XINT_flpow_loopI
+ \the\numexpr #1/\xint_c_ii\expandafter.%
+ \the\numexpr\expandafter\XINT_flpow_truncate
+ \the\numexpr\xint_c_ii*#2\expandafter.\romannumeral0\xintiisqr{#3}.%
}%
-\def\XINT_flpow_loopI_odd #1#2#3%
+\def\XINT_flpow_loopI_odd #1.#2.#3.#4.%
{%
- \expandafter\XINT_flpow_loopII\expandafter
- {\the\numexpr #1/\xint_c_ii-\xint_c_i\expandafter}\expandafter
- {#3{#2}{#2}}{#3}{#2}%
+ \expandafter\XINT_flpow_loopII
+ \the\numexpr #1/\xint_c_ii-\xint_c_i\expandafter.%
+ \the\numexpr\expandafter\XINT_flpow_truncate
+ \the\numexpr\xint_c_ii*#2\expandafter.\romannumeral0\xintiisqr{#3}.#4.#2.#3.%
}%
-\def\XINT_flpow_loopII #1%
+\def\XINT_flpow_loopII #1.%
{%
- \ifnum #1 = \xint_c_i\XINT_flpow_IItoIII\fi
+ \ifnum #1 = \xint_c_i\expandafter\XINT_flpow_IItoIII\fi
\ifodd #1
\expandafter\XINT_flpow_loopII_odd
\else
\expandafter\XINT_flpow_loopII_even
\fi
- {#1}%
+ #1.%
}%
-\def\XINT_flpow_loopII_even #1#2#3%
+\def\XINT_flpow_loopII_even #1.#2.#3.%#4.%
{%
- \expandafter\XINT_flpow_loopII\expandafter
- {\the\numexpr #1/\xint_c_ii\expandafter}\expandafter
- {#3{#2}{#2}}{#3}%
+ \expandafter\XINT_flpow_loopII
+ \the\numexpr #1/\xint_c_ii\expandafter.%
+ \the\numexpr\expandafter\XINT_flpow_truncate
+ \the\numexpr\xint_c_ii*#2\expandafter.\romannumeral0\xintiisqr{#3}.%
}%
-\def\XINT_flpow_loopII_odd #1#2#3#4%
+\def\XINT_flpow_loopII_odd #1.#2.#3.#4.#5.#6.%
{%
- \expandafter\XINT_flpow_loopII_odda\expandafter
- {#3{#2}{#4}}{#1}{#2}{#3}%
+ \expandafter\XINT_flpow_loopII_odda
+ \the\numexpr\expandafter\XINT_flpow_truncate
+ \the\numexpr#2+#5\expandafter.\romannumeral0\xintiimul{#3}{#6}.#4.%
+ #1.#2.#3.%
}%
-\def\XINT_flpow_loopII_odda #1#2#3#4%
+\def\XINT_flpow_loopII_odda #1.#2.#3.#4.#5.#6.%
{%
- \expandafter\XINT_flpow_loopII\expandafter
- {\the\numexpr #2/\xint_c_ii-\xint_c_i\expandafter}\expandafter
- {#4{#3}{#3}}{#4}{#1}%
+ \expandafter\XINT_flpow_loopII
+ \the\numexpr #4/\xint_c_ii-\xint_c_i\expandafter.%
+ \the\numexpr\expandafter\XINT_flpow_truncate
+ \the\numexpr\xint_c_ii*#5\expandafter.\romannumeral0\xintiisqr{#6}.#3.%
+ #1.#2.%
}%
-\def\XINT_flpow_IItoIII\fi #1\fi #2#3#4#5#6%
+\def\XINT_flpow_IItoIII\ifodd #1\fi #2.#3.#4.#5.#6.#7.#8%
{%
- \fi\expandafter\XINT_flpow_III\the\numexpr #6\expandafter\relax
- #4{#3}{#5}%
+ \expandafter\XINT_flpow_III\the\numexpr #8+\xint_c_\expandafter.%
+ \the\numexpr\expandafter\XINT_flpow_truncate
+ \the\numexpr#3+#6\expandafter.\romannumeral0\xintiimul{#4}{#7}.#5.%
}%
-\def\XINT_flpow_III #1#2[#3]#4%
+\def\XINT_flpow_III #1.#2.#3.#4.#5%
{%
- \expandafter\XINT_flpow_IIIend\expandafter
- {\the\numexpr\if #41-\fi#3\expandafter}%
- \xint_UDzerofork
- #4{{#2}}%
- 0{{1/#2}}%
+ \expandafter\XINT_flpow_IIIend
+ \xint_UDsignfork
+ #5{{\xintNum{1/#3[\xint_c_ii*#4-\xint_c_i]}[\xint_c_i-\xint_c_ii*#4-#2]}}%
+ -{{#3[#2]}}%
\krof #1%
}%
-\def\XINT_flpow_IIIend #1#2#3#4%
-{%
- \xint_UDzerofork
- #3{#4{#2[#1]}}%
- 0{#4{-#2[#1]}}%
- \krof
-}%
-\def\xintFloatPower {\romannumeral0\xintfloatpower}%
+\def\XINT_flpow_IIIend #1#2#3%
+ {#3{\if#21\xint_afterfi{\expandafter-\romannumeral`&&@}\fi#1}}%
+\def\xintFloatPower {\romannumeral0\xintfloatpower}%
\def\xintfloatpower #1{\XINT_flpower_chkopt \xintfloat #1\xint_relax }%
-\def\XINTinFloatPower {\romannumeral0\XINTinfloatpower}%
+\def\XINTinFloatPower {\romannumeral0\XINTinfloatpower }%
\def\XINTinfloatpower #1{\XINT_flpower_chkopt \XINTinfloat #1\xint_relax }%
+\def\XINTinFloatPowerH {\romannumeral0\XINTinfloatpowerH }%
+\def\XINTinfloatpowerH #1#2%
+ {\expandafter\XINT_flpowerh_a \romannumeral0\xinttrunc 1{#2}.0;%
+ \XINTdigits.{#1}{\XINTinfloat[\XINTdigits]}}%
+\def\XINT_flpowerh_a #1.#2%
+{%
+ \ifnum#2>\xint_c_iv\xint_dothis\XINT_flpowerh_b\fi
+ \xint_orthat\XINT_flpowerh_i #1.#2%
+}%
+\def\XINT_flpowerh_i #1.#2;%
+ {\expandafter\XINT_flpower_checkB_a\romannumeral0\xintinum{#1}.}%
+\def\XINT_flpowerh_b #1%
+{%
+ \if#1-\xint_dothis\XINT_flpowerh_bneg\fi
+ \xint_orthat{\XINT_flpowerh_bpos #1}%
+}%
+\def\XINT_flpowerh_bpos #1.#2;\XINTdigits.#3#4%
+{%
+ \expandafter\XINT_flpower_checkB_a
+ \romannumeral0\xintinc{\xintDouble{#1}}.%
+ \XINTdigits.{#3}{\XINTinfloatsqrt[\XINTdigits]}%
+}%
+\def\XINT_flpowerh_bneg #1.#2;\XINTdigits.#3#4%
+{%
+ \expandafter\XINT_flpower_checkB_a
+ \expandafter-\romannumeral0\xintinc{\xintDouble{#1}}.%
+ \XINTdigits.{#3}{\XINTinfloatsqrt[\XINTdigits]}%
+}%
\def\XINT_flpower_chkopt #1#2%
{%
\ifx [#2\expandafter\XINT_flpower_opt
\else\expandafter\XINT_flpower_noopt
\fi
- #1#2%
+ #1#2%
}%
\def\XINT_flpower_noopt #1#2\xint_relax #3%
{%
- \expandafter\XINT_flpower_checkB_start\expandafter
- {\the\numexpr \XINTdigits\expandafter}\expandafter
- {\romannumeral0\xintnum{#3}}{#2}{#1[\XINTdigits]}%
+ \expandafter\XINT_flpower_checkB_a
+ \romannumeral0\xintnum{#3}.\XINTdigits.{#2}{#1[\XINTdigits]}%
}%
-\def\XINT_flpower_opt #1[\xint_relax #2]#3#4%
+\def\XINT_flpower_opt #1[\xint_relax #2]%
{%
- \expandafter\XINT_flpower_checkB_start\expandafter
- {\the\numexpr #2\expandafter}\expandafter
- {\romannumeral0\xintnum{#4}}{#3}{#1[#2]}%
+ \expandafter\XINT_flpower_opt_a\the\numexpr #2.#1%
+}%
+\def\XINT_flpower_opt_a #1.#2#3#4%
+{%
+ \expandafter\XINT_flpower_checkB_a
+ \romannumeral0\xintnum{#4}.#1.{#3}{#2[#1]}%
}%
-\def\XINT_flpower_checkB_start #1#2{\XINT_flpower_checkB_a #2\Z {#1}}%
\def\XINT_flpower_checkB_a #1%
{%
\xint_UDzerominusfork
#1-\XINT_flpower_BisZero
- 0#1{\XINT_flpower_checkB_b 1}%
- 0-{\XINT_flpower_checkB_b 0#1}%
+ 0#1{\XINT_flpower_checkB_b -}%
+ 0-{\XINT_flpower_checkB_b {}#1}%
\krof
}%
-\def\XINT_flpower_BisZero \Z #1#2#3{#3{1/1[0]}}%
-\def\XINT_flpower_checkB_b #1#2\Z #3%
+\def\XINT_flpower_BisZero .#1.#2#3{#3{1[0]}}%
+\def\XINT_flpower_checkB_b #1#2.#3.%
+{%
+ \expandafter\XINT_flpower_checkB_c
+ \the\numexpr\xintLength{#2}+\xint_c_iii.#3.#2.{#1}%
+}%
+\def\XINT_flpower_checkB_c #1.#2.%
{%
- \expandafter\XINT_flpower_checkB_c \expandafter
- {\romannumeral0\xintlength{#2}}{#3}{#2}#1%
+ \expandafter\XINT_flpower_checkB_d\the\numexpr#1+#2.#1.#2.%
}%
-\def\XINT_flpower_checkB_c #1#2%
+\def\XINT_flpower_checkB_d #1.#2.#3.#4.#5#6%
{%
- \expandafter\XINT_flpower_checkB_d \expandafter
- {\the\numexpr \expandafter\xintLength\expandafter
- {\the\numexpr #1*20/\xint_c_iii }+#1+#2+\xint_c_i }%
+ \expandafter \XINT_flpower_aa
+ \romannumeral0\XINTinfloat [#3]{#6}{#2}{#1}{#4}{#5}%
}%
-\def\XINT_flpower_checkB_d #1#2#3#4%
+\def\XINT_flpower_aa #1[#2]#3%
{%
- \expandafter \XINT_flpower_a
- \romannumeral0\XINTinfloat [#1]{#4}{#1}{#2}#3%
+ \expandafter\XINT_flpower_ab\the\numexpr #2-#3\expandafter.%
+ \romannumeral0\XINT_dsx_addzerosnofuss {#3}{}.#1.%
}%
+\def\XINT_flpower_ab #1.#2.#3.{\XINT_flpower_a #3#2[#1]}%
\def\XINT_flpower_a #1%
{%
\xint_UDzerominusfork
#1-\XINT_flpow_zero
- 0#1{\XINT_flpower_b 1}%
- 0-{\XINT_flpower_b 0#1}%
+ 0#1{\XINT_flpower_b \iftrue}%
+ 0-{\XINT_flpower_b \iffalse#1}%
\krof
}%
\def\XINT_flpower_b #1#2[#3]#4#5%
{%
- \XINT_flpower_loopI {#5}{#2[#3]}{\romannumeral0\XINTinfloatmul [#4]}%
- {#1*\xintiiOdd {#5}}%
+ \XINT_flpower_loopI #5.#3.#2.#4.{#1\xintiiOdd{#5}\fi}%
}%
-\def\XINT_flpower_loopI #1%
+\def\XINT_flpower_loopI #1.%
{%
- \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}}%
+ \if1\XINT_isOne {#1}\xint_dothis\XINT_flpower_ItoIII\fi
+ \if1\xintiiOdd {#1}\xint_dothis{\expandafter\XINT_flpower_loopI_odd}\fi
+ \xint_orthat{\expandafter\XINT_flpower_loopI_even}%
+ \romannumeral0\xinthalf{#1}.%
}%
-\def\XINT_flpower_ItoIII\fi #1\fi\expandafter #2#3#4#5%
+\def\XINT_flpower_ItoIII #1.#2.#3.#4.#5%
{%
- \fi\expandafter\XINT_flpow_III \the\numexpr #5\relax #3%
+ \expandafter\XINT_flpow_III\the\numexpr #5+\xint_c_.#2.#3.#4.%
}%
-\def\XINT_flpower_loopI_even #1#2#3%
+\def\XINT_flpower_loopI_even #1.#2.#3.#4.%
{%
- \expandafter\XINT_flpower_toI\expandafter {#3{#2}{#2}}{#1}{#3}%
+ \expandafter\XINT_flpower_toloopI
+ \the\numexpr\expandafter\XINT_flpow_truncate
+ \the\numexpr\xint_c_ii*#2\expandafter.\romannumeral0\xintiisqr{#3}.#4.#1.%
}%
-\def\XINT_flpower_loopI_odd #1#2#3%
+\def\XINT_flpower_toloopI #1.#2.#3.#4.{\XINT_flpower_loopI #4.#1.#2.#3.}%
+\def\XINT_flpower_loopI_odd #1.#2.#3.#4.%
{%
- \expandafter\XINT_flpower_toII\expandafter {#3{#2}{#2}}{#1}{#3}{#2}%
+ \expandafter\XINT_flpower_toloopII
+ \the\numexpr\expandafter\XINT_flpow_truncate
+ \the\numexpr\xint_c_ii*#2\expandafter.\romannumeral0\xintiisqr{#3}.#4.%
+ #1.#2.#3.%
}%
-\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%
+\def\XINT_flpower_toloopII #1.#2.#3.#4.{\XINT_flpower_loopII #4.#1.#2.#3.}%
+\def\XINT_flpower_loopII #1.%
{%
- \if1\XINT_isOne {#1}\XINT_flpower_IItoIII\fi
- \if1\xintiiOdd{#1}%
- \expandafter\expandafter\expandafter\XINT_flpower_loopII_odd
- \else
- \expandafter\expandafter\expandafter\XINT_flpower_loopII_even
- \fi
- \expandafter {\romannumeral0\xinthalf{#1}}%
+ \if1\XINT_isOne{#1}\xint_dothis\XINT_flpower_IItoIII\fi
+ \if1\xintiiOdd{#1}\xint_dothis{\expandafter\XINT_flpower_loopII_odd}\fi
+ \xint_orthat{\expandafter\XINT_flpower_loopII_even}%
+ \romannumeral0\xinthalf{#1}.%
}%
-\def\XINT_flpower_loopII_even #1#2#3%
+\def\XINT_flpower_loopII_even #1.#2.#3.#4.%
{%
- \expandafter\XINT_flpower_toII\expandafter
- {#3{#2}{#2}}{#1}{#3}%
+ \expandafter\XINT_flpower_toloopII
+ \the\numexpr\expandafter\XINT_flpow_truncate
+ \the\numexpr\xint_c_ii*#2\expandafter.\romannumeral0\xintiisqr{#3}.#4.#1.%
}%
-\def\XINT_flpower_loopII_odd #1#2#3#4%
+\def\XINT_flpower_loopII_odd #1.#2.#3.#4.#5.#6.%
{%
- \expandafter\XINT_flpower_loopII_odda\expandafter
- {#3{#2}{#4}}{#2}{#3}{#1}%
+ \expandafter\XINT_flpower_loopII_odda
+ \the\numexpr\expandafter\XINT_flpow_truncate
+ \the\numexpr#2+#5\expandafter.\romannumeral0\xintiimul{#3}{#6}.#4.%
+ #1.#2.#3.%
}%
-\def\XINT_flpower_loopII_odda #1#2#3#4%
+\def\XINT_flpower_loopII_odda #1.#2.#3.#4.#5.#6.%
{%
- \expandafter\XINT_flpower_toII\expandafter
- {#3{#2}{#2}}{#4}{#3}{#1}%
+ \expandafter\XINT_flpower_toloopII
+ \the\numexpr\expandafter\XINT_flpow_truncate
+ \the\numexpr\xint_c_ii*#5\expandafter.\romannumeral0\xintiisqr{#6}.#3.%
+ #4.#1.#2.%
}%
-\def\XINT_flpower_IItoIII\fi #1\fi\expandafter #2#3#4#5#6%
+\def\XINT_flpower_IItoIII #1.#2.#3.#4.#5.#6.#7%
{%
- \fi\expandafter\XINT_flpow_III\the\numexpr #6\expandafter\relax
- #4{#3}{#5}%
+ \expandafter\XINT_flpow_III\the\numexpr #7+\xint_c_\expandafter.%
+ \the\numexpr\expandafter\XINT_flpow_truncate
+ \the\numexpr#2+#5\expandafter.\romannumeral0\xintiimul{#3}{#6}.#4.%
}%
\def\xintFloatFac {\romannumeral0\xintfloatfac}%
\def\xintfloatfac #1{\XINT_flfac_chkopt \xintfloat #1\xint_relax }%
@@ -2501,53 +2615,63 @@
}%
\def\XINT_flfac_noopt #1#2\xint_relax
{%
- \expandafter\XINT_FL_fac_start\expandafter
- {\the\numexpr \xintNum{#2}}{\XINTdigits}{#1[\XINTdigits]}%
+ \expandafter\XINT_FL_fac_fork_a
+ \the\numexpr \xintNum{#2}.\xint_c_i \XINTdigits\XINT_FL_fac_out{#1[\XINTdigits]}%
}%
-\def\XINT_flfac_opt #1[\xint_relax #2]#3%
+\def\XINT_flfac_opt #1[\xint_relax #2]%
{%
- \expandafter\XINT_FL_fac_start\expandafter
- {\the\numexpr \xintNum{#3}\expandafter}\expandafter{\the\numexpr#2}{#1[#2]}%
+ \expandafter\XINT_flfac_opt_a\the\numexpr #2.#1%
}%
-\def\XINT_FL_fac_start #1%
+\def\XINT_flfac_opt_a #1.#2#3%
{%
- \ifcase\XINT_cntSgn #1\Z
- \expandafter\XINT_FL_fac_iszero
- \or
- \expandafter\XINT_FL_fac_increaseP
- \else
- \expandafter\XINT_FL_fac_isneg
- \fi {#1}%
+ \expandafter\XINT_FL_fac_fork_a\the\numexpr \xintNum{#3}.\xint_c_i {#1}\XINT_FL_fac_out{#2[#1]}%
}%
-\def\XINT_FL_fac_iszero #1#2#3{#3{1/1[0]}}%
-\def\XINT_FL_fac_isneg #1#2#3%
- {\expandafter\xintError:FactorialOfNegativeNumber #3{1/1[0]}}%
-\def\XINT_FL_fac_increaseP #1#2%
+\def\XINT_FL_fac_fork_a #1%
{%
- \expandafter\XINT_FL_fac_fork
- \the\numexpr \xint_c_viii*%
- ((\xint_c_v+#2+\XINT_FL_fac_extradigits #187654321\Z)/\xint_c_viii).%
- #1.%
+ \xint_UDzerominusfork
+ #1-\XINT_FL_fac_iszero
+ 0#1\XINT_FL_fac_isneg
+ 0-{\XINT_FL_fac_fork_b #1}%
+ \krof
}%
-\def\XINT_FL_fac_extradigits #1#2#3#4#5#6#7#8{\XINT_FL_fac_extra_a }%
-\def\XINT_FL_fac_extra_a #1#2\Z {#1}%
-\def\XINT_FL_fac_fork #1.#2.#3%
+\def\XINT_FL_fac_iszero #1.#2#3#4#5{#5{1/1[0]}}%
+\def\XINT_FL_fac_isneg #1.#2#3#4#5{\expandafter\xintError:FactorialOfNegative #5{0/1[0]}}%
+\def\XINT_FL_fac_fork_b #1.%
{%
- \ifnum #2>99999999 \xint_dothis{\XINT_FL_fac_toobig }\fi
- \ifnum #2>9999 \xint_dothis{\XINT_FL_fac_vbigloop_a }\fi
- \ifnum #2>465 \xint_dothis{\XINT_FL_fac_bigloop_a }\fi
- \ifnum #2>101 \xint_dothis{\XINT_FL_fac_medloop_a }\fi
- \xint_orthat{\XINT_FL_fac_smallloop_a }%
- #2.#1.{\XINT_FL_fac_out}{#3}%
+ \ifnum #1>\xint_c_x^viii_mone\xint_dothis\XINT_FL_fac_toobig\fi
+ \ifnum #1>\xint_c_x^iv\xint_dothis\XINT_FL_fac_vbig \fi
+ \ifnum #1>465 \xint_dothis\XINT_FL_fac_big\fi
+ \ifnum #1>101 \xint_dothis\XINT_FL_fac_med\fi
+ \xint_orthat\XINT_FL_fac_small
+ #1.%
}%
-\def\XINT_FL_fac_toobig #1.#2.#3#4%
- {\expandafter\xintError:FactorialOfTooBigNumber #4{1/1[0]}}%
+\def\XINT_FL_fac_toobig #1.#2#3#4#5{\expandafter\xintError:TooBigFactorial #5{1/1[0]}}%
+\def\XINT_FL_fac_vbig
+ {\expandafter\XINT_FL_fac_vbigloop_a
+ \the\numexpr \XINT_FL_fac_increaseP \xint_c_i }%
+\def\XINT_FL_fac_big
+ {\expandafter\XINT_FL_fac_bigloop_a
+ \the\numexpr \XINT_FL_fac_increaseP \xint_c_ii }%
+\def\XINT_FL_fac_med
+ {\expandafter\XINT_FL_fac_medloop_a
+ \the\numexpr \XINT_FL_fac_increaseP \xint_c_iii }%
+\def\XINT_FL_fac_small
+ {\expandafter\XINT_FL_fac_smallloop_a
+ \the\numexpr \XINT_FL_fac_increaseP \xint_c_iv }%
+\def\XINT_FL_fac_increaseP #1#2.#3#4%
+{%
+ #2\expandafter.\the\numexpr\xint_c_viii*%
+ ((\xint_c_iv+#4+\expandafter\XINT_FL_fac_countdigits
+ \the\numexpr #2/(#1*#3)\relax 87654321\Z)/\xint_c_viii).%
+}%
+\def\XINT_FL_fac_countdigits #1#2#3#4#5#6#7#8{\XINT_FL_fac_countdone }%
+\def\XINT_FL_fac_countdone #1#2\Z {#1}%
\def\XINT_FL_fac_out #1\Z![#2]#3{#3{\romannumeral0\XINT_mul_out
#1\Z!1\R!1\R!1\R!1\R!1\R!1\R!1\R!1\R!\W [#2]}}%
\def\XINT_FL_fac_vbigloop_a #1.#2.%
{%
- \XINT_FL_fac_bigloop_a 9999.#2.%
- {\expandafter\XINT_FL_fac_vbigloop_loop\the\numexpr 100010000\expandafter.%
+ \XINT_FL_fac_bigloop_a \xint_c_x^iv.#2.%
+ {\expandafter\XINT_FL_fac_vbigloop_loop\the\numexpr 100010001\expandafter.%
\the\numexpr \xint_c_x^viii+#1.}%
}%
\def\XINT_FL_fac_vbigloop_loop #1.#2.%
@@ -2629,8 +2753,7 @@
\ifnum #1=\xint_c_viii \expandafter\XINT_FL_fac_addzeros_exit\fi
\expandafter\XINT_FL_fac_addzeros\the\numexpr #1-\xint_c_viii.100000000!%
}%
-\def\XINT_FL_fac_addzeros_exit #1.#2.#3#4%
- {\XINT_FL_fac_smallloop_loop #3#21\Z![-#4]}%
+\def\XINT_FL_fac_addzeros_exit #1.#2.#3#4{\XINT_FL_fac_smallloop_loop #3#21\Z![-#4]}%
\def\XINT_FL_fac_smallloop_loop #1.#2.%
{%
\ifnum #1>#2 \expandafter\XINT_FL_fac_loop_exit\fi
@@ -2691,183 +2814,346 @@
{1#2\expandafter!\expandafter-\expandafter1\expandafter
[\the\numexpr #4+\xint_c_viii]}%
}%
-\def\xintFloatSqrt {\romannumeral0\xintfloatsqrt }%
-\def\xintfloatsqrt #1{\XINT_flsqrt_chkopt \xintfloat #1\xint_relax }%
-\def\XINTinFloatSqrt {\romannumeral0\XINTinfloatsqrt }%
-\def\XINTinfloatsqrt #1{\XINT_flsqrt_chkopt \XINTinfloat #1\xint_relax }%
-\def\XINT_flsqrt_chkopt #1#2%
+\def\xintFloatPFactorial {\romannumeral0\xintfloatpfactorial}%
+\def\xintfloatpfactorial #1{\XINT_flpfac_chkopt \xintfloat #1\xint_relax }%
+\def\XINTinFloatPFactorial {\romannumeral0\XINTinfloatpfactorial }%
+\def\XINTinfloatpfactorial #1{\XINT_flpfac_chkopt \XINTinfloat #1\xint_relax }%
+\def\XINT_flpfac_chkopt #1#2%
{%
- \ifx [#2\expandafter\XINT_flsqrt_opt
- \else\expandafter\XINT_flsqrt_noopt
- \fi #1#2%
+ \ifx [#2\expandafter\XINT_flpfac_opt
+ \else\expandafter\XINT_flpfac_noopt
+ \fi
+ #1#2%
}%
-\def\XINT_flsqrt_noopt #1#2\xint_relax
+\def\XINT_flpfac_noopt #1#2\xint_relax #3%
{%
- #1[\XINTdigits]{\XINT_FL_sqrt \XINTdigits {#2}}%
+ \expandafter\XINT_FL_pfac_fork
+ \the\numexpr \xintNum{#2}\expandafter.%
+ \the\numexpr \xintNum{#3}.\xint_c_i{\XINTdigits}{#1[\XINTdigits]}%
}%
-\def\XINT_flsqrt_opt #1[\xint_relax #2]#3%
+\def\XINT_flpfac_opt #1[\xint_relax #2]%
{%
- #1[#2]{\XINT_FL_sqrt {#2}{#3}}%
+ \expandafter\XINT_flpfac_opt_b\the\numexpr #2.#1%
}%
-\def\XINT_FL_sqrt #1%
+\def\XINT_flpfac_opt_b #1.#2#3#4%
{%
- \ifnum\numexpr #1<\xint_c_xviii
- \xint_afterfi {\XINT_FL_sqrt_a\xint_c_xviii}%
- \else
- \xint_afterfi {\XINT_FL_sqrt_a {#1+\xint_c_i}}%
- \fi
+ \expandafter\XINT_FL_pfac_fork
+ \the\numexpr \xintNum{#3}\expandafter.%
+ \the\numexpr \xintNum{#4}.\xint_c_i{#1}{#2[#1]}%
}%
-\def\XINT_FL_sqrt_a #1#2%
+\def\XINT_FL_pfac_fork #1#2.#3.%
{%
- \expandafter\XINT_FL_sqrt_checkifzeroorneg
- \romannumeral0\XINTinfloat [#1]{#2}%
+ \if-#1\xint_dothis\XINT_FL_pfac_outofrange\fi
+ \ifnum #1#2=#3 \xint_dothis\XINT_FL_pfac_one\fi
+ \ifnum #1#2>#3 \xint_dothis\XINT_FL_pfac_outofrange\fi
+ \ifnum #3>\xint_c_x^viii_mone
+ \xint_dothis\XINT_FL_pfac_outofrange\fi
+ \xint_orthat \XINT_FL_pfac_increaseP #1#2.#3.%
}%
-\def\XINT_FL_sqrt_checkifzeroorneg #1%
+\def\XINT_FL_pfac_outofrange #1.#2.#3#4#5{\xintError:OutOfRangePFac #5{0/1[0]}}%
+\def\XINT_FL_pfac_one #1.#2.#3#4#5{#5{1/1[0]}}%
+\def\XINT_FL_pfac_increaseP #1.#2.#3#4%
{%
- \xint_UDzerominusfork
- #1-\XINT_FL_sqrt_iszero
- 0#1\XINT_FL_sqrt_isneg
- 0-{\XINT_FL_sqrt_b #1}%
- \krof
+ \expandafter\XINT_FL_pfac_a
+ \the\numexpr \xint_c_viii*((\xint_c_iv+#4+\expandafter
+ \XINT_FL_fac_countdigits\the\numexpr (#2-#1-\xint_c_i)%
+ /\ifnum #2>\xint_c_x^iv #3\else(#3*\xint_c_ii)\fi\relax
+ 87654321\Z)/\xint_c_viii).#1.#2.%
}%
-\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]%
+\def\XINT_FL_pfac_a #1.#2.#3.%
{%
- \ifodd #2
- \xint_afterfi{\XINT_FL_sqrt_c 01}%
- \else
- \xint_afterfi{\XINT_FL_sqrt_c {}0}%
- \fi
- {#1}{#2}%
+ \expandafter\XINT_FL_pfac_b\the\numexpr \xint_c_i+#2\expandafter.%
+ \the\numexpr#3\expandafter.%
+ \romannumeral0\XINT_FL_pfac_addzeroes #1.100000001!1\Z![-#1]%
}%
-\def\XINT_FL_sqrt_c #1#2#3#4%
+\def\XINT_FL_pfac_addzeroes #1.%
{%
- \expandafter\XINT_flsqrt\expandafter {\the\numexpr #4-#2}{#3#1}%
+ \ifnum #1=\xint_c_viii \expandafter\XINT_FL_pfac_addzeroes_exit\fi
+ \expandafter\XINT_FL_pfac_addzeroes\the\numexpr #1-\xint_c_viii.100000000!%
}%
-\def\XINT_flsqrt #1#2%
+\def\XINT_FL_pfac_addzeroes_exit #1.{ }%
+\def\XINT_FL_pfac_b #1.%
{%
- \expandafter\XINT_sqrt_a
- \expandafter{\romannumeral0\xintlength {#2}}\XINT_flsqrt_big_d {#2}{#1}%
+ \ifnum #1>9999 \xint_dothis\XINT_FL_pfac_vbigloop \fi
+ \ifnum #1>463 \xint_dothis\XINT_FL_pfac_bigloop \fi
+ \ifnum #1>98 \xint_dothis\XINT_FL_pfac_medloop \fi
+ \xint_orthat\XINT_FL_pfac_smallloop #1.%
}%
-\def\XINT_flsqrt_big_d #1#2%
+\def\XINT_FL_pfac_smallloop #1.#2.%
{%
- \ifodd #2
- \expandafter\expandafter\expandafter\XINT_flsqrt_big_eB
- \else
- \expandafter\expandafter\expandafter\XINT_flsqrt_big_eA
- \fi
- \expandafter {\the\numexpr (#2-\xint_c_i)/\xint_c_ii }{#1}%
+ \ifcase\numexpr #2-#1\relax
+ \expandafter\XINT_FL_pfac_end_
+ \or \expandafter\XINT_FL_pfac_end_i
+ \or \expandafter\XINT_FL_pfac_end_ii
+ \or \expandafter\XINT_FL_pfac_end_iii
+ \else\expandafter\XINT_FL_pfac_smallloop_a
+ \fi #1.#2.%
}%
-\def\XINT_flsqrt_big_eA #1#2#3%
+\def\XINT_FL_pfac_smallloop_a #1.#2.%
{%
- \XINT_flsqrt_big_eA_a #3\Z {#2}{#1}{#3}%
+ \expandafter\XINT_FL_pfac_smallloop_b
+ \the\numexpr #1+\xint_c_iv\expandafter.%
+ \the\numexpr #2\expandafter.%
+ \romannumeral0\expandafter\XINT_FL_fac_mul
+ \the\numexpr \xint_c_x^viii+#1*(#1+\xint_c_i)*(#1+\xint_c_ii)*(#1+\xint_c_iii)!%
}%
-\def\XINT_flsqrt_big_eA_a #1#2#3#4#5#6#7#8#9\Z
+\def\XINT_FL_pfac_smallloop_b #1.%
{%
- \XINT_flsqrt_big_eA_b {#1#2#3#4#5#6#7#8}%
+ \ifnum #1>98 \expandafter\XINT_FL_pfac_medloop \else
+ \expandafter\XINT_FL_pfac_smallloop \fi #1.%
}%
-\def\XINT_flsqrt_big_eA_b #1#2%
+\def\XINT_FL_pfac_medloop #1.#2.%
{%
- \expandafter\XINT_flsqrt_big_f
- \romannumeral0\XINT_flsqrt_small_e {#2001}{#1}%
+ \ifcase\numexpr #2-#1\relax
+ \expandafter\XINT_FL_pfac_end_
+ \or \expandafter\XINT_FL_pfac_end_i
+ \or \expandafter\XINT_FL_pfac_end_ii
+ \else\expandafter\XINT_FL_pfac_medloop_a
+ \fi #1.#2.%
}%
-\def\XINT_flsqrt_big_eB #1#2#3%
+\def\XINT_FL_pfac_medloop_a #1.#2.%
{%
- \XINT_flsqrt_big_eB_a #3\Z {#2}{#1}{#3}%
+ \expandafter\XINT_FL_pfac_medloop_b
+ \the\numexpr #1+\xint_c_iii\expandafter.%
+ \the\numexpr #2\expandafter.%
+ \romannumeral0\expandafter\XINT_FL_fac_mul
+ \the\numexpr \xint_c_x^viii+#1*(#1+\xint_c_i)*(#1+\xint_c_ii)!%
}%
-\def\XINT_flsqrt_big_eB_a #1#2#3#4#5#6#7#8#9%
+\def\XINT_FL_pfac_medloop_b #1.%
{%
- \XINT_flsqrt_big_eB_b {#1#2#3#4#5#6#7#8#9}%
+ \ifnum #1>463 \expandafter\XINT_FL_pfac_bigloop \else
+ \expandafter\XINT_FL_pfac_medloop \fi #1.%
}%
-\def\XINT_flsqrt_big_eB_b #1#2\Z #3%
+\def\XINT_FL_pfac_bigloop #1.#2.%
{%
- \expandafter\XINT_flsqrt_big_f
- \romannumeral0\XINT_flsqrt_small_e {#30001}{#1}%
+ \ifcase\numexpr #2-#1\relax
+ \expandafter\XINT_FL_pfac_end_
+ \or \expandafter\XINT_FL_pfac_end_i
+ \else\expandafter\XINT_FL_pfac_bigloop_a
+ \fi #1.#2.%
}%
-\def\XINT_flsqrt_small_e #1#2%
+\def\XINT_FL_pfac_bigloop_a #1.#2.%
{%
- \expandafter\XINT_flsqrt_small_f\expandafter
- {\the\numexpr #1*#1-#2-\xint_c_i}{#1}%
+ \expandafter\XINT_FL_pfac_bigloop_b
+ \the\numexpr #1+\xint_c_ii\expandafter.%
+ \the\numexpr #2\expandafter.%
+ \romannumeral0\expandafter\XINT_FL_fac_mul
+ \the\numexpr \xint_c_x^viii+#1*(#1+\xint_c_i)!%
}%
-\def\XINT_flsqrt_small_f #1#2%
+\def\XINT_FL_pfac_bigloop_b #1.%
{%
- \expandafter\XINT_flsqrt_small_g\expandafter
- {\the\numexpr (#1+#2)/(2*#2)-\xint_c_i }{#1}{#2}%
+ \ifnum #1>9999 \expandafter\XINT_FL_pfac_vbigloop \else
+ \expandafter\XINT_FL_pfac_bigloop \fi #1.%
}%
-\def\XINT_flsqrt_small_g #1%
+\def\XINT_FL_pfac_vbigloop #1.#2.%
{%
- \ifnum #1>\xint_c_
- \expandafter\XINT_flsqrt_small_h
- \else
- \expandafter\XINT_flsqrt_small_end
- \fi
- {#1}%
+ \ifnum #2=#1
+ \expandafter\XINT_FL_pfac_end_
+ \else\expandafter\XINT_FL_pfac_vbigloop_a
+ \fi #1.#2.%
+}%
+\def\XINT_FL_pfac_vbigloop_a #1.#2.%
+{%
+ \expandafter\XINT_FL_pfac_vbigloop
+ \the\numexpr #1+\xint_c_i\expandafter.%
+ \the\numexpr #2\expandafter.%
+ \romannumeral0\expandafter\XINT_FL_fac_mul
+ \the\numexpr\xint_c_x^viii+#1!%
}%
-\def\XINT_flsqrt_small_h #1#2#3%
+\def\XINT_FL_pfac_end_iii #1.#2.%
{%
- \expandafter\XINT_flsqrt_small_f\expandafter
- {\the\numexpr #2-\xint_c_ii*#1*#3+#1*#1\expandafter}\expandafter
- {\the\numexpr #3-#1}%
+ \expandafter\XINT_FL_fac_out
+ \romannumeral0\expandafter\XINT_FL_fac_mul
+ \the\numexpr \xint_c_x^viii+#1*(#1+\xint_c_i)*(#1+\xint_c_ii)*(#1+\xint_c_iii)!%
}%
-\def\XINT_flsqrt_small_end #1#2#3%
+\def\XINT_FL_pfac_end_ii #1.#2.%
{%
- \expandafter\space\expandafter
- {\the\numexpr \xint_c_i+#3*\xint_c_x^iv-
- (#2*\xint_c_x^iv+#3)/(\xint_c_ii*#3)}%
+ \expandafter\XINT_FL_fac_out
+ \romannumeral0\expandafter\XINT_FL_fac_mul
+ \the\numexpr \xint_c_x^viii+#1*(#1+\xint_c_i)*(#1+\xint_c_ii)!%
}%
-\def\XINT_flsqrt_big_f #1%
+\def\XINT_FL_pfac_end_i #1.#2.%
{%
- \expandafter\XINT_flsqrt_big_fa\expandafter
- {\romannumeral0\xintiisqr {#1}}{#1}%
+ \expandafter\XINT_FL_fac_out
+ \romannumeral0\expandafter\XINT_FL_fac_mul
+ \the\numexpr \xint_c_x^viii+#1*(#1+\xint_c_i)!%
}%
-\def\XINT_flsqrt_big_fa #1#2#3#4%
+\def\XINT_FL_pfac_end_ #1.#2.%
{%
- \expandafter\XINT_flsqrt_big_fb\expandafter
- {\romannumeral0\XINT_dsx_addzerosnofuss
- {\numexpr #3-\xint_c_viii\relax}{#2}}%
- {\romannumeral0\xintiisub
- {\XINT_dsx_addzerosnofuss
- {\numexpr \xint_c_ii*(#3-\xint_c_viii)\relax}{#1}}{#4}}%
- {#3}%
+ \expandafter\XINT_FL_fac_out
+ \romannumeral0\expandafter\XINT_FL_fac_mul
+ \the\numexpr \xint_c_x^viii+#1!%
}%
-\def\XINT_flsqrt_big_fb #1#2%
+\def\xintFloatBinomial {\romannumeral0\xintfloatbinomial}%
+\def\xintfloatbinomial #1{\XINT_flbinom_chkopt \xintfloat #1\xint_relax }%
+\def\XINTinFloatBinomial {\romannumeral0\XINTinfloatbinomial }%
+\def\XINTinfloatbinomial #1{\XINT_flbinom_chkopt \XINTinfloat #1\xint_relax }%
+\def\XINT_flbinom_chkopt #1#2%
{%
- \expandafter\XINT_flsqrt_big_g\expandafter {#2}{#1}%
+ \ifx [#2\expandafter\XINT_flbinom_opt
+ \else\expandafter\XINT_flbinom_noopt
+ \fi #1#2%
}%
-\def\XINT_flsqrt_big_g #1#2%
+\def\XINT_flbinom_noopt #1#2\xint_relax #3%
{%
- \expandafter\XINT_flsqrt_big_j
- \romannumeral0\xintiidivision
- {#1}{\romannumeral0\XINT_dbl_pos #2\Z}{#2}%
+ \expandafter\XINT_FL_binom_a
+ \the\numexpr\xintNum{#2}\expandafter.\the\numexpr\xintNum{#3}.\XINTdigits.#1%
}%
-\def\XINT_flsqrt_big_j #1%
+\def\XINT_flbinom_opt #1[\xint_relax #2]#3#4%
{%
- \if0\XINT_Sgn #1\Z
- \expandafter \XINT_flsqrt_big_end_a
- \else \expandafter \XINT_flsqrt_big_k
- \fi {#1}%
+ \expandafter\XINT_FL_binom_a
+ \the\numexpr\xintNum{#3}\expandafter.\the\numexpr\xintNum{#4}\expandafter.%
+ \the\numexpr #2.#1%
+}%
+\def\XINT_FL_binom_a #1.#2.%
+{%
+ \expandafter\XINT_FL_binom_fork \the\numexpr #1-#2.#2.#1.%
+}%
+\def\XINT_FL_binom_fork #1#2.#3#4.#5.%
+{%
+ \if-#1\xint_dothis \XINT_FL_binom_outofrange\fi
+ \if-#3\xint_dothis \XINT_FL_binom_outofrange\fi
+ \if0#1\xint_dothis \XINT_FL_binom_one\fi
+ \if0#3\xint_dothis \XINT_FL_binom_one\fi
+ \ifnum #5>\xint_c_x^viii_mone \xint_dothis\XINT_FL_binom_outofrange\fi
+ \ifnum #1#2>#3#4 \xint_dothis\XINT_FL_binom_ab \fi
+ \xint_orthat\XINT_FL_binom_aa
+ #1#2.#3#4.#5.%
+}%
+\def\XINT_FL_binom_outofrange #1.#2.#3.#4.#5%
+ {\xintError:OutOfRangeBinomial #5[#4]{0/1[0]}}%
+\def\XINT_FL_binom_one #1.#2.#3.#4.#5{#5[#4]{1/1[0]}}%
+\def\XINT_FL_binom_aa #1.#2.#3.#4.#5%
+{%
+ #5[#4]{\xintDiv{\XINT_FL_pfac_increaseP
+ #2.#3.\xint_c_iv{#4+\xint_c_i}{\XINTinfloat[#4+\xint_c_iii]}}%
+ {\XINT_FL_fac_fork_b
+ #1.\xint_c_iv{#4+\xint_c_i}\XINT_FL_fac_out{\XINTinfloat[#4+\xint_c_iii]}}}%
+}%
+\def\XINT_FL_binom_ab #1.#2.#3.#4.#5%
+{%
+ #5[#4]{\xintDiv{\XINT_FL_pfac_increaseP
+ #1.#3.\xint_c_iv{#4+\xint_c_i}{\XINTinfloat[#4+\xint_c_iii]}}%
+ {\XINT_FL_fac_fork_b
+ #2.\xint_c_iv{#4+\xint_c_i}\XINT_FL_fac_out{\XINTinfloat[#4+\xint_c_iii]}}}%
+}%
+\def\xintFloatSqrt {\romannumeral0\xintfloatsqrt }%
+\def\xintfloatsqrt #1{\XINT_flsqrt_chkopt \xintfloat #1\xint_relax }%
+\def\XINTinFloatSqrt {\romannumeral0\XINTinfloatsqrt }%
+\def\XINTinfloatsqrt #1{\XINT_flsqrt_chkopt \XINTinfloat #1\xint_relax }%
+\def\XINT_flsqrt_chkopt #1#2%
+{%
+ \ifx [#2\expandafter\XINT_flsqrt_opt
+ \else\expandafter\XINT_flsqrt_noopt
+ \fi #1#2%
+}%
+\def\XINT_flsqrt_noopt #1#2\xint_relax
+{%
+ \expandafter\XINT_FL_sqrt_a
+ \romannumeral0\XINTinfloat[\XINTdigits]{#2}\XINTdigits.#1%
+}%
+\def\XINT_flsqrt_opt #1[\xint_relax #2]%#3%
+{%
+ \expandafter\XINT_flsqrt_opt_a\the\numexpr #2.#1%
+}%
+\def\XINT_flsqrt_opt_a #1.#2#3%
+{%
+ \expandafter\XINT_FL_sqrt_a\romannumeral0\XINTinfloat[#1]{#3}#1.#2%
+}%
+\def\XINT_FL_sqrt_a #1%
+{%
+ \xint_UDzerominusfork
+ #1-\XINT_FL_sqrt_iszero
+ 0#1\XINT_FL_sqrt_isneg
+ 0-{\XINT_FL_sqrt_pos #1}%
+ \krof
+}%[
+\def\XINT_FL_sqrt_iszero #1]#2.#3{#3[#2]{0[0]}}%
+\def\XINT_FL_sqrt_isneg #1]#2.#3{\xintError:RootOfNegative #3[#2]{0[0]}}%
+\def\XINT_FL_sqrt_pos #1[#2]#3.%
+{%
+ \expandafter\XINT_flsqrt
+ \the\numexpr #3\ifodd #2 \xint_dothis {+\xint_c_iii.(#2+\xint_c_i).0}\fi
+ \xint_orthat {+\xint_c_ii.#2.{}}#100.#3.%
}%
-\def\XINT_flsqrt_big_k #1#2#3%
+\def\XINT_flsqrt #1.#2.%
{%
- \expandafter\XINT_flsqrt_big_l\expandafter
- {\romannumeral0\xintiisub {#3}{#1}}%
- {\romannumeral0\xintiiadd {#2}{\romannumeral0\XINT_sqr #1\Z}}%
+ \expandafter\XINT_flsqrt_a
+ \the\numexpr #2/\xint_c_ii-(#1-\xint_c_i)/\xint_c_ii.#1.%
}%
-\def\XINT_flsqrt_big_l #1#2%
+\def\XINT_flsqrt_a #1.#2.#3#4.#5.%
{%
- \expandafter\XINT_flsqrt_big_g\expandafter
- {#2}{#1}%
+ \expandafter\XINT_flsqrt_b
+ \the\numexpr (#2-\xint_c_i)/\xint_c_ii\expandafter.%
+ \romannumeral0\XINT_sqrt_start #2.#4#3.#5.#2.#4#3.#5.#1.%
}%
-\def\XINT_flsqrt_big_end_a #1#2#3#4#5%
+\def\XINT_flsqrt_b #1.#2#3%
{%
- \expandafter\XINT_flsqrt_big_end_b\expandafter
- {\the\numexpr -#4+#5/\xint_c_ii\expandafter}\expandafter
- {\romannumeral0\xintiisub
- {\XINT_dsx_addzerosnofuss {#4}{#3}}%
- {\xintHalf{\xintiiQuo{\XINT_dsx_addzerosnofuss {#4}{#2}}{#3}}}}%
+ \expandafter\XINT_flsqrt_c
+ \romannumeral0\xintiisub
+ {\XINT_dsx_addzerosnofuss {#1}{#2}}%
+ {\xintiiDivRound{\XINT_dsx_addzerosnofuss {#1}{#3}}{\XINT_dbl_pos#2\Z}}.%
}%
-\def\XINT_flsqrt_big_end_b #1#2{#2[#1]}%
+\def\XINT_flsqrt_c #1.#2.%
+{%
+ \expandafter\XINT_flsqrt_d
+ \romannumeral0\XINT_split_fromleft_loop #2.{}#1\W\W\W\W\W\W\W\W\Z
+}%
+\def\XINT_flsqrt_d #1.#2#3.%
+{%
+ \ifnum #2=\xint_c_v
+ \expandafter\XINT_flsqrt_f\else\expandafter\XINT_flsqrt_finish\fi
+ #2#3.#1.%
+}%
+\def\XINT_flsqrt_finish #1#2.#3.#4.#5.#6.#7.#8{#8[#6]{#3#1[#7]}}%
+\def\XINT_flsqrt_f 5#1.%
+ {\xintiiifGt{\xintiNum{#1}}{2}{\XINT_flsqrt_finish 5.}{\XINT_flsqrt_again}}%
+\def\XINT_flsqrt_again #1.#2.%
+{%
+ \expandafter\XINT_flsqrt_again_a\the\numexpr #2+\xint_c_viii.%
+}%
+\def\XINT_flsqrt_again_a #1.#2.#3.%
+{%
+ \expandafter\XINT_flsqrt_b
+ \the\numexpr (#1-\xint_c_i)/\xint_c_ii\expandafter.%
+ \romannumeral0\XINT_sqrt_start #1.#200000000.#3.%
+ #1.#200000000.#3.%
+}%
+\def\xintFloatE {\romannumeral0\xintfloate }%
+\def\xintfloate #1{\XINT_floate_chkopt #1\xint_relax }%
+\def\XINT_floate_chkopt #1%
+{%
+ \ifx [#1\expandafter\XINT_floate_opt
+ \else\expandafter\XINT_floate_noopt
+ \fi #1%
+}%
+\def\XINT_floate_noopt #1\xint_relax
+{%
+ \expandafter\XINT_floate_a\expandafter\XINTdigits
+ \romannumeral0\XINT_infrac {#1}%
+}%
+\def\XINT_floate_opt [\xint_relax #1]#2%
+{%
+ \expandafter\XINT_floate_a\expandafter
+ {\the\numexpr #1\expandafter}\romannumeral0\XINT_infrac {#2}%
+}%
+\def\XINT_floate_a #1#2#3#4#5%
+{%
+ \expandafter\XINT_float_a\the\numexpr#1\expandafter.%
+ \expandafter{\the\numexpr #2+#5}{#3}{#4}\XINT_float_Q
+}%
+\def\XINTinFloatE {\romannumeral0\XINTinfloate }%
+\def\XINTinfloate
+ {\expandafter\XINT_infloate\romannumeral0\XINTinfloat [\XINTdigits]}%
+\def\XINT_infloate #1[#2]#3%
+ {\expandafter\XINT_infloate_end\the\numexpr #3+#2.{#1}}%
+\def\XINT_infloate_end #1.#2{ #2[#1]}%
+\def\XINTinFloatMod {\romannumeral0\XINTinfloatmod [\XINTdigits]}%
+\def\XINTinfloatmod [#1]#2#3{\expandafter\XINT_infloatmod\expandafter
+ {\romannumeral0\XINTinfloat[#1]{#2}}%
+ {\romannumeral0\XINTinfloat[#1]{#3}}{#1}}%
+\def\XINT_infloatmod #1#2{\expandafter\XINT_infloatmod_a\expandafter {#2}{#1}}%
+\def\XINT_infloatmod_a #1#2#3{\XINTinfloat [#3]{\xintMod {#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 874385ef298..78537efcf48 100644
--- a/Master/texmf-dist/tex/generic/xint/xintgcd.sty
+++ b/Master/texmf-dist/tex/generic/xint/xintgcd.sty
@@ -21,8 +21,8 @@
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%% ---------------------------------------------------------------
-%% The xint bundle v1.2e 2015/11/22
-%% Copyright (C) 2013-2015 by Jean-Francois Burnol
+%% The xint bundle 1.2f 2016/03/12
+%% Copyright (C) 2013-2016 by Jean-Francois Burnol
%% xintgcd: Euclidean algorithm with xint package
%% ---------------------------------------------------------------
\begingroup\catcode61\catcode48\catcode32=10\relax%
@@ -70,7 +70,7 @@
\XINTsetupcatcodes% defined in xintkernel.sty
\XINT_providespackage
\ProvidesPackage{xintgcd}%
- [2015/11/22 v1.2e Euclide algorithm with xint package (jfB)]%
+ [2016/03/12 1.2f Euclide algorithm with xint package (JFB)]%
\def\xintGCD {\romannumeral0\xintgcd }%
\def\xintgcd #1%
{%
diff --git a/Master/texmf-dist/tex/generic/xint/xintkernel.sty b/Master/texmf-dist/tex/generic/xint/xintkernel.sty
index 79a9bebef7d..9a001625dae 100644
--- a/Master/texmf-dist/tex/generic/xint/xintkernel.sty
+++ b/Master/texmf-dist/tex/generic/xint/xintkernel.sty
@@ -21,8 +21,8 @@
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%% ---------------------------------------------------------------
-%% The xint bundle v1.2e 2015/11/22
-%% Copyright (C) 2013-2015 by Jean-Francois Burnol
+%% The xint bundle 1.2f 2016/03/12
+%% Copyright (C) 2013-2016 by Jean-Francois Burnol
%% xintkernel: Paraphernalia for the xint packages
%% ---------------------------------------------------------------
\begingroup\catcode61\catcode48\catcode32=10\relax%
@@ -156,7 +156,7 @@
\fi
\XINT_providespackage
\ProvidesPackage {xintkernel}%
- [2015/11/22 v1.2e Paraphernalia for the xint packages (jfB)]%
+ [2016/03/12 1.2f Paraphernalia for the xint packages (JFB)]%
\chardef\xint_c_ 0
\chardef\xint_c_i 1
\chardef\xint_c_ii 2
@@ -240,11 +240,11 @@
\long\def\xint_gob_til_xint_relax #1\xint_relax {}%
\long\def\xint_afterfi #1#2\fi {\fi #1}%
\long\def\xint_bye #1\xint_bye {}%
-\long\def\xint_dothis #1#2\xint_orthat #3{\fi #1}% v1.1
+\long\def\xint_dothis #1#2\xint_orthat #3{\fi #1}% 1.1
\let\xint_orthat \xint_firstofone
\long\def\xintdothis #1#2\xintorthat #3{\fi #1}%
\let\xintorthat \xint_firstofone
-\def\xint_zapspaces #1 #2{#1#2\xint_zapspaces }% v1.1
+\def\xint_zapspaces #1 #2{#1#2\xint_zapspaces }% 1.1
\def\xint_zapspaces_o #1{\expandafter\xint_zapspaces#1 \xint_gobble_i}%
\def\xintodef #1{\expandafter\def\expandafter#1\expandafter }%
\def\xintoodef #1{\expandafter\expandafter\expandafter\def
diff --git a/Master/texmf-dist/tex/generic/xint/xintseries.sty b/Master/texmf-dist/tex/generic/xint/xintseries.sty
index cdaf499c432..b9523bf4231 100644
--- a/Master/texmf-dist/tex/generic/xint/xintseries.sty
+++ b/Master/texmf-dist/tex/generic/xint/xintseries.sty
@@ -21,8 +21,8 @@
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%% ---------------------------------------------------------------
-%% The xint bundle v1.2e 2015/11/22
-%% Copyright (C) 2013-2015 by Jean-Francois Burnol
+%% The xint bundle 1.2f 2016/03/12
+%% Copyright (C) 2013-2016 by Jean-Francois Burnol
%% xintseries: Expandable partial sums with xint package
%% ---------------------------------------------------------------
\begingroup\catcode61\catcode48\catcode32=10\relax%
@@ -70,7 +70,7 @@
\XINTsetupcatcodes% defined in xintkernel.sty
\XINT_providespackage
\ProvidesPackage{xintseries}%
- [2015/11/22 v1.2e Expandable partial sums with xint package (jfB)]%
+ [2016/03/12 1.2f 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 80e85234943..8fb291a28cd 100644
--- a/Master/texmf-dist/tex/generic/xint/xinttools.sty
+++ b/Master/texmf-dist/tex/generic/xint/xinttools.sty
@@ -21,8 +21,8 @@
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%% ---------------------------------------------------------------
-%% The xint bundle v1.2e 2015/11/22
-%% Copyright (C) 2013-2015 by Jean-Francois Burnol
+%% The xint bundle 1.2f 2016/03/12
+%% Copyright (C) 2013-2016 by Jean-Francois Burnol
%% xinttools: Expandable and non-expandable utilities
%% ---------------------------------------------------------------
\begingroup\catcode61\catcode48\catcode32=10\relax%
@@ -70,7 +70,7 @@
\XINTsetupcatcodes% defined in xintkernel.sty
\XINT_providespackage
\ProvidesPackage{xinttools}%
- [2015/11/22 v1.2e Expandable and non-expandable utilities (jfB)]%
+ [2016/03/12 1.2f Expandable and non-expandable utilities (JFB)]%
\newtoks\XINT_toks
\xint_firstofone{\let\XINT_sptoken= } %<- space here!
\def\xintgodef {\global\xintodef }%