summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/xint
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2015-10-11 21:21:00 +0000
committerKarl Berry <karl@freefriends.org>2015-10-11 21:21:00 +0000
commitc42b50b291d00f547400888b81ef4d2bcad45142 (patch)
tree9ab2f5792d7627887e9f858a103ba1c7de329a67 /Master/texmf-dist/tex/generic/xint
parentced6522f86e501ede0097c2b6362bc17603b6eef (diff)
xint (11oct15)
git-svn-id: svn://tug.org/texlive/trunk@38612 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/xint')
-rw-r--r--Master/texmf-dist/tex/generic/xint/xint.sty566
-rw-r--r--Master/texmf-dist/tex/generic/xint/xintbinhex.sty42
-rw-r--r--Master/texmf-dist/tex/generic/xint/xintcfrac.sty36
-rw-r--r--Master/texmf-dist/tex/generic/xint/xintcore.sty2694
-rw-r--r--Master/texmf-dist/tex/generic/xint/xintexpr.sty293
-rw-r--r--Master/texmf-dist/tex/generic/xint/xintfrac.sty604
-rw-r--r--Master/texmf-dist/tex/generic/xint/xintgcd.sty8
-rw-r--r--Master/texmf-dist/tex/generic/xint/xintkernel.sty91
-rw-r--r--Master/texmf-dist/tex/generic/xint/xintseries.sty4
-rw-r--r--Master/texmf-dist/tex/generic/xint/xinttools.sty4
10 files changed, 2331 insertions, 2011 deletions
diff --git a/Master/texmf-dist/tex/generic/xint/xint.sty b/Master/texmf-dist/tex/generic/xint/xint.sty
index b07e96b1cbe..b06c32ff687 100644
--- a/Master/texmf-dist/tex/generic/xint/xint.sty
+++ b/Master/texmf-dist/tex/generic/xint/xint.sty
@@ -21,7 +21,7 @@
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%% ---------------------------------------------------------------
-%% The xint bundle v1.1c 2015/09/12
+%% The xint bundle v1.2 2015/10/10
%% Copyright (C) 2013-2015 by Jean-Francois Burnol
%% xint: Expandable operations on big integers
%% ---------------------------------------------------------------
@@ -70,13 +70,17 @@
\XINTsetupcatcodes% defined in xintkernel.sty (loaded by xintcore.sty)
\XINT_providespackage
\ProvidesPackage{xint}%
- [2015/09/12 v1.1c Expandable operations on big integers (jfB)]%
+ [2015/10/10 v1.2 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}%
\long\def\xint_firstofthree_thenstop #1#2#3{ #1}% 1.09i
\long\def\xint_secondofthree_thenstop #1#2#3{ #2}%
\long\def\xint_thirdofthree_thenstop #1#2#3{ #3}%
+\edef\xint_cleanupzeros_andstop #1#2#3#4%
+{%
+ \noexpand\expandafter\space\noexpand\the\numexpr #1#2#3#4\relax
+}%
\def\xintSgnFork {\romannumeral0\xintsgnfork }%
\def\xintsgnfork #1%
{%
@@ -101,22 +105,7 @@
\expandafter\space\expandafter 0\xint_gob_til_Z
}%
\def\XINT_isone_yes #1\Z { 1}%
-\def\xintRev {\romannumeral0\xintrev }%
-\def\xintrev #1%
-{%
- \expandafter\XINT_rev_fork
- \romannumeral-`0#1\xint_relax % empty #1 ok, \xint_relax stops expansion
- \xint_bye\xint_bye\xint_bye\xint_bye
- \xint_bye\xint_bye\xint_bye\xint_bye
- \xint_relax
-}%
-\def\XINT_rev_fork #1%
-{%
- \xint_UDsignfork
- #1{\expandafter\xint_minus_thenstop\romannumeral0\XINT_rord_main {}}%
- -{\XINT_rord_main {}#1}%
- \krof
-}%
+\let\xintRev\xintReverseDigits
\def\xintLen {\romannumeral0\xintlen }%
\def\xintlen #1%
{%
@@ -301,121 +290,175 @@
\expandafter\xint_secondoftwo_thenstop
\fi
}%
-\def\xintCmp {\romannumeral0\xintcmp }%
-\def\xintcmp #1%
+\def\xintCmp {\romannumeral0\xintcmp }%
+\def\xintcmp #1{\expandafter\XINT_icmp\romannumeral0\xintnum{#1}\Z }%
+\def\xintiiCmp {\romannumeral0\xintiicmp }%
+\def\xintiicmp #1{\expandafter\XINT_iicmp\romannumeral-`0#1\Z }%
+\def\XINT_iicmp #1#2\Z #3%
{%
- \expandafter\xint_cmp\expandafter{\romannumeral0\xintnum{#1}}%
+ \expandafter\XINT_cmp_nfork\expandafter #1\romannumeral-`0#3\Z #2\Z
}%
-\def\xint_cmp #1#2%
+\let\XINT_Cmp \xintiiCmp
+\def\XINT_icmp #1#2\Z #3%
{%
- \expandafter\XINT_cmp_fork \romannumeral0\xintnum{#2}\Z #1\Z
+ \expandafter\XINT_cmp_nfork\expandafter #1\romannumeral0\xintnum{#3}\Z #2\Z
}%
-\def\xintiiCmp {\romannumeral0\xintiicmp }%
-\def\xintiicmp #1%
+\def\XINT_cmp_nfork #1#2%
{%
- \expandafter\xint_iicmp\expandafter{\romannumeral-`0#1}%
+ \xint_UDzerofork
+ #1\XINT_cmp_firstiszero
+ #2\XINT_cmp_secondiszero
+ 0{}%
+ \krof
+ \xint_UDsignsfork
+ #1#2\XINT_cmp_minusminus
+ #1-\XINT_cmp_minusplus
+ #2-\XINT_cmp_plusminus
+ --\XINT_cmp_plusplus
+ \krof #1#2%
}%
-\def\xint_iicmp #1#2%
+\def\XINT_cmp_firstiszero #1\krof 0#2#3\Z #4\Z
{%
- \expandafter\XINT_cmp_fork \romannumeral-`0#2\Z #1\Z
+ \xint_UDzerominusfork
+ #2-{ 0}%
+ 0#2{ 1}%
+ 0-{ -1}%
+ \krof
}%
-\def\XINT_Cmp #1#2{\romannumeral0\XINT_cmp_fork #2\Z #1\Z }%
-\def\XINT_cmp_fork #1#2\Z #3#4\Z
+\def\XINT_cmp_secondiszero #1\krof #20#3\Z #4\Z
{%
- \xint_UDsignsfork
- #1#3\XINT_cmp_minusminus
- #1-\XINT_cmp_minusplus
- #3-\XINT_cmp_plusminus
- --{\xint_UDzerosfork
- #1#3\XINT_cmp_zerozero
- #10\XINT_cmp_zeroplus
- #30\XINT_cmp_pluszero
- 00\XINT_cmp_plusplus
- \krof }%
+ \xint_UDzerominusfork
+ #2-{ 0}%
+ 0#2{ -1}%
+ 0-{ 1}%
\krof
- {#2}{#4}#1#3%
}%
-\def\XINT_cmp_minusplus #1#2#3#4{ 1}%
-\def\XINT_cmp_plusminus #1#2#3#4{ -1}%
-\def\XINT_cmp_zerozero #1#2#3#4{ 0}%
-\def\XINT_cmp_zeroplus #1#2#3#4{ 1}%
-\def\XINT_cmp_pluszero #1#2#3#4{ -1}%
-\def\XINT_cmp_plusplus #1#2#3#4%
+\def\XINT_cmp_plusminus #1\Z #2\Z{ 1}%
+\def\XINT_cmp_minusplus #1\Z #2\Z{ -1}%
+\def\XINT_cmp_minusminus
+ --{\expandafter\XINT_opp\romannumeral0\XINT_cmp_plusplus {}{}}%
+\def\XINT_cmp_plusplus #1#2#3\Z
+{%
+ \expandafter\XINT_cmp_pp
+ \romannumeral0\expandafter\XINT_sepandrev_andcount
+ \romannumeral0\XINT_zeroes_forviii #2#3\R\R\R\R\R\R\R\R{10}0000001\W
+ #2#3\XINT_rsepbyviii_end_A 2345678%
+ \XINT_rsepbyviii_end_B 2345678\relax\xint_c_ii\xint_c_iii
+ \R.\xint_c_vi\R.\xint_c_v\R.\xint_c_iv\R.\xint_c_iii
+ \R.\xint_c_ii\R.\xint_c_i\R.\xint_c_\W
+ \X #1%
+}%
+\def\XINT_cmp_pp #1.#2\X #3\Z
+{%
+ \expandafter\XINT_cmp_checklengths
+ \the\numexpr #1\expandafter.%
+ \romannumeral0\expandafter\XINT_sepandrev_andcount
+ \romannumeral0\XINT_zeroes_forviii #3\R\R\R\R\R\R\R\R{10}0000001\W
+ #3\XINT_rsepbyviii_end_A 2345678%
+ \XINT_rsepbyviii_end_B 2345678\relax \xint_c_ii\xint_c_iii
+ \R.\xint_c_vi\R.\xint_c_v\R.\xint_c_iv\R.\xint_c_iii
+ \R.\xint_c_ii\R.\xint_c_i\R.\xint_c_\W
+ \Z!\Z!\Z!\Z!\Z!\W #2\Z!\Z!\Z!\Z!\Z!\W
+}%
+\def\XINT_cmp_checklengths #1.#2.%
+{%
+ \ifnum #1=#2
+ \expandafter\xint_firstoftwo
+ \else
+ \expandafter\xint_secondoftwo
+ \fi
+ \XINT_cmp_aa {\XINT_cmp_distinctlengths {#1}{#2}}%
+}%
+\def\XINT_cmp_distinctlengths #1#2#3\W #4\W
{%
- \XINT_cmp_pre {#4#2}{#3#1}%
+ \ifnum #1>#2
+ \expandafter\xint_firstoftwo
+ \else
+ \expandafter\xint_secondoftwo
+ \fi
+ { -1}{ 1}%
}%
-\def\XINT_cmp_minusminus #1#2#3#4%
+%%%%%%%%%%%%
+\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_pre {#1}{#2}%
+ \XINT_cmp_b #1!#6!#2!#7!#3!#8!#4!#9!#5\W
}%
-\def\XINT_cmp_pre #1%
+\def\XINT_cmp_b #1#2#3!#4!%
{%
- \expandafter\XINT_cmp_pre_b\expandafter
- {\romannumeral0\XINT_RQ {}#1\R\R\R\R\R\R\R\R\Z }%
+ \xint_gob_til_Z #2\XINT_cmp_bi \Z
+ \expandafter\XINT_cmp_c\the\numexpr#1+1#4-#3-\xint_c_i.%
}%
-\def\XINT_cmp_pre_b #1#2%
+\def\XINT_cmp_c 1#1#2.%
{%
- \expandafter\XINT_cmp_A
- \expandafter1\expandafter{\expandafter}%
- \romannumeral0\XINT_RQ {}#2\R\R\R\R\R\R\R\R\Z
- \W\X\Y\Z #1\W\X\Y\Z
+ 1#2\expandafter!\the\numexpr\XINT_cmp_d #1%
}%
-\def\XINT_cmp_A #1#2#3\W\X\Y\Z #4#5#6#7%
+\def\XINT_cmp_d #1#2#3!#4!%
{%
- \xint_gob_til_W #4\xint_cmp_az\W
- \XINT_cmp_B #1{#4#5#6#7}{#2}#3\W\X\Y\Z
+ \xint_gob_til_Z #2\XINT_cmp_di \Z
+ \expandafter\XINT_cmp_e\the\numexpr#1+1#4-#3-\xint_c_i.%
}%
-\def\XINT_cmp_B #1#2#3#4#5#6#7%
+\def\XINT_cmp_e 1#1#2.%
{%
- \xint_gob_til_W#4\xint_cmp_bz\W
- \XINT_cmp_onestep #1#2{#7#6#5#4}{#3}%
+ 1#2\expandafter!\the\numexpr\XINT_cmp_f #1%
}%
-\def\XINT_cmp_onestep #1#2#3#4#5#6%
+\def\XINT_cmp_f #1#2#3!#4!%
{%
- \expandafter\XINT_cmp_backtoA\the\numexpr 11#5#4#3#2-#6+#1-\xint_c_i.%
+ \xint_gob_til_Z #2\XINT_cmp_fi \Z
+ \expandafter\XINT_cmp_g\the\numexpr#1+1#4-#3-\xint_c_i.%
}%
-\def\XINT_cmp_backtoA #1#2#3.#4%
+\def\XINT_cmp_g 1#1#2.%
{%
- \XINT_cmp_A #2{#3#4}%
+ 1#2\expandafter!\the\numexpr\XINT_cmp_h #1%
}%
-\def\xint_cmp_bz\W\XINT_cmp_onestep #1\Z { 1}%
-\def\xint_cmp_az\W\XINT_cmp_B #1#2#3#4#5#6#7%
+\def\XINT_cmp_h #1#2#3!#4!%
{%
- \xint_gob_til_W #4\xint_cmp_ez\W
- \XINT_cmp_Eenter #1{#3}#4#5#6#7%
+ \xint_gob_til_Z #2\XINT_cmp_hi \Z
+ \expandafter\XINT_cmp_i\the\numexpr#1+1#4-#3-\xint_c_i.%
}%
-\def\XINT_cmp_Eenter #1\Z { -1}%
-\def\xint_cmp_ez\W\XINT_cmp_Eenter #1%
+\def\XINT_cmp_i 1#1#2.%
{%
- \xint_UDzerofork
- #1\XINT_cmp_K % il y a une retenue
- 0\XINT_cmp_L % pas de retenue
- \krof
+ 1#2\expandafter!\the\numexpr\XINT_cmp_a #1%
}%
-\def\XINT_cmp_K #1\Z { -1}%
-\def\XINT_cmp_L #1{\XINT_OneIfPositive_main #1}%
-\def\XINT_OneIfPositive #1%
+\def\XINT_cmp_bi\Z
+ \expandafter\XINT_cmp_c\the\numexpr#1+1#2-#3.#4!#5!#6!#7!#8!#9!\Z !\W
{%
- \XINT_OneIfPositive_main #1\W\X\Y\Z%
+ \XINT_cmp_k #1#2!#5!#7!#9!%
}%
-\def\XINT_OneIfPositive_main #1#2#3#4%
+\def\XINT_cmp_di\Z
+ \expandafter\XINT_cmp_e\the\numexpr#1+1#2-#3.#4!#5!#6!#7!#8\W
{%
- \xint_gob_til_Z #4\xint_OneIfPositive_terminated\Z
- \XINT_OneIfPositive_onestep #1#2#3#4%
+ \XINT_cmp_k #1#2!#5!#7!%
}%
-\def\xint_OneIfPositive_terminated\Z\XINT_OneIfPositive_onestep\W\X\Y\Z { 0}%
-\def\XINT_OneIfPositive_onestep #1#2#3#4%
+\def\XINT_cmp_fi\Z
+ \expandafter\XINT_cmp_g\the\numexpr#1+1#2-#3.#4!#5!#6\W
{%
- \expandafter\XINT_OneIfPositive_check\the\numexpr #1#2#3#4\relax
+ \XINT_cmp_k #1#2!#5!%
}%
-\def\XINT_OneIfPositive_check #1%
+\def\XINT_cmp_hi\Z
+ \expandafter\XINT_cmp_i\the\numexpr#1+1#2-#3.#4\W
{%
- \xint_gob_til_zero #1\xint_OneIfPositive_backtomain 0%
- \XINT_OneIfPositive_finish #1%
+ \XINT_cmp_k #1#2!%
}%
-\def\XINT_OneIfPositive_finish #1\W\X\Y\Z{ 1}%
-\def\xint_OneIfPositive_backtomain 0\XINT_OneIfPositive_finish 0%
- {\XINT_OneIfPositive_main }%
+%%%%%%%%%%%%
+\def\XINT_cmp_k #1#2\W
+{%
+ \xint_UDzerofork
+ #1{-1\relax \XINT_cmp_greater}%
+ 0{-1\relax \XINT_cmp_lessorequal}%
+ \krof
+}%
+\def\XINT_cmp_w #1-1#2{#2#11\Z!\W}%
+\def\XINT_cmp_greater #1\Z!\W{ 1}%
+\def\XINT_cmp_lessorequal 1#1!%
+ {\xint_gob_til_Z #1\XINT_cmp_equal\Z
+ \xint_gob_til_eightzeroes #1\XINT_cmp_continue 00000000%
+ \XINT_cmp_less }%
+\def\XINT_cmp_less #1\W { -1}%
+\def\XINT_cmp_continue 00000000\XINT_cmp_less {\XINT_cmp_lessorequal }%
+\def\XINT_cmp_equal\Z\xint_gob_til_eightzeroes\Z\XINT_cmp_continue
+ 00000000\XINT_cmp_less\W { 0}%
\def\xintEq {\romannumeral0\xinteq }\def\xinteq #1#2{\xintifeq{#1}{#2}{1}{0}}%
\def\xintGt {\romannumeral0\xintgt }\def\xintgt #1#2{\xintifgt{#1}{#2}{1}{0}}%
\def\xintLt {\romannumeral0\xintlt }\def\xintlt #1#2{\xintiflt{#1}{#2}{1}{0}}%
@@ -482,80 +525,154 @@
{\XINT_xorof_a #2}%
}%
\def\XINT_xorof_e #1\Z #2{ #2}%
-\def\xintGeq {\romannumeral0\xintgeq }%
-\def\xintgeq #1%
+\def\xintGeq {\romannumeral0\xintgeq }%
+\def\xintgeq #1{\expandafter\XINT_geq\romannumeral0\xintnum{#1}\Z }%
+\def\xintiiGeq {\romannumeral0\xintiigeq }%
+\def\xintiigeq #1{\expandafter\XINT_iigeq\romannumeral-`0#1\Z }%
+\def\XINT_iigeq #1#2\Z #3%
{%
- \expandafter\xint_geq\expandafter {\romannumeral0\xintnum{#1}}%
+ \expandafter\XINT_geq_fork\expandafter #1\romannumeral-`0#3\Z #2\Z
}%
-\def\xint_geq #1#2%
+\let\XINT_geq_pre \xintiigeq % TEMPORAIRE
+\let\XINT_Geq \xintGeq % TEMPORAIRE ATTENTION FAIT xintNum
+\def\XINT_geq #1#2\Z #3%
{%
- \expandafter\XINT_geq_fork \romannumeral0\xintnum{#2}\Z #1\Z
+ \expandafter\XINT_geq_fork\expandafter #1\romannumeral0\xintnum{#3}\Z #2\Z
}%
-\def\XINT_Geq #1#2{\romannumeral0\XINT_geq_fork #2\Z #1\Z }%
-\def\XINT_geq_fork #1#2\Z #3#4\Z
+\def\XINT_geq_fork #1#2%
{%
\xint_UDzerofork
- #1\XINT_geq_secondiszero % |#1#2|=0
- #3\XINT_geq_firstiszero % |#1#2|>0
- 0{\xint_UDsignsfork
- #1#3\XINT_geq_minusminus
- #1-\XINT_geq_minusplus
- #3-\XINT_geq_plusminus
- --\XINT_geq_plusplus
- \krof }%
+ #1\XINT_geq_firstiszero
+ #2\XINT_geq_secondiszero
+ 0{}%
\krof
- {#2}{#4}#1#3%
+ \xint_UDsignsfork
+ #1#2\XINT_geq_minusminus
+ #1-\XINT_geq_minusplus
+ #2-\XINT_geq_plusminus
+ --\XINT_geq_plusplus
+ \krof #1#2%
+}%
+\def\XINT_geq_firstiszero #1\krof 0#2#3\Z #4\Z
+ {\xint_UDzerofork #2{ 1}0{ 0}\krof }%
+\def\XINT_geq_secondiszero #1\krof #20#3\Z #4\Z { 1}%
+\def\XINT_geq_plusminus #1-{\XINT_geq_plusplus #1{}}%
+\def\XINT_geq_minusplus -#1{\XINT_geq_plusplus {}#1}%
+\def\XINT_geq_minusminus --{\XINT_geq_plusplus {}{}}%
+\def\XINT_geq_plusplus #1#2#3\Z #4\Z {\XINT_geq_pp #1#4\Z #2#3\Z }%
+\def\XINT_geq_pp #1\Z
+{%
+ \expandafter\XINT_geq_pp_a
+ \romannumeral0\expandafter\XINT_sepandrev_andcount
+ \romannumeral0\XINT_zeroes_forviii #1\R\R\R\R\R\R\R\R{10}0000001\W
+ #1\XINT_rsepbyviii_end_A 2345678%
+ \XINT_rsepbyviii_end_B 2345678\relax\xint_c_ii\xint_c_iii
+ \R.\xint_c_vi\R.\xint_c_v\R.\xint_c_iv\R.\xint_c_iii
+ \R.\xint_c_ii\R.\xint_c_i\R.\xint_c_\W
+ \X
+}%
+\def\XINT_geq_pp_a #1.#2\X #3\Z
+{%
+ \expandafter\XINT_geq_checklengths
+ \the\numexpr #1\expandafter.%
+ \romannumeral0\expandafter\XINT_sepandrev_andcount
+ \romannumeral0\XINT_zeroes_forviii #3\R\R\R\R\R\R\R\R{10}0000001\W
+ #3\XINT_rsepbyviii_end_A 2345678%
+ \XINT_rsepbyviii_end_B 2345678\relax \xint_c_ii\xint_c_iii
+ \R.\xint_c_vi\R.\xint_c_v\R.\xint_c_iv\R.\xint_c_iii
+ \R.\xint_c_ii\R.\xint_c_i\R.\xint_c_\W
+ \Z!\Z!\Z!\Z!\Z!\W #2\Z!\Z!\Z!\Z!\Z!\W
+}%
+\def\XINT_geq_checklengths #1.#2.%
+{%
+ \ifnum #1=#2
+ \expandafter\xint_firstoftwo
+ \else
+ \expandafter\xint_secondoftwo
+ \fi
+ \XINT_geq_aa {\XINT_geq_distinctlengths {#1}{#2}}
}%
-\def\XINT_geq_secondiszero #1#2#3#4{ 1}%
-\def\XINT_geq_firstiszero #1#2#3#4{ 0}%
-\def\XINT_geq_plusplus #1#2#3#4{\XINT_geq_pre {#4#2}{#3#1}}%
-\def\XINT_geq_minusminus #1#2#3#4{\XINT_geq_pre {#2}{#1}}%
-\def\XINT_geq_minusplus #1#2#3#4{\XINT_geq_pre {#4#2}{#1}}%
-\def\XINT_geq_plusminus #1#2#3#4{\XINT_geq_pre {#2}{#3#1}}%
-\def\XINT_geq_pre #1%
+\def\XINT_geq_distinctlengths #1#2#3\W #4\W
{%
- \expandafter\XINT_geq_pre_b\expandafter
- {\romannumeral0\XINT_RQ {}#1\R\R\R\R\R\R\R\R\Z }%
+ \ifnum #1>#2
+ \expandafter\xint_firstoftwo
+ \else
+ \expandafter\xint_secondoftwo
+ \fi
+ { 1}{ 0}%
}%
-\def\XINT_geq_pre_b #1#2%
+%%%%%%%%%%%%
+\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!%
{%
- \expandafter\XINT_geq_A
- \expandafter1\expandafter{\expandafter}%
- \romannumeral0\XINT_RQ {}#2\R\R\R\R\R\R\R\R\Z
- \W\X\Y\Z #1 \W\X\Y\Z
+ \XINT_geq_b #1!#6!#2!#7!#3!#8!#4!#9!#5\W
}%
-\def\XINT_geq_A #1#2#3\W\X\Y\Z #4#5#6#7%
+\def\XINT_geq_b #1#2#3!#4!%
{%
- \xint_gob_til_W #4\xint_geq_az\W
- \XINT_geq_B #1{#4#5#6#7}{#2}#3\W\X\Y\Z
+ \xint_gob_til_Z #2\XINT_geq_bi \Z
+ \expandafter\XINT_geq_c\the\numexpr#1+1#4-#3-\xint_c_i.%
}%
-\def\XINT_geq_B #1#2#3#4#5#6#7%
+\def\XINT_geq_c 1#1#2.%
{%
- \xint_gob_til_W #4\xint_geq_bz\W
- \XINT_geq_onestep #1#2{#7#6#5#4}{#3}%
+ 1#2\expandafter!\the\numexpr\XINT_geq_d #1%
}%
-\def\XINT_geq_onestep #1#2#3#4#5#6%
+\def\XINT_geq_d #1#2#3!#4!%
{%
- \expandafter\XINT_geq_backtoA\the\numexpr 11#5#4#3#2-#6+#1-\xint_c_i.%
+ \xint_gob_til_Z #2\XINT_geq_di \Z
+ \expandafter\XINT_geq_e\the\numexpr#1+1#4-#3-\xint_c_i.%
}%
-\def\XINT_geq_backtoA #1#2#3.#4%
+\def\XINT_geq_e 1#1#2.%
{%
- \XINT_geq_A #2{#3#4}%
+ 1#2\expandafter!\the\numexpr\XINT_geq_f #1%
}%
-\def\xint_geq_bz\W\XINT_geq_onestep #1\W\X\Y\Z { 1}%
-\def\xint_geq_az\W\XINT_geq_B #1#2#3#4#5#6#7%
+\def\XINT_geq_f #1#2#3!#4!%
{%
- \xint_gob_til_W #4\xint_geq_ez\W
- \XINT_geq_Eenter #1%
+ \xint_gob_til_Z #2\XINT_geq_fi \Z
+ \expandafter\XINT_geq_g\the\numexpr#1+1#4-#3-\xint_c_i.%
}%
-\def\XINT_geq_Eenter #1\W\X\Y\Z { 0}%
-\def\xint_geq_ez\W\XINT_geq_Eenter #1%
+\def\XINT_geq_g 1#1#2.%
{%
- \xint_UDzerofork
- #1{ 0} % il y a une retenue
- 0{ 1} % pas de retenue
- \krof
+ 1#2\expandafter!\the\numexpr\XINT_geq_h #1%
+}%
+\def\XINT_geq_h #1#2#3!#4!%
+{%
+ \xint_gob_til_Z #2\XINT_geq_hi \Z
+ \expandafter\XINT_geq_i\the\numexpr#1+1#4-#3-\xint_c_i.%
+}%
+\def\XINT_geq_i 1#1#2.%
+{%
+ 1#2\expandafter!\the\numexpr\XINT_geq_a #1%
+}%
+\def\XINT_geq_bi\Z
+ \expandafter\XINT_geq_c\the\numexpr#1+1#2-#3.#4!#5!#6!#7!#8!#9!\Z !\W
+{%
+ \XINT_geq_k #1#2!#5!#7!#9!%
+}%
+\def\XINT_geq_di\Z
+ \expandafter\XINT_geq_e\the\numexpr#1+1#2-#3.#4!#5!#6!#7!#8\W
+{%
+ \XINT_geq_k #1#2!#5!#7!%
+}%
+\def\XINT_geq_fi\Z
+ \expandafter\XINT_geq_g\the\numexpr#1+1#2-#3.#4!#5!#6\W
+{%
+ \XINT_geq_k #1#2!#5!%
}%
+\def\XINT_geq_hi\Z
+ \expandafter\XINT_geq_i\the\numexpr#1+1#2-#3.#4\W
+{%
+ \XINT_geq_k #1#2!%
+}%
+%%%%%%%%%%%%
+\def\XINT_geq_k #1#2\W
+{%
+ \xint_UDzerofork
+ #1{-1\relax { 0}}%
+ 0{-1\relax { 1}}%
+ \krof
+}%
+\def\XINT_geq_w #1-1#2{#2}%
\def\xintiMax {\romannumeral0\xintimax }%
\def\xintimax #1%
{%
@@ -574,7 +691,6 @@
{%
\expandafter\XINT_max_pre\expandafter {\romannumeral-`0#2}{#1}%
}%
-\let\xintMax\xintiMax \let\xintmax\xintimax % deprecated, should be only with xintfrac
\def\XINT_max_pre #1#2{\XINT_max_fork #1\Z #2\Z {#2}{#1}}%
\def\XINT_Max #1#2{\romannumeral0\XINT_max_fork #2\Z #1\Z {#1}{#2}}%
\def\XINT_max_fork #1#2\Z #3#4\Z
@@ -623,7 +739,6 @@
\def\XINT_imaxof_d #1\Z
{\expandafter\XINT_imaxof_b\romannumeral0\xintimax {#1}}%
\def\XINT_imaxof_e #1\Z #2\Z { #2}%
-\let\xintMaxof\xintiMaxof \let\xintmaxof\xintimaxof
\def\xintiMin {\romannumeral0\xintimin }%
\def\xintimin #1%
{%
@@ -642,7 +757,6 @@
{%
\expandafter\XINT_min_pre\expandafter {\romannumeral-`0#2}{#1}%
}%
-\let\xintMin\xintiMin \let\xintmin\xintimin % deprecated
\def\XINT_min_pre #1#2{\XINT_min_fork #1\Z #2\Z {#2}{#1}}%
\def\XINT_Min #1#2{\romannumeral0\XINT_min_fork #2\Z #1\Z {#1}{#2}}%
\def\XINT_min_fork #1#2\Z #3#4\Z
@@ -691,148 +805,30 @@
\def\XINT_iminof_d #1\Z
{\expandafter\XINT_iminof_b\romannumeral0\xintimin {#1}}%
\def\XINT_iminof_e #1\Z #2\Z { #2}%
-\let\xintMinof\xintiMinof \let\xintminof\xintiminof
\def\xintiiSum {\romannumeral0\xintiisum }%
\def\xintiisum #1{\xintiisumexpr #1\relax }%
\def\xintiiSumExpr {\romannumeral0\xintiisumexpr }%
\def\xintiisumexpr {\expandafter\XINT_sumexpr\romannumeral-`0}%
-\let\xintSum\xintiiSum \let\xintsum\xintiisum
-\let\xintSumExpr\xintiiSumExpr \let\xintsumexpr\xintiisumexpr
-\def\XINT_sumexpr {\XINT_sum_loop {0000}{0000}}%
-\def\XINT_sum_loop #1#2#3%
-{%
- \expandafter\XINT_sum_checksign\romannumeral-`0#3\Z {#1}{#2}%
-}%
-\def\XINT_sum_checksign #1%
-{%
- \xint_gob_til_relax #1\XINT_sum_finished\relax
- \xint_gob_til_zero #1\XINT_sum_skipzeroinput0%
- \xint_UDsignfork
- #1\XINT_sum_N
- -{\XINT_sum_P #1}%
- \krof
-}%
-\def\XINT_sum_finished #1\Z #2#3%
-{%
- \XINT_sub_A 1{}#3\W\X\Y\Z #2\W\X\Y\Z
-}%
-\def\XINT_sum_skipzeroinput #1\krof #2\Z {\XINT_sum_loop }%
-\def\XINT_sum_P #1\Z #2%
-{%
- \expandafter\XINT_sum_loop\expandafter
- {\romannumeral0\expandafter
- \XINT_addr_A\expandafter0\expandafter{\expandafter}%
- \romannumeral0\XINT_RQ {}#1\R\R\R\R\R\R\R\R\Z
- \W\X\Y\Z #2\W\X\Y\Z }%
-}%
-\def\XINT_sum_N #1\Z #2#3%
-{%
- \expandafter\XINT_sum_NN\expandafter
- {\romannumeral0\expandafter
- \XINT_addr_A\expandafter0\expandafter{\expandafter}%
- \romannumeral0\XINT_RQ {}#1\R\R\R\R\R\R\R\R\Z
- \W\X\Y\Z #3\W\X\Y\Z }{#2}%
-}%
-\def\XINT_sum_NN #1#2{\XINT_sum_loop {#2}{#1}}%
+\def\XINT_sumexpr {\XINT_sum_loop_a 0\Z }%
+\def\XINT_sum_loop_a #1\Z #2%
+ {\expandafter\XINT_sum_loop_b \romannumeral-`0#2\Z #1\Z \Z}%
+\def\XINT_sum_loop_b #1%
+ {\xint_gob_til_relax #1\XINT_sum_finished\relax\XINT_sum_loop_c #1}%
+\def\XINT_sum_loop_c
+ {\expandafter\XINT_sum_loop_a\romannumeral0\XINT_add_fork }%
+\def\XINT_sum_finished #1\Z #2\Z \Z { #2}%
\def\xintiiPrd {\romannumeral0\xintiiprd }%
\def\xintiiprd #1{\xintiiprdexpr #1\relax }%
-\let\xintPrd\xintiiPrd
-\let\xintprd\xintiiprd
\def\xintiiPrdExpr {\romannumeral0\xintiiprdexpr }%
\def\xintiiprdexpr {\expandafter\XINT_prdexpr\romannumeral-`0}%
-\let\xintPrdExpr\xintiiPrdExpr
-\let\xintprdexpr\xintiiprdexpr
\def\XINT_prdexpr {\XINT_prod_loop_a 1\Z }%
\def\XINT_prod_loop_a #1\Z #2%
- {\expandafter\XINT_prod_loop_b \romannumeral-`0#2\Z #1\Z \Z}%
+ {\expandafter\XINT_prod_loop_b \romannumeral-`0#2\Z #1\Z \Z}%
\def\XINT_prod_loop_b #1%
{\xint_gob_til_relax #1\XINT_prod_finished\relax\XINT_prod_loop_c #1}%
\def\XINT_prod_loop_c
{\expandafter\XINT_prod_loop_a\romannumeral0\XINT_mul_fork }%
-\def\XINT_prod_finished #1\Z #2\Z \Z { #2}%
-\def\xintiFac {\romannumeral0\xintifac }%
-\def\xintifac #1%
-{%
- \expandafter\XINT_fac_fork\expandafter{\the\numexpr #1}%
-}%
-\let\xintFac\xintiFac \let\xintfac\xintifac
-\def\XINT_fac_fork #1%
-{%
- \ifcase\XINT_cntSgn #1\Z
- \xint_afterfi{\expandafter\space\expandafter 1\xint_gobble_i }%
- \or
- \expandafter\XINT_fac_checklength
- \else
- \xint_afterfi{\expandafter\xintError:FactorialOfNegativeNumber
- \expandafter\space\expandafter 1\xint_gobble_i }%
- \fi
- {#1}%
-}%
-\def\XINT_fac_checklength #1%
-{%
- \ifnum #1>100000
- \xint_afterfi{\expandafter\xintError:FactorialOfTooBigNumber
- \expandafter\space\expandafter 1\xint_gobble_i }%
- \else
- \xint_afterfi{\ifnum #1>\xint_c_ixixixix
- \expandafter\XINT_fac_big_loop
- \else
- \expandafter\XINT_fac_loop
- \fi }%
- \fi
- {#1}%
-}%
-\def\XINT_fac_big_loop #1{\XINT_fac_big_loop_main {10000}{#1}{}}%
-\def\XINT_fac_big_loop_main #1#2#3%
-{%
- \ifnum #1<#2
- \expandafter
- \XINT_fac_big_loop_main
- \expandafter
- {\the\numexpr #1+1\expandafter }%
- \else
- \expandafter\XINT_fac_big_docomputation
- \fi
- {#2}{#3{#1}}%
-}%
-\def\XINT_fac_big_docomputation #1#2%
-{%
- \expandafter \XINT_fac_bigcompute_loop \expandafter
- {\romannumeral0\XINT_fac_loop {9999}}#2\relax
-}%
-\def\XINT_fac_bigcompute_loop #1#2%
-{%
- \xint_gob_til_relax #2\XINT_fac_bigcompute_end\relax
- \expandafter\XINT_fac_bigcompute_loop\expandafter
- {\expandafter\XINT_mul_enter
- \romannumeral0\XINT_RQ {}#2\R\R\R\R\R\R\R\R\Z
- \Z\Z\Z\Z #1\W\W\W\W }%
-}%
-\def\XINT_fac_bigcompute_end #1#2#3#4#5%
-{%
- \XINT_fac_bigcompute_end_ #5%
-}%
-\def\XINT_fac_bigcompute_end_ #1\R #2\Z \W\X\Y\Z #3\W\X\Y\Z { #3}%
-\def\XINT_fac_loop #1{\XINT_fac_loop_main 1{1000}{#1}}%
-\def\XINT_fac_loop_main #1#2#3%
-{%
- \ifnum #3>#1
- \else
- \expandafter\XINT_fac_loop_exit
- \fi
- \expandafter\XINT_fac_loop_main\expandafter
- {\the\numexpr #1+1\expandafter }\expandafter
- {\romannumeral0\XINT_mul_Mr {#1}#2\Z\Z\Z\Z }%
- {#3}%
-}%
-\def\XINT_fac_loop_exit #1#2#3#4#5#6#7%
-{%
- \XINT_fac_loop_exit_ #6%
-}%
-\def\XINT_fac_loop_exit_ #1#2#3%
-{%
- \XINT_mul_M
-}%
+\def\XINT_prod_finished\relax\XINT_prod_loop_c #1\Z #2\Z \Z { #2}%
\def\xintiiMON {\romannumeral0\xintiimon }%
\def\xintiimon #1%
{%
@@ -1251,10 +1247,10 @@
\def\xintisqrt {\expandafter\XINT_sqrt_post\romannumeral0\xintisquareroot }%
\def\xintiisqrt {\expandafter\XINT_sqrt_post\romannumeral0\xintiisquareroot }%
\def\xintiisqrtr {\expandafter\XINT_sqrtr_post\romannumeral0\xintiisquareroot }%
-\def\XINT_sqrt_post #1#2{\XINT_dec_pos #1\R\R\R\R\R\R\R\R\Z \W\W\W\W\W\W\W\W }%
-\def\XINT_sqrtr_post #1#2{\xintiiifLt {#2}{#1}% Lt <-> a<b
- { #1}{\XINT_dec_pos #1\R\R\R\R\R\R\R\R\Z \W\W\W\W\W\W\W\W }}%
-\def\xintisquareroot #1{\expandafter\XINT_sqrt_checkin\romannumeral0\xintnum{#1}\Z }%
+\def\XINT_sqrt_post #1#2{\XINT_dec_pos #1\Z }%
+\def\XINT_sqrtr_post #1#2{\xintiiifLt {#2}{#1}{ #1}{\XINT_dec_pos #1\Z}}%
+\def\xintisquareroot #1%
+ {\expandafter\XINT_sqrt_checkin\romannumeral0\xintnum{#1}\Z }%
\def\xintiisquareroot #1{\expandafter\XINT_sqrt_checkin\romannumeral-`0#1\Z }%
\def\XINT_sqrt_checkin #1%
{%
@@ -1400,8 +1396,7 @@
\def\XINT_sqrt_big_g #1#2%
{%
\expandafter\XINT_sqrt_big_j
- \romannumeral0\xintiidivision{#1}%
- {\romannumeral0\XINT_dbl_pos #2\R\R\R\R\R\R\R\Z \W\W\W\W\W\W\W }{#2}%
+ \romannumeral0\xintiidivision{#1}{\romannumeral0\XINT_dbl_pos #2\Z}{#2}%
}%
\def\XINT_sqrt_big_j #1%
{%
@@ -1427,6 +1422,15 @@
{\expandafter\XINT_iie\the\numexpr #2\expandafter.\expandafter{\romannumeral-`0#1}}%
\def\XINT_iie #1.#2{\ifnum#1>\xint_c_ \xint_dothis{\xint_dsh {#2}{-#1}}\fi
\xint_orthat{ #2}}%
+\catcode`! 11
+\def\xintMax {\Did_you_mean_iiMax?or_load_xintfrac!}%
+\def\xintMin {\Did_you_mean_iiMin?or_load_xintfrac!}%
+\def\xintMaxof {\Did_you_mean_iMaxof?or_load_xintfrac!}%
+\def\xintMinof {\Did_you_mean_iMinof?or_load_xintfrac!}%
+\def\xintSum {\Did_you_mean_iiSum?or_load_xintfrac!}%
+\def\xintPrd {\Did_you_mean_iiPrd?or_load_xintfrac!}%
+\def\xintPrdExpr {\Did_you_mean_iiPrdExpr?or_load_xintfrac!}%
+\def\xintSumExpr {\Did_you_mean_iiSumExpr?or_load_xintfrac!}%
\XINT_restorecatcodes_endinput%
\endinput
%%
diff --git a/Master/texmf-dist/tex/generic/xint/xintbinhex.sty b/Master/texmf-dist/tex/generic/xint/xintbinhex.sty
index 3876c864057..1fb50a91f74 100644
--- a/Master/texmf-dist/tex/generic/xint/xintbinhex.sty
+++ b/Master/texmf-dist/tex/generic/xint/xintbinhex.sty
@@ -21,7 +21,7 @@
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%% ---------------------------------------------------------------
-%% The xint bundle v1.1c 2015/09/12
+%% The xint bundle v1.2 2015/10/10
%% Copyright (C) 2013-2015 by Jean-Francois Burnol
%% xintbinhex: Expandable binary and hexadecimal conversions
%% ---------------------------------------------------------------
@@ -70,15 +70,10 @@
\XINTsetupcatcodes% defined in xintkernel.sty
\XINT_providespackage
\ProvidesPackage{xintbinhex}%
- [2015/09/12 v1.1c Expandable binary and hexadecimal conversions (jfB)]%
-\chardef\xint_c_xvi 16
-\chardef\xint_c_ii^vii 128
-\mathchardef\xint_c_ii^viii 256
-\mathchardef\xint_c_ii^xii 4096
-\newcount\xint_c_ii^xv \xint_c_ii^xv 32768
-\newcount\xint_c_ii^xvi \xint_c_ii^xvi 65536
+ [2015/10/10 v1.2 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
-\newcount\xint_c_x^ix \xint_c_x^ix 1000000000
\def\XINT_tmpa #1{\ifx\relax#1\else
\expandafter\edef\csname XINT_sdth_#1\endcsname
{\ifcase #1 0\or 1\or 2\or 3\or 4\or 5\or 6\or 7\or
@@ -172,6 +167,35 @@
\csname XINT_sdtb_#1\expandafter\expandafter\expandafter\endcsname
\csname XINT_sdtb_\the\numexpr #2-\xint_c_xvi*#1\endcsname
}%
+\def\XINT_OQ #1#2#3#4#5#6#7#8#9%
+{%
+ \xint_gob_til_R #9\XINT_OQ_end_a\R\XINT_OQ {#9#8#7#6#5#4#3#2#1}%
+}%
+\def\XINT_OQ_end_a\R\XINT_OQ #1#2\Z
+{%
+ \XINT_OQ_end_b #1\Z
+}%
+\def\XINT_OQ_end_b #1#2#3#4#5#6#7#8%
+{%
+ \xint_gob_til_R
+ #8\XINT_OQ_end_viii
+ #7\XINT_OQ_end_vii
+ #6\XINT_OQ_end_vi
+ #5\XINT_OQ_end_v
+ #4\XINT_OQ_end_iv
+ #3\XINT_OQ_end_iii
+ #2\XINT_OQ_end_ii
+ \R\XINT_OQ_end_i
+ \Z #2#3#4#5#6#7#8%
+}%
+\def\XINT_OQ_end_viii #1\Z #2#3#4#5#6#7#8#9\Z { #9}%
+\def\XINT_OQ_end_vii #1\Z #2#3#4#5#6#7#8#9\Z { #8#90000000}%
+\def\XINT_OQ_end_vi #1\Z #2#3#4#5#6#7#8#9\Z { #7#8#9000000}%
+\def\XINT_OQ_end_v #1\Z #2#3#4#5#6#7#8#9\Z { #6#7#8#900000}%
+\def\XINT_OQ_end_iv #1\Z #2#3#4#5#6#7#8#9\Z { #5#6#7#8#90000}%
+\def\XINT_OQ_end_iii #1\Z #2#3#4#5#6#7#8#9\Z { #4#5#6#7#8#9000}%
+\def\XINT_OQ_end_ii #1\Z #2#3#4#5#6#7#8#9\Z { #3#4#5#6#7#8#900}%
+\def\XINT_OQ_end_i \Z #1#2#3#4#5#6#7#8\Z { #1#2#3#4#5#6#7#80}%
\def\xintDecToHex {\romannumeral0\xintdectohex }%
\def\xintdectohex #1%
{\expandafter\XINT_dth_checkin\romannumeral-`0#1\W\W\W\W \T}%
diff --git a/Master/texmf-dist/tex/generic/xint/xintcfrac.sty b/Master/texmf-dist/tex/generic/xint/xintcfrac.sty
index f3585235d2f..4a1656c4cb0 100644
--- a/Master/texmf-dist/tex/generic/xint/xintcfrac.sty
+++ b/Master/texmf-dist/tex/generic/xint/xintcfrac.sty
@@ -21,7 +21,7 @@
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%% ---------------------------------------------------------------
-%% The xint bundle v1.1c 2015/09/12
+%% The xint bundle v1.2 2015/10/10
%% Copyright (C) 2013-2015 by Jean-Francois Burnol
%% xintcfrac: Expandable continued fractions with xint package
%% ---------------------------------------------------------------
@@ -70,7 +70,7 @@
\XINTsetupcatcodes% defined in xintkernel.sty
\XINT_providespackage
\ProvidesPackage{xintcfrac}%
- [2015/09/12 v1.1c Expandable continued fractions with xint package (jfB)]%
+ [2015/10/10 v1.2 Expandable continued fractions with xint package (jfB)]%
\def\xintCFrac {\romannumeral0\xintcfrac }%
\def\xintcfrac #1%
{%
@@ -483,8 +483,8 @@
\expandafter\XINT_ctf_loop_c\expandafter
{\romannumeral0\XINT_mul_fork #2\Z #4\Z }%
{\romannumeral0\XINT_mul_fork #2\Z #3\Z }%
- {\romannumeral0\xintiiadd {\XINT_Mul {#2}{#6}}{\XINT_Mul {#1}{#4}}}%
- {\romannumeral0\xintiiadd {\XINT_Mul {#2}{#5}}{\XINT_Mul {#1}{#3}}}%
+ {\romannumeral0\xintiiadd {\XINT_mul_fork #2\Z #6\Z}{\XINT_mul_fork #1\Z #4\Z}}%
+ {\romannumeral0\xintiiadd {\XINT_mul_fork #2\Z #5\Z}{\XINT_mul_fork #1\Z #3\Z}}%
}%
\def\XINT_ctf_loop_c #1#2%
{%
@@ -517,8 +517,8 @@
\def\XINT_icstf_loop_b #1.#2#3#4#5%
{%
\expandafter\XINT_icstf_loop_c\expandafter
- {\romannumeral0\xintiiadd {#5}{\XINT_Mul {#1}{#3}}}%
- {\romannumeral0\xintiiadd {#4}{\XINT_Mul {#1}{#2}}}%
+ {\romannumeral0\xintiiadd {#5}{\XINT_mul_fork #1\Z #3\Z}}%
+ {\romannumeral0\xintiiadd {#4}{\XINT_mul_fork #1\Z #2\Z}}%
{#2}{#3}%
}%
\def\XINT_icstf_loop_c #1#2%
@@ -545,8 +545,8 @@
\expandafter\XINT_gctf_loop_c\expandafter
{\romannumeral0\XINT_mul_fork #2\Z #4\Z }%
{\romannumeral0\XINT_mul_fork #2\Z #3\Z }%
- {\romannumeral0\xintiiadd {\XINT_Mul {#2}{#6}}{\XINT_Mul {#1}{#4}}}%
- {\romannumeral0\xintiiadd {\XINT_Mul {#2}{#5}}{\XINT_Mul {#1}{#3}}}%
+ {\romannumeral0\xintiiadd {\XINT_mul_fork #2\Z #6\Z}{\XINT_mul_fork #1\Z #4\Z}}%
+ {\romannumeral0\xintiiadd {\XINT_mul_fork #2\Z #5\Z}{\XINT_mul_fork #1\Z #3\Z}}%
}%
\def\XINT_gctf_loop_c #1#2%
{%
@@ -604,8 +604,8 @@
\def\XINT_igctf_loop_b #1.#2#3#4#5%
{%
\expandafter\XINT_igctf_loop_c\expandafter
- {\romannumeral0\xintiiadd {#5}{\XINT_Mul {#1}{#3}}}%
- {\romannumeral0\xintiiadd {#4}{\XINT_Mul {#1}{#2}}}%
+ {\romannumeral0\xintiiadd {#5}{\XINT_mul_fork #1\Z #3\Z}}%
+ {\romannumeral0\xintiiadd {#4}{\XINT_mul_fork #1\Z #2\Z}}%
{#2}{#3}%
}%
\def\XINT_igctf_loop_c #1#2%
@@ -658,8 +658,8 @@
\expandafter\XINT_ctcv_loop_c\expandafter
{\romannumeral0\XINT_mul_fork #2\Z #4\Z }%
{\romannumeral0\XINT_mul_fork #2\Z #3\Z }%
- {\romannumeral0\xintiiadd {\XINT_Mul {#2}{#6}}{\XINT_Mul {#1}{#4}}}%
- {\romannumeral0\xintiiadd {\XINT_Mul {#2}{#5}}{\XINT_Mul {#1}{#3}}}%
+ {\romannumeral0\xintiiadd {\XINT_mul_fork #2\Z #6\Z}{\XINT_mul_fork #1\Z #4\Z}}%
+ {\romannumeral0\xintiiadd {\XINT_mul_fork #2\Z #5\Z}{\XINT_mul_fork #1\Z #3\Z}}%
}%
\def\XINT_ctcv_loop_c #1#2%
{%
@@ -698,8 +698,8 @@
\def\XINT_icstcv_loop_b #1.#2#3#4#5%
{%
\expandafter\XINT_icstcv_loop_c\expandafter
- {\romannumeral0\xintiiadd {#5}{\XINT_Mul {#1}{#3}}}%
- {\romannumeral0\xintiiadd {#4}{\XINT_Mul {#1}{#2}}}%
+ {\romannumeral0\xintiiadd {#5}{\XINT_mul_fork #1\Z #3\Z}}%
+ {\romannumeral0\xintiiadd {#4}{\XINT_mul_fork #1\Z #2\Z}}%
{{#2}{#3}}%
}%
\def\XINT_icstcv_loop_c #1#2%
@@ -732,8 +732,8 @@
\expandafter\XINT_gctcv_loop_c\expandafter
{\romannumeral0\XINT_mul_fork #2\Z #4\Z }%
{\romannumeral0\XINT_mul_fork #2\Z #3\Z }%
- {\romannumeral0\xintiiadd {\XINT_Mul {#2}{#6}}{\XINT_Mul {#1}{#4}}}%
- {\romannumeral0\xintiiadd {\XINT_Mul {#2}{#5}}{\XINT_Mul {#1}{#3}}}%
+ {\romannumeral0\xintiiadd {\XINT_mul_fork #2\Z #6\Z}{\XINT_mul_fork #1\Z #4\Z}}%
+ {\romannumeral0\xintiiadd {\XINT_mul_fork #2\Z #5\Z}{\XINT_mul_fork #1\Z #3\Z}}%
}%
\def\XINT_gctcv_loop_c #1#2%
{%
@@ -801,8 +801,8 @@
\def\XINT_igctcv_loop_b #1.#2#3#4#5%
{%
\expandafter\XINT_igctcv_loop_c\expandafter
- {\romannumeral0\xintiiadd {#5}{\XINT_Mul {#1}{#3}}}%
- {\romannumeral0\xintiiadd {#4}{\XINT_Mul {#1}{#2}}}%
+ {\romannumeral0\xintiiadd {#5}{\XINT_mul_fork #1\Z #3\Z}}%
+ {\romannumeral0\xintiiadd {#4}{\XINT_mul_fork #1\Z #2\Z}}%
{{#2}{#3}}%
}%
\def\XINT_igctcv_loop_c #1#2%
diff --git a/Master/texmf-dist/tex/generic/xint/xintcore.sty b/Master/texmf-dist/tex/generic/xint/xintcore.sty
index d9bbb3779f8..3352af4f189 100644
--- a/Master/texmf-dist/tex/generic/xint/xintcore.sty
+++ b/Master/texmf-dist/tex/generic/xint/xintcore.sty
@@ -21,7 +21,7 @@
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%% ---------------------------------------------------------------
-%% The xint bundle v1.1c 2015/09/12
+%% The xint bundle v1.2 2015/10/10
%% Copyright (C) 2013-2015 by Jean-Francois Burnol
%% xintcore: Expandable arithmetic on big integers
%% ---------------------------------------------------------------
@@ -70,160 +70,15 @@
\XINTsetupcatcodes% defined in xintkernel.sty
\XINT_providespackage
\ProvidesPackage{xintcore}%
- [2015/09/12 v1.1c Expandable arithmetic on big integers (jfB)]%
-\def\xint_minus_thenstop { -}%
-\def\xint_gob_til_zeros_iii #1000{}%
-\def\xint_gob_til_zeros_iv #10000{}%
-\def\xint_gob_til_one #11{}%
-\def\xint_gob_til_G #1G{}%
-\def\xint_gob_til_minus #1-{}%
-\def\xint_gob_til_relax #1\relax {}%
-\def\xint_exchangetwo_keepbraces #1#2{{#2}{#1}}%
-\def\xint_exchangetwo_keepbraces_thenstop #1#2{ {#2}{#1}}%
-\def\xint_UDzerofork #10#2#3\krof {#2}%
-\def\xint_UDsignfork #1-#2#3\krof {#2}%
-\def\xint_UDwfork #1\W#2#3\krof {#2}%
-\def\xint_UDzerosfork #100#2#3\krof {#2}%
-\def\xint_UDonezerofork #110#2#3\krof {#2}%
-\def\xint_UDsignsfork #1--#2#3\krof {#2}%
-\chardef\xint_c_ix 9
-\chardef\xint_c_x 10
-\chardef\xint_c_ii^v 32 % not used in xint, common to xintfrac and xintbinhex
-\chardef\xint_c_ii^vi 64
-\mathchardef\xint_c_ixixixix 9999
-\mathchardef\xint_c_x^iv 10000
-\newcount\xint_c_x^viii \xint_c_x^viii 100000000
-\def\XINT_RQ #1#2#3#4#5#6#7#8#9%
-{%
- \xint_gob_til_R #9\XINT_RQ_end_a\R\XINT_RQ {#9#8#7#6#5#4#3#2#1}%
-}%
-\def\XINT_RQ_end_a\R\XINT_RQ #1#2\Z
-{%
- \XINT_RQ_end_b #1\Z
-}%
-\def\XINT_RQ_end_b #1#2#3#4#5#6#7#8%
-{%
- \xint_gob_til_R
- #8\XINT_RQ_end_viii
- #7\XINT_RQ_end_vii
- #6\XINT_RQ_end_vi
- #5\XINT_RQ_end_v
- #4\XINT_RQ_end_iv
- #3\XINT_RQ_end_iii
- #2\XINT_RQ_end_ii
- \R\XINT_RQ_end_i
- \Z #2#3#4#5#6#7#8%
-}%
-\def\XINT_RQ_end_viii #1\Z #2#3#4#5#6#7#8#9\Z { #9}%
-\def\XINT_RQ_end_vii #1\Z #2#3#4#5#6#7#8#9\Z { #8#9000}%
-\def\XINT_RQ_end_vi #1\Z #2#3#4#5#6#7#8#9\Z { #7#8#900}%
-\def\XINT_RQ_end_v #1\Z #2#3#4#5#6#7#8#9\Z { #6#7#8#90}%
-\def\XINT_RQ_end_iv #1\Z #2#3#4#5#6#7#8#9\Z { #5#6#7#8#9}%
-\def\XINT_RQ_end_iii #1\Z #2#3#4#5#6#7#8#9\Z { #4#5#6#7#8#9000}%
-\def\XINT_RQ_end_ii #1\Z #2#3#4#5#6#7#8#9\Z { #3#4#5#6#7#8#900}%
-\def\XINT_RQ_end_i \Z #1#2#3#4#5#6#7#8\Z { #1#2#3#4#5#6#7#80}%
-\def\XINT_OQ #1#2#3#4#5#6#7#8#9%
-{%
- \xint_gob_til_R #9\XINT_OQ_end_a\R\XINT_OQ {#9#8#7#6#5#4#3#2#1}%
-}%
-\def\XINT_OQ_end_a\R\XINT_OQ #1#2\Z
-{%
- \XINT_OQ_end_b #1\Z
-}%
-\def\XINT_OQ_end_b #1#2#3#4#5#6#7#8%
-{%
- \xint_gob_til_R
- #8\XINT_OQ_end_viii
- #7\XINT_OQ_end_vii
- #6\XINT_OQ_end_vi
- #5\XINT_OQ_end_v
- #4\XINT_OQ_end_iv
- #3\XINT_OQ_end_iii
- #2\XINT_OQ_end_ii
- \R\XINT_OQ_end_i
- \Z #2#3#4#5#6#7#8%
-}%
-\def\XINT_OQ_end_viii #1\Z #2#3#4#5#6#7#8#9\Z { #9}%
-\def\XINT_OQ_end_vii #1\Z #2#3#4#5#6#7#8#9\Z { #8#90000000}%
-\def\XINT_OQ_end_vi #1\Z #2#3#4#5#6#7#8#9\Z { #7#8#9000000}%
-\def\XINT_OQ_end_v #1\Z #2#3#4#5#6#7#8#9\Z { #6#7#8#900000}%
-\def\XINT_OQ_end_iv #1\Z #2#3#4#5#6#7#8#9\Z { #5#6#7#8#90000}%
-\def\XINT_OQ_end_iii #1\Z #2#3#4#5#6#7#8#9\Z { #4#5#6#7#8#9000}%
-\def\XINT_OQ_end_ii #1\Z #2#3#4#5#6#7#8#9\Z { #3#4#5#6#7#8#900}%
-\def\XINT_OQ_end_i \Z #1#2#3#4#5#6#7#8\Z { #1#2#3#4#5#6#7#80}%
-\def\XINT_SQ #1#2#3#4#5#6#7#8%
-{%
- \xint_gob_til_R #8\XINT_SQ_end_a\R\XINT_SQ {#8#7#6#5#4#3#2#1}%
-}%
-\def\XINT_SQ_end_a\R\XINT_SQ #1#2\Z
-{%
- \XINT_SQ_end_b #1\Z
-}%
-\def\XINT_SQ_end_b #1#2#3#4#5#6#7%
-{%
- \xint_gob_til_R
- #7\XINT_SQ_end_vii
- #6\XINT_SQ_end_vi
- #5\XINT_SQ_end_v
- #4\XINT_SQ_end_iv
- #3\XINT_SQ_end_iii
- #2\XINT_SQ_end_ii
- \R\XINT_SQ_end_i
- \Z #2#3#4#5#6#7%
-}%
-\def\XINT_SQ_end_vii #1\Z #2#3#4#5#6#7#8\Z { #8}%
-\def\XINT_SQ_end_vi #1\Z #2#3#4#5#6#7#8\Z { #7#8000000}%
-\def\XINT_SQ_end_v #1\Z #2#3#4#5#6#7#8\Z { #6#7#800000}%
-\def\XINT_SQ_end_iv #1\Z #2#3#4#5#6#7#8\Z { #5#6#7#80000}%
-\def\XINT_SQ_end_iii #1\Z #2#3#4#5#6#7#8\Z { #4#5#6#7#8000}%
-\def\XINT_SQ_end_ii #1\Z #2#3#4#5#6#7#8\Z { #3#4#5#6#7#800}%
-\def\XINT_SQ_end_i \Z #1#2#3#4#5#6#7\Z { #1#2#3#4#5#6#70}%
-\edef\xint_cleanupzeros_andstop #1#2#3#4%
-{%
- \noexpand\expandafter\space\noexpand\the\numexpr #1#2#3#4\relax
-}%
-\def\xint_cleanupzeros_nostop #1#2#3#4%
-{%
- \the\numexpr #1#2#3#4\relax
-}%
-\def\XINT_rev_andcuz #1%
-{%
- \expandafter\xint_cleanupzeros_andstop
- \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_cuz #1%
-{%
- \XINT_cuz_loop #1\W\W\W\W\W\W\W\Z%
-}%
-\def\XINT_cuz_loop #1#2#3#4#5#6#7#8%
-{%
- \xint_gob_til_W #8\xint_cuz_end_a\W
- \xint_gob_til_Z #8\xint_cuz_end_A\Z
- \XINT_cuz_check_a {#1#2#3#4#5#6#7#8}%
-}%
-\def\xint_cuz_end_a #1\XINT_cuz_check_a #2%
-{%
- \xint_cuz_end_b #2%
-}%
-\edef\xint_cuz_end_b #1#2#3#4#5\Z
-{%
- \noexpand\expandafter\space\noexpand\the\numexpr #1#2#3#4\relax
-}%
-\def\xint_cuz_end_A \Z\XINT_cuz_check_a #1{ 0}%
-\def\XINT_cuz_check_a #1%
-{%
- \expandafter\XINT_cuz_check_b\the\numexpr #1\relax
-}%
-\def\XINT_cuz_check_b #1%
-{%
- \xint_gob_til_zero #1\xint_cuz_backtoloop 0\XINT_cuz_stop #1%
-}%
-\def\XINT_cuz_stop #1\W #2\Z{ #1}%
-\def\xint_cuz_backtoloop 0\XINT_cuz_stop 0{\XINT_cuz_loop }%
+ [2015/10/10 v1.2 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
+\newcount\xint_c_x^ix \xint_c_x^ix 1000000000
+\newcount\xint_c_x^viii_mone \xint_c_x^viii_mone 99999999
+\newcount\xint_c_xii_e_viii \xint_c_xii_e_viii 1200000000
+\newcount\xint_c_xi_e_viii_mone \xint_c_xi_e_viii_mone 1099999999
+\newcount\xint_c_xii_e_viii_mone\xint_c_xii_e_viii_mone 1199999999
\def\xintiNum {\romannumeral0\xintinum }%
\def\xintinum #1%
{%
@@ -263,6 +118,195 @@
\def\XINT_num_gobacktoloop 1\XINT_num_keepsign_b {\XINT_num_loop }%
\def\XINT_num_keepsign_b #1{\XINT_num_loop -}%
\def\XINT_num_finish #1\xint_relax #2\Z { #1}%
+\edef\XINT_cuz_small #1#2#3#4#5#6#7#8%
+{%
+ \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%
+}%
+\edef\XINT_cuz_clean #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
+ {\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%
+}%
+\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_zeroes_forviii #1#2#3#4#5#6#7#8%
+{%
+ \xint_gob_til_R #8\XINT_zeroes_forviii_end\R\XINT_zeroes_forviii
+}%
+\edef\XINT_zeroes_forviii_end\R\XINT_zeroes_forviii #1#2#3#4#5#6#7#8#9\W
+{%
+ \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}%
+}%
+\def\XINT_rsepbyviii_b #1#2#3#4#5#6#7#8#9%
+{%
+ #2#3#4#5#6#7#8#9\expandafter!\the\numexpr
+ 1#1\expandafter.\the\numexpr 1\XINT_rsepbyviii
+}%
+\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
+}%
+\def\XINT_sepandrev_a {\XINT_sepandrev_b {}}%
+\def\XINT_sepandrev_b #1#2.#3.#4.#5.#6.#7.#8.#9.%
+{%
+ \xint_gob_til_R #9\XINT_sepandrev_end\R
+ \XINT_sepandrev_b {#9!#8!#7!#6!#5!#4!#3!#2!#1}%
+}%
+\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
+}%
+\def\XINT_sepandrev_andcount_a {\XINT_sepandrev_andcount_b 0.{}}%
+\def\XINT_sepandrev_andcount_b #1.#2#3.#4.#5.#6.#7.#8.#9.%
+{%
+ \xint_gob_til_R #9\XINT_sepandrev_andcount_end\R
+ \expandafter\XINT_sepandrev_andcount_b \the\numexpr #1+\xint_c_xiv.%
+ {#9!#8!#7!#6!#5!#4!#3!#2}%
+}%
+\def\XINT_sepandrev_andcount_end\R
+ \expandafter\XINT_sepandrev_andcount_b\the\numexpr #1+\xint_c_xiv.#2#3#4\W
+{\expandafter\XINT_sepandrev_andcount_done\the\numexpr \xint_c_ii*#3+#1.#2}%
+\edef\XINT_sepandrev_andcount_done #1.#21#3!%
+ {\noexpand\expandafter\space\noexpand\the\numexpr #1-#3.}%
+\def\XINT_sepbyviii_andcount
+{%
+ \expandafter\XINT_sepbyviii_andcount_a\the\numexpr\XINT_sepbyviii
+}%
+\def\XINT_sepbyviii #1#2#3#4#5#6#7#8%
+{%
+ 1#1#2#3#4#5#6#7#8\expandafter!\the\numexpr\XINT_sepbyviii
+}%
+\def\XINT_sepbyviii_end #1\relax {\relax\XINT_sepbyviii_andcount_end!}%
+\def\XINT_sepbyviii_andcount_a {\XINT_sepbyviii_andcount_b \xint_c_.}%
+\def\XINT_sepbyviii_andcount_b #1.#2!#3!#4!#5!#6!#7!#8!#9!%
+{%
+ #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
+ \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
+ \XINT_rev_nounsep {#9!#8!#7!#6!#5!#4!#3!#2!#1}%
+}%
+\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
+ \XINT_unsep_cuzsmall {#1#2#3#4#5#6#7#8#9}%
+}%
+\def\XINT_unsep_cuzsmall_end\R
+ \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
+ \XINT_div_unsepQ {#1#2#3#4#5#6#7#8#9}%
+}%
+\def\XINT_div_unsepQ_end\R\XINT_div_unsepQ #1{\XINT_div_unsepQ_x #1}%
+\def\XINT_div_unsepQ_x #1#2#3#4#5#6#7#8#9%
+{%
+ \xint_gob_til_R #9\XINT_div_unsepQ_e \R
+ \xint_gob_til_eightzeroes #1#2#3#4#5#6#7#8\XINT_div_unsepQ_y 00000000%
+ \expandafter\XINT_div_unsepQ_done \the\numexpr #1#2#3#4#5#6#7#8.#9%
+}%
+\def\XINT_div_unsepQ_e\R\xint_gob_til_eightzeroes #1\XINT_div_unsepQ_y #2\W
+ {\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
+ \XINT_div_unsepR {#1#2#3#4#5#6#7#8#9}%
+}%
+\def\XINT_div_unsepR_end\R\XINT_div_unsepR #1{\XINT_div_unsepR_done #1}%
+\def\XINT_div_unsepR_done #1\R #2\W {\XINT_cuz #1\R}%
+%%%%%%%%%%%%
+\def\XINT_unrevbyviii #11#2!1#3!1#4!1#5!1#6!1#7!1#8!1#9!%
+{%
+ \xint_gob_til_R #9\XINT_unrevbyviii_a\R
+ \XINT_unrevbyviii {#9#8#7#6#5#4#3#2#1}%
+}%
+\edef\XINT_unrevbyviii_a\R\XINT_unrevbyviii #1#2\W
+ {\noexpand\expandafter\space
+ \noexpand\romannumeral-`0\noexpand\xint_gob_til_Z #1}%
+\def\XINT_smallunrevbyviii 1#1!1#2!1#3!1#4!1#5!1#6!1#7!1#8!#9\W%
+{%
+ \expandafter\XINT_cuz_small\xint_gob_til_Z #8#7#6#5#4#3#2#1%
+}%
+\def\XINT_microrevsep #1#2#3#4#5#6#7#8%
+{%
+ 1#8#7#6#5#4#3#2#1\expandafter!\the\numexpr\XINT_microrevsep
+}%
+\def\XINT_microrevsep_end #1\W #2\expandafter #3\Z{#2!}%
+\def\xintReverseDigits {\romannumeral0\xintreversedigits }%
+\def\xintreversedigits #1{\expandafter\XINT_reversedigits\romannumeral-`0#1\Z}%
+\def\XINT_reversedigits #1%
+{%
+ \xint_UDsignfork
+ #1{\expandafter\xint_minus_thenstop\romannumeral0\XINT_reversedigits_a}%
+ -{\XINT_reversedigits_a #1}%
+ \krof
+}%
+\def\XINT_reversedigits_a #1\Z
+{%
+ \expandafter\XINT_revdigits_a\the\numexpr\expandafter\XINT_microrevsep
+ \romannumeral-`0#1{\XINT_microrevsep_end\W}\XINT_microrevsep_end
+ \XINT_microrevsep_end\XINT_microrevsep_end
+ \XINT_microrevsep_end\XINT_microrevsep_end
+ \XINT_microrevsep_end\XINT_microrevsep_end\Z
+ 1\Z!1\R!1\R!1\R!1\R!1\R!1\R!1\R!1\R!\W
+}%
+\def\XINT_revdigits_a {\XINT_revdigits_b {}}%
+\def\XINT_revdigits_b #11#2!1#3!1#4!1#5!1#6!1#7!1#8!1#9!%
+{%
+ \xint_gob_til_R #9\XINT_revdigits_end\R
+ \XINT_revdigits_b {#9#8#7#6#5#4#3#2#1}%
+}%
+\edef\XINT_revdigits_end\R\XINT_revdigits_b #1#2\W
+ {\noexpand\expandafter\space\noexpand\xint_gob_til_Z #1}%
\def\xintiiSgn {\romannumeral0\xintiisgn }%
\def\xintiisgn #1%
{%
@@ -293,7 +337,7 @@
{%
\xint_UDzerominusfork
#1-\xint_c_
- 0#1\m@ne % I will not allocate a count only for -1?
+ 0#1\xint_c_mone
0-\xint_c_i
\krof
}%
@@ -307,7 +351,6 @@
{%
\expandafter\XINT_opp \romannumeral0\xintnum{#1}%
}%
-\let\xintOpp\xintiOpp \let\xintopp\xintiopp
\def\XINT_Opp #1{\romannumeral0\XINT_opp #1}%
\def\XINT_opp #1%
{%
@@ -327,7 +370,6 @@
{%
\expandafter\XINT_abs \romannumeral0\xintnum{#1}%
}%
-\let\xintAbs\xintiAbs \let\xintabs\xintiabs
\def\XINT_Abs #1{\romannumeral0\XINT_abs #1}%
\def\XINT_abs #1%
{%
@@ -355,27 +397,26 @@
0-{ #1}% positive
\krof
}%
+\def\xintLDg {\romannumeral0\xintldg }%
+\def\xintldg #1{\xintiildg {\xintNum{#1}}}%
\def\xintiiLDg {\romannumeral0\xintiildg }%
\def\xintiildg #1%
{%
- \expandafter\XINT_ldg\expandafter {\romannumeral-`0#1}%
-}%
-\def\xintLDg {\romannumeral0\xintldg }%
-\def\xintldg #1%
-{%
- \expandafter\XINT_ldg\expandafter {\romannumeral0\xintnum{#1}}%
-}%
-\def\XINT_LDg #1{\romannumeral0\XINT_ldg {#1}}%
-\def\XINT_ldg #1%
-{%
- \expandafter\XINT_ldg_\romannumeral0\xintreverseorder {#1}\Z
-}%
-\def\XINT_ldg_ #1#2\Z{ #1}%
+ \expandafter\XINT_ldg_done\romannumeral0%
+ \expandafter\XINT_revdigits_a\the\numexpr\expandafter\XINT_microrevsep
+ \romannumeral0\expandafter\XINT_abs
+ \romannumeral-`0#1{\XINT_microrevsep_end\W}\XINT_microrevsep_end
+ \XINT_microrevsep_end\XINT_microrevsep_end
+ \XINT_microrevsep_end\XINT_microrevsep_end
+ \XINT_microrevsep_end\XINT_microrevsep_end\Z
+ 1\Z!1\R!1\R!1\R!1\R!1\R!1\R!1\R!1\R!\W
+ \Z
+}%
+\def\XINT_ldg_done #1#2\Z { #1}%
\def\xintDouble {\romannumeral0\xintdouble }%
\def\xintdouble #1%
{%
- \expandafter\XINT_dbl\romannumeral-`0#1%
- \R\R\R\R\R\R\R\Z \W\W\W\W\W\W\W
+ \expandafter\XINT_dbl\romannumeral-`0#1\Z
}%
\def\XINT_dbl #1%
{%
@@ -385,37 +426,27 @@
0-{\XINT_dbl_pos #1}%
\krof
}%
-\def\XINT_dbl_zero #1\Z \W\W\W\W\W\W\W { 0}%
+\def\XINT_dbl_zero #1\Z { 0}%
\def\XINT_dbl_neg
{\expandafter\xint_minus_thenstop\romannumeral0\XINT_dbl_pos }%
-\def\XINT_dbl_pos
-{%
- \expandafter\XINT_dbl_a \expandafter{\expandafter}\expandafter 0%
- \romannumeral0\XINT_SQ {}%
-}%
-\def\XINT_dbl_a #1#2#3#4#5#6#7#8#9%
+\def\XINT_dbl_pos #1\Z
{%
- \xint_gob_til_W #9\XINT_dbl_end_a\W
- \expandafter\XINT_dbl_b
- \the\numexpr \xint_c_x^viii+#2+\xint_c_ii*#9#8#7#6#5#4#3\relax {#1}%
+ \expandafter\XINT_dbl_pos_aa
+ \romannumeral0\expandafter\XINT_sepandrev
+ \romannumeral0\XINT_zeroes_forviii #1\R\R\R\R\R\R\R\R{10}0000001\W
+ #1\XINT_rsepbyviii_end_A 2345678%
+ \XINT_rsepbyviii_end_B 2345678\relax XX%
+ \R.\R.\R.\R.\R.\R.\R.\R.\W 1\Z!%
+ 1\R!1\R!1\R!1\R!1\R!1\R!1\R!1\R!\W
}%
-\def\XINT_dbl_b 1#1#2#3#4#5#6#7#8#9%
+\def\XINT_dbl_pos_aa
{%
- \XINT_dbl_a {#2#3#4#5#6#7#8#9}{#1}%
-}%
-\def\XINT_dbl_end_a #1+#2+#3\relax #4%
-{%
- \expandafter\XINT_dbl_end_b #2#4%
-}%
-\edef\XINT_dbl_end_b #1#2#3#4#5#6#7#8%
-{%
- \noexpand\expandafter\space\noexpand\the\numexpr #1#2#3#4#5#6#7#8\relax
+ \expandafter\XINT_mul_out\the\numexpr\XINT_verysmallmul 0.2!%
}%
\def\xintHalf {\romannumeral0\xinthalf }%
\def\xinthalf #1%
{%
- \expandafter\XINT_half\romannumeral-`0#1%
- \R\R\R\R\R\R\R\Z \W\W\W\W\W\W\W
+ \expandafter\XINT_half\romannumeral-`0#1\Z
}%
\def\XINT_half #1%
{%
@@ -425,48 +456,34 @@
0-{\XINT_half_pos #1}%
\krof
}%
-\def\XINT_half_zero #1\Z \W\W\W\W\W\W\W { 0}%
+\def\XINT_half_zero #1\Z { 0}%
\def\XINT_half_neg {\expandafter\XINT_opp\romannumeral0\XINT_half_pos }%
-\def\XINT_half_pos {\expandafter\XINT_half_a\romannumeral0\XINT_SQ {}}%
-\def\XINT_half_a #1#2#3#4#5#6#7#8%
-{%
- \xint_gob_til_W #8\XINT_half_dont\W
- \expandafter\XINT_half_b
- \the\numexpr \xint_c_x^viii+\xint_c_v*#7#6#5#4#3#2#1\relax #8%
-}%
-\edef\XINT_half_dont\W\expandafter\XINT_half_b
- \the\numexpr \xint_c_x^viii+\xint_c_v*#1#2#3#4#5#6#7\relax \W\W\W\W\W\W\W
-{%
- \noexpand\expandafter\space
- \noexpand\the\numexpr (#1#2#3#4#5#6#7+\xint_c_i)/\xint_c_ii-\xint_c_i \relax
-}%
-\def\XINT_half_b 1#1#2#3#4#5#6#7#8%
-{%
- \XINT_half_c {#2#3#4#5#6#7}{#1}%
-}%
-\def\XINT_half_c #1#2#3#4#5#6#7#8#9%
+\def\XINT_half_pos #1\Z
{%
- \xint_gob_til_W #3\XINT_half_end_a #2\W
- \expandafter\XINT_half_d
- \the\numexpr \xint_c_x^viii+\xint_c_v*#9#8#7#6#5#4#3+#2\relax {#1}%
+ \expandafter\XINT_half_pos_a
+ \romannumeral0\expandafter\XINT_sepandrev
+ \romannumeral0\XINT_zeroes_forviii #1\R\R\R\R\R\R\R\R{10}0000001\W
+ #1\XINT_rsepbyviii_end_A 2345678%
+ \XINT_rsepbyviii_end_B 2345678\relax XX%
+ \R.\R.\R.\R.\R.\R.\R.\R.\W
+ 1\Z!%
+ 1\R!1\R!1\R!1\R!1\R!1\R!1\R!1\R!\W
}%
-\def\XINT_half_d 1#1#2#3#4#5#6#7#8#9%
+\def\XINT_half_pos_a
+ {\expandafter\XINT_half_pos_b\the\numexpr\XINT_verysmallmul 0.5!}%
+\def\XINT_half_pos_b 1#1#2#3#4#5#6#7#8!1#9%
{%
- \XINT_half_c {#2#3#4#5#6#7#8#9}{#1}%
+ \xint_gob_til_Z #9\XINT_half_small \Z
+ \XINT_mul_out 1#1#2#3#4#5#6#7!1#9%
}%
-\def\XINT_half_end_a #1\W #2\relax #3%
+\edef\XINT_half_small \Z\XINT_mul_out 1#1!#2\W
{%
- \xint_gob_til_zero #1\XINT_half_end_b 0\space #1#3%
-}%
-\edef\XINT_half_end_b 0\space 0#1#2#3#4#5#6#7%
-{%
- \noexpand\expandafter\space\noexpand\the\numexpr #1#2#3#4#5#6#7\relax
+ \noexpand\expandafter\space\noexpand\the\numexpr #1\relax
}%
\def\xintDec {\romannumeral0\xintdec }%
\def\xintdec #1%
{%
- \expandafter\XINT_dec\romannumeral-`0#1%
- \R\R\R\R\R\R\R\R\Z \W\W\W\W\W\W\W\W
+ \expandafter\XINT_dec\romannumeral-`0#1\Z
}%
\def\XINT_dec #1%
{%
@@ -476,43 +493,24 @@
0-{\XINT_dec_pos #1}%
\krof
}%
-\def\XINT_dec_zero #1\W\W\W\W\W\W\W\W { -1}%
+\def\XINT_dec_zero #1\Z { -1}%
\def\XINT_dec_neg
{\expandafter\xint_minus_thenstop\romannumeral0\XINT_inc_pos }%
-\def\XINT_dec_pos
-{%
- \expandafter\XINT_dec_a \expandafter{\expandafter}%
- \romannumeral0\XINT_OQ {}%
-}%
-\def\XINT_dec_a #1#2#3#4#5#6#7#8#9%
-{%
- \expandafter\XINT_dec_b
- \the\numexpr 11#9#8#7#6#5#4#3#2-\xint_c_i\relax {#1}%
-}%
-\def\XINT_dec_b 1#1%
-{%
- \xint_gob_til_one #1\XINT_dec_A 1\XINT_dec_c
-}%
-\def\XINT_dec_c #1#2#3#4#5#6#7#8#9{\XINT_dec_a {#1#2#3#4#5#6#7#8#9}}%
-\def\XINT_dec_A 1\XINT_dec_c #1#2#3#4#5#6#7#8#9%
- {\XINT_dec_B {#1#2#3#4#5#6#7#8#9}}%
-\def\XINT_dec_B #1#2\W\W\W\W\W\W\W\W
+\def\XINT_dec_pos #1\Z
{%
- \expandafter\XINT_dec_cleanup
- \romannumeral0\XINT_rord_main {}#2%
- \xint_relax
- \xint_bye\xint_bye\xint_bye\xint_bye
- \xint_bye\xint_bye\xint_bye\xint_bye
- \xint_relax
- #1%
+ \expandafter\XINT_dec_pos_aa
+ \romannumeral0\expandafter\XINT_sepandrev
+ \romannumeral0\XINT_zeroes_forviii #1\R\R\R\R\R\R\R\R{10}0000001\W
+ #1\XINT_rsepbyviii_end_A 2345678%
+ \XINT_rsepbyviii_end_B 2345678\relax XX%
+ \R.\R.\R.\R.\R.\R.\R.\R.\W
+ \Z!\Z!\Z!\Z!\Z!\W
}%
-\edef\XINT_dec_cleanup #1#2#3#4#5#6#7#8%
- {\noexpand\expandafter\space\noexpand\the\numexpr #1#2#3#4#5#6#7#8\relax }%
+\def\XINT_dec_pos_aa {\XINT_sub_aa 100000001!\Z!\Z!\Z!\Z!\Z!\W }%
\def\xintInc {\romannumeral0\xintinc }%
\def\xintinc #1%
{%
- \expandafter\XINT_inc\romannumeral-`0#1%
- \R\R\R\R\R\R\R\R\Z \W\W\W\W\W\W\W\W
+ \expandafter\XINT_inc\romannumeral-`0#1\Z
}%
\def\XINT_inc #1%
{%
@@ -522,415 +520,208 @@
0-{\XINT_inc_pos #1}%
\krof
}%
-\def\XINT_inc_zero #1\W\W\W\W\W\W\W\W { 1}%
+\def\XINT_inc_zero #1\Z { 1}%
\def\XINT_inc_neg {\expandafter\XINT_opp\romannumeral0\XINT_dec_pos }%
-\def\XINT_inc_pos
-{%
- \expandafter\XINT_inc_a \expandafter{\expandafter}%
- \romannumeral0\XINT_OQ {}%
-}%
-\def\XINT_inc_a #1#2#3#4#5#6#7#8#9%
-{%
- \xint_gob_til_W #9\XINT_inc_end\W
- \expandafter\XINT_inc_b
- \the\numexpr 10#9#8#7#6#5#4#3#2+\xint_c_i\relax {#1}%
-}%
-\def\XINT_inc_b 1#1%
-{%
- \xint_gob_til_zero #1\XINT_inc_A 0\XINT_inc_c
-}%
-\def\XINT_inc_c #1#2#3#4#5#6#7#8#9{\XINT_inc_a {#1#2#3#4#5#6#7#8#9}}%
-\def\XINT_inc_A 0\XINT_inc_c #1#2#3#4#5#6#7#8#9%
- {\XINT_dec_B {#1#2#3#4#5#6#7#8#9}}%
-\def\XINT_inc_end\W #1\relax #2{ 1#2}%
-\def\XINT_add_A #1#2#3#4#5#6%
+\def\XINT_inc_pos #1\Z
{%
- \xint_gob_til_W #3\xint_add_az\W
- \XINT_add_AB #1{#3#4#5#6}{#2}%
+ \expandafter\XINT_inc_pos_aa
+ \romannumeral0\expandafter\XINT_sepandrev
+ \romannumeral0\XINT_zeroes_forviii #1\R\R\R\R\R\R\R\R{10}0000001\W
+ #1\XINT_rsepbyviii_end_A 2345678%
+ \XINT_rsepbyviii_end_B 2345678\relax XX%
+ \R.\R.\R.\R.\R.\R.\R.\R.\W
+ \Z!\Z!\Z!\Z!\Z!\W
}%
-\def\xint_add_az\W\XINT_add_AB #1#2%
+\def\XINT_inc_pos_aa {\XINT_add_aa 100000001!\Z!\Z!\Z!\Z!\Z!\W }%
+\def\xintiAdd {\romannumeral0\xintiadd }%
+\def\xintiadd #1{\expandafter\XINT_iadd\romannumeral0\xintnum{#1}\Z }%
+\def\xintiiAdd {\romannumeral0\xintiiadd }%
+\def\xintiiadd #1{\expandafter\XINT_iiadd\romannumeral-`0#1\Z }%
+\def\XINT_iiadd #1#2\Z #3%
{%
- \XINT_add_AC_checkcarry #1%
-}%
-\def\XINT_add_AB #1#2#3#4\W\X\Y\Z #5#6#7#8%
-{%
- \xint_gob_til_W #5\xint_add_bz\W
- \XINT_add_ABE #1#2{#8#7#6#5}{#3}#4\W\X\Y\Z
-}%
-\def\XINT_add_ABE #1#2#3#4#5#6%
-{%
- \expandafter\XINT_add_ABEA\the\numexpr #1+10#5#4#3#2+#6.%
-}%
-\def\XINT_add_ABEA #1#2#3.#4%
-{%
- \XINT_add_A #2{#3#4}%
-}%
-\def\xint_add_bz\W\XINT_add_ABE #1#2#3#4#5#6%
-{%
- \expandafter\XINT_add_CC\the\numexpr #1+10#5#4#3#2.%
-}%
-\def\XINT_add_CC #1#2#3.#4%
-{%
- \XINT_add_AC_checkcarry #2{#3#4}% on va examiner et \'eliminer #2
-}%
-\def\XINT_add_AC_checkcarry #1%
-{%
- \xint_gob_til_zero #1\xint_add_AC_nocarry 0\XINT_add_C
-}%
-\def\xint_add_AC_nocarry 0\XINT_add_C #1#2\W\X\Y\Z
-{%
- \expandafter
- \xint_cleanupzeros_andstop
- \romannumeral0%
- \XINT_rord_main {}#2%
- \xint_relax
- \xint_bye\xint_bye\xint_bye\xint_bye
- \xint_bye\xint_bye\xint_bye\xint_bye
- \xint_relax
- #1%
+ \expandafter\XINT_add_nfork\expandafter #1\romannumeral-`0#3\Z #2\Z
}%
-\def\XINT_add_C #1#2#3#4#5%
+\def\XINT_iadd #1#2\Z #3%
{%
- \xint_gob_til_W #2\xint_add_cz\W
- \XINT_add_CD {#5#4#3#2}{#1}%
+ \expandafter\XINT_add_nfork\expandafter #1\romannumeral0\xintnum{#3}\Z #2\Z
}%
-\def\XINT_add_CD #1%
+\def\XINT_add_fork #1#2\Z #3\Z {\XINT_add_nfork #1#3\Z #2\Z}%
+\def\XINT_add_nfork #1#2%
{%
- \expandafter\XINT_add_CC\the\numexpr 1+10#1.%
-}%
-\def\xint_add_cz\W\XINT_add_CD #1#2{ 1#2}%
-\def\XINT_addr_A #1#2#3#4#5#6%
-{%
- \xint_gob_til_W #3\xint_addr_az\W
- \XINT_addr_B #1{#3#4#5#6}{#2}%
-}%
-\def\xint_addr_az\W\XINT_addr_B #1#2%
-{%
- \XINT_addr_AC_checkcarry #1%
-}%
-\def\XINT_addr_B #1#2#3#4\W\X\Y\Z #5#6#7#8%
-{%
- \xint_gob_til_W #5\xint_addr_bz\W
- \XINT_addr_E #1#2{#8#7#6#5}{#3}#4\W\X\Y\Z
-}%
-\def\XINT_addr_E #1#2#3#4#5#6%
-{%
- \expandafter\XINT_addr_ABEA\the\numexpr #1+10#5#4#3#2+#6\relax
-}%
-\def\XINT_addr_ABEA #1#2#3#4#5#6#7%
-{%
- \XINT_addr_A #2{#7#6#5#4#3}%
-}%
-\def\xint_addr_bz\W\XINT_addr_E #1#2#3#4#5#6%
-{%
- \expandafter\XINT_addr_CC\the\numexpr #1+10#5#4#3#2\relax
-}%
-\def\XINT_addr_CC #1#2#3#4#5#6#7%
-{%
- \XINT_addr_AC_checkcarry #2{#7#6#5#4#3}%
-}%
-\def\XINT_addr_AC_checkcarry #1%
-{%
- \xint_gob_til_zero #1\xint_addr_AC_nocarry 0\XINT_addr_C
-}%
-\def\xint_addr_AC_nocarry 0\XINT_addr_C #1#2\W\X\Y\Z { #1#2}%
-\def\XINT_addr_C #1#2#3#4#5%
-{%
- \xint_gob_til_W #2\xint_addr_cz\W
- \XINT_addr_D {#5#4#3#2}{#1}%
-}%
-\def\XINT_addr_D #1%
-{%
- \expandafter\XINT_addr_CC\the\numexpr 1+10#1\relax
-}%
-\def\xint_addr_cz\W\XINT_addr_D #1#2{ #21000}%
-\def\XINT_addm_A #1#2#3#4#5#6%
-{%
- \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%
-{%
- \XINT_addm_AC_checkcarry #1%
-}%
-\def\XINT_addm_AB #1#2#3#4\W\X\Y\Z #5#6#7#8%
-{%
- \XINT_addm_ABE #1#2{#8#7#6#5}{#3}#4\W\X\Y\Z
-}%
-\def\XINT_addm_ABE #1#2#3#4#5#6%
-{%
- \expandafter\XINT_addm_ABEA\the\numexpr #1+10#5#4#3#2+#6.%
-}%
-\def\XINT_addm_ABEA #1#2#3.#4%
-{%
- \XINT_addm_A #2{#3#4}%
-}%
-\def\XINT_addm_AC_checkcarry #1%
-{%
- \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
-{%
- \expandafter
- \xint_cleanupzeros_andstop
- \romannumeral0%
- \XINT_rord_main {}#2%
- \xint_relax
- \xint_bye\xint_bye\xint_bye\xint_bye
- \xint_bye\xint_bye\xint_bye\xint_bye
- \xint_relax
- #1%
-}%
-\def\XINT_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
- \W\XINT_addm_CD {#5#4#3#2}{#1}%
-}%
-\def\XINT_addm_CD #1%
-{%
- \expandafter\XINT_addm_CC\the\numexpr 1+10#1.%
-}%
-\def\XINT_addm_CC #1#2#3.#4%
-{%
- \XINT_addm_AC_checkcarry #2{#3#4}%
-}%
-\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.%
-}%
-\def\XINT_addm_CDw #1.#2#3\X\Y\Z
-{%
- \XINT_addm_end #1#3%
-}%
-\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.%
-}%
-\def\XINT_addm_CDx #1.#2#3\Y\Z
-{%
- \XINT_addm_end #1#3%
-}%
-\def\xint_addm_cy
- #1\xint_addm_cz
- \W\XINT_addm_CD
-{%
- \expandafter\XINT_addm_CDy\the\numexpr 1+#1.%
-}%
-\def\XINT_addm_CDy #1.#2#3\Z
-{%
- \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\XINT_addp_A #1#2#3#4#5#6%
-{%
- \xint_gob_til_W #3\xint_addp_az\W
- \XINT_addp_AB #1{#3#4#5#6}{#2}%
-}%
-\def\xint_addp_az\W\XINT_addp_AB #1#2%
-{%
- \XINT_addp_AC_checkcarry #1%
-}%
-\def\XINT_addp_AC_checkcarry #1%
-{%
- \xint_gob_til_zero #1\xint_addp_AC_nocarry 0\XINT_addp_C
-}%
-\def\xint_addp_AC_nocarry 0\XINT_addp_C
-{%
- \XINT_addp_F
-}%
-\def\XINT_addp_AB #1#2#3#4\W\X\Y\Z #5#6#7#8%
-{%
- \XINT_addp_ABE #1#2{#8#7#6#5}{#3}#4\W\X\Y\Z
+ \xint_UDzerofork
+ #1\XINT_add_firstiszero
+ #2\XINT_add_secondiszero
+ 0{}%
+ \krof
+ \xint_UDsignsfork
+ #1#2\XINT_add_minusminus
+ #1-\XINT_add_minusplus
+ #2-\XINT_add_plusminus
+ --\XINT_add_plusplus
+ \krof #1#2%
}%
-\def\XINT_addp_ABE #1#2#3#4#5#6%
-{%
- \expandafter\XINT_addp_ABEA\the\numexpr #1+10#5#4#3#2+#6\relax
+\def\XINT_add_firstiszero #1\krof 0#2#3\Z #4\Z { #2#3}%
+\def\XINT_add_secondiszero #1\krof #20#3\Z #4\Z { #2#4}%
+\def\XINT_add_minusminus #1#2%
+ {\expandafter\xint_minus_thenstop\romannumeral0\XINT_add_pp_a {}{}}%
+\def\XINT_add_minusplus #1#2{\XINT_sub_mm_a {}#2}%
+\def\XINT_add_plusminus #1#2%
+ {\expandafter\XINT_opp\romannumeral0\XINT_sub_mm_a #1{}}%
+\def\XINT_add_pp_a #1#2#3\Z
+{%
+ \expandafter\XINT_add_pp_b
+ \romannumeral0\expandafter\XINT_sepandrev_andcount
+ \romannumeral0\XINT_zeroes_forviii #2#3\R\R\R\R\R\R\R\R{10}0000001\W
+ #2#3\XINT_rsepbyviii_end_A 2345678%
+ \XINT_rsepbyviii_end_B 2345678\relax\xint_c_ii\xint_c_iii
+ \R.\xint_c_vi\R.\xint_c_v\R.\xint_c_iv\R.\xint_c_iii
+ \R.\xint_c_ii\R.\xint_c_i\R.\xint_c_\W
+ \X #1%
+}%
+\let\XINT_add_plusplus \XINT_add_pp_a
+\def\XINT_add_pp_b #1.#2\X #3\Z
+{%
+ \expandafter\XINT_add_checklengths
+ \the\numexpr #1\expandafter.%
+ \romannumeral0\expandafter\XINT_sepandrev_andcount
+ \romannumeral0\XINT_zeroes_forviii #3\R\R\R\R\R\R\R\R{10}0000001\W
+ #3\XINT_rsepbyviii_end_A 2345678%
+ \XINT_rsepbyviii_end_B 2345678\relax\xint_c_ii\xint_c_iii
+ \R.\xint_c_vi\R.\xint_c_v\R.\xint_c_iv\R.\xint_c_iii
+ \R.\xint_c_ii\R.\xint_c_i\R.\xint_c_\W
+ \Z!\Z!\Z!\Z!\Z!\W #2\Z!\Z!\Z!\Z!\Z!\W
+}%
+\def\XINT_add_checklengths #1.#2.%
+{%
+ \ifnum #2>#1
+ \expandafter\XINT_add_exchange
+ \else
+ \expandafter\XINT_add_A
+ \fi
+ #1.#2.%
}%
-\def\XINT_addp_ABEA #1#2#3#4#5#6#7%
+\def\XINT_add_exchange #1.#2.#3\Z!\Z!\Z!\Z!\Z!\W #4\Z
{%
- \XINT_addp_A #2{#7#6#5#4#3}%<-- attention on met donc \`a droite
+ \XINT_add_A #2.#1.#4\Z!\Z!\Z!\Z!\Z!\W #3\Z
}%
-\def\XINT_addp_C #1#2#3#4#5%
+\def\XINT_add_A #1.#2.%
{%
- \xint_gob_til_W
- #5\xint_addp_cw
- #4\xint_addp_cx
- #3\xint_addp_cy
- #2\xint_addp_cz
- \W\XINT_addp_CD {#5#4#3#2}{#1}%
+ \ifnum #1>\xint_c_vi %
+ \expandafter\XINT_add_aa
+ \else \expandafter\XINT_add_aa_small
+ \fi
}%
-\def\XINT_addp_CD #1%
+%%%%%%%%%%%%
+\def\XINT_add_out #1\Z #2\W%
{%
- \expandafter\XINT_addp_CC\the\numexpr 1+10#1\relax
+ \expandafter\XINT_cuz_small\romannumeral0\XINT_unrevbyviii {}%
+ #11\Z!1\R!1\R!1\R!1\R!1\R!1\R!1\R!1\R!\W
}%
-\def\XINT_addp_CC #1#2#3#4#5#6#7%
+\def\XINT_add_out_small #1\Z #2\W%
{%
- \XINT_addp_AC_checkcarry #2{#7#6#5#4#3}%
+ \XINT_smallunrevbyviii #11\Z!1\R!1\R!1\R!1\R!1\R!1\R!\W
}%
-\def\xint_addp_cw
- #1\xint_addp_cx
- #2\xint_addp_cy
- #3\xint_addp_cz
- \W\XINT_addp_CD
+%%%%%%%%%%%%
+\def\XINT_add_aa {\expandafter\XINT_add_out\the\numexpr\XINT_add_a \xint_c_ii}%
+\def\XINT_add_aa_small
+ {\expandafter\XINT_add_out_small\the\numexpr\XINT_add_a \xint_c_ii}%
+\def\XINT_add_a #1!#2!#3!#4!#5\W #6!#7!#8!#9!%
{%
- \expandafter\XINT_addp_CDw\the\numexpr \xint_c_i+10#1#2#3\relax
+ \XINT_add_b #1!#6!#2!#7!#3!#8!#4!#9!#5\W
}%
-\def\XINT_addp_CDw #1#2#3#4#5#6%
+\def\XINT_add_b #1#2!#3!%
{%
- \xint_gob_til_zeros_iv #2#3#4#5\XINT_addp_endDw_zeros
- 0000\XINT_addp_endDw #2#3#4#5%
+ \xint_gob_til_Z #2\XINT_add_bi \Z
+ \expandafter\XINT_add_c\the\numexpr#1+#2+#3-\xint_c_ii.%
}%
-\def\XINT_addp_endDw_zeros 0000\XINT_addp_endDw 0000#1\X\Y\Z{ #1}%
-\def\XINT_addp_endDw #1#2#3#4#5\X\Y\Z{ #5#4#3#2#1}%
-\def\xint_addp_cx
- #1\xint_addp_cy
- #2\xint_addp_cz
- \W\XINT_addp_CD
+\def\XINT_add_bi\Z
+ \expandafter\XINT_add_c
+ \the\numexpr#1+#2+#3-\xint_c_ii.#4!#5!#6!#7!#8!#9!\Z !\W
{%
- \expandafter\XINT_addp_CDx\the\numexpr \xint_c_i+100#1#2\relax
+ \XINT_add_k #1#3!#5!#7!#9!%
}%
-\def\XINT_addp_CDx #1#2#3#4#5#6%
+\def\XINT_add_c #1#2.%
{%
- \xint_gob_til_zeros_iv #2#3#4#5\XINT_addp_endDx_zeros
- 0000\XINT_addp_endDx #2#3#4#5%
+ 1#2\expandafter!\the\numexpr\XINT_add_d #1%
}%
-\def\XINT_addp_endDx_zeros 0000\XINT_addp_endDx 0000#1\Y\Z{ #1}%
-\def\XINT_addp_endDx #1#2#3#4#5\Y\Z{ #5#4#3#2#1}%
-\def\xint_addp_cy #1\xint_addp_cz\W\XINT_addp_CD
+\def\XINT_add_d #1#2!#3!%
{%
- \expandafter\XINT_addp_CDy\the\numexpr \xint_c_i+1000#1\relax
+ \xint_gob_til_Z #2\XINT_add_di \Z
+ \expandafter\XINT_add_e\the\numexpr#1+#2+#3-\xint_c_ii.%
}%
-\def\XINT_addp_CDy #1#2#3#4#5#6%
+\def\XINT_add_di\Z\expandafter\XINT_add_e
+ \the\numexpr#1+#2+#3-\xint_c_ii.#4!#5!#6!#7!#8\W
{%
- \xint_gob_til_zeros_iv #2#3#4#5\XINT_addp_endDy_zeros
- 0000\XINT_addp_endDy #2#3#4#5%
+ \XINT_add_k #1#3!#5!#7!%
}%
-\def\XINT_addp_endDy_zeros 0000\XINT_addp_endDy 0000#1\Z{ #1}%
-\def\XINT_addp_endDy #1#2#3#4#5\Z{ #5#4#3#2#1}%
-\def\xint_addp_cz\W\XINT_addp_CD #1#2{ #21000}%
-\def\XINT_addp_F #1#2#3#4#5%
+\def\XINT_add_e #1#2.%
{%
- \xint_gob_til_W
- #5\xint_addp_Gw
- #4\xint_addp_Gx
- #3\xint_addp_Gy
- #2\xint_addp_Gz
- \W\XINT_addp_G {#2#3#4#5}{#1}%
+ 1#2\expandafter!\the\numexpr\XINT_add_f #1%
}%
-\def\XINT_addp_G #1#2%
+\def\XINT_add_f #1#2!#3!%
{%
- \XINT_addp_F {#2#1}%
+ \xint_gob_til_Z #2\XINT_add_fi \Z
+ \expandafter\XINT_add_g\the\numexpr#1+#2+#3-\xint_c_ii.%
}%
-\def\xint_addp_Gw
- #1\xint_addp_Gx
- #2\xint_addp_Gy
- #3\xint_addp_Gz
- \W\XINT_addp_G #4%
+\def\XINT_add_fi\Z\expandafter\XINT_add_g
+ \the\numexpr#1+#2+#3-\xint_c_ii.#4!#5!#6\W
{%
- \xint_gob_til_zeros_iv #3#2#10\XINT_addp_endGw_zeros
- 0000\XINT_addp_endGw #3#2#10%
+ \XINT_add_k #1#3!#5!%
}%
-\def\XINT_addp_endGw_zeros 0000\XINT_addp_endGw 0000#1\X\Y\Z{ #1}%
-\def\XINT_addp_endGw #1#2#3#4#5\X\Y\Z{ #5#1#2#3#4}%
-\def\xint_addp_Gx
- #1\xint_addp_Gy
- #2\xint_addp_Gz
- \W\XINT_addp_G #3%
+\def\XINT_add_g #1#2.%
{%
- \xint_gob_til_zeros_iv #2#100\XINT_addp_endGx_zeros
- 0000\XINT_addp_endGx #2#100%
+ 1#2\expandafter!\the\numexpr\XINT_add_h #1%
}%
-\def\XINT_addp_endGx_zeros 0000\XINT_addp_endGx 0000#1\Y\Z{ #1}%
-\def\XINT_addp_endGx #1#2#3#4#5\Y\Z{ #5#1#2#3#4}%
-\def\xint_addp_Gy
- #1\xint_addp_Gz
- \W\XINT_addp_G #2%
+\def\XINT_add_h #1#2!#3!%
{%
- \xint_gob_til_zeros_iv #1000\XINT_addp_endGy_zeros
- 0000\XINT_addp_endGy #1000%
+ \xint_gob_til_Z #2\XINT_add_hi \Z
+ \expandafter\XINT_add_i\the\numexpr#1+#2+#3-\xint_c_ii.%
}%
-\def\XINT_addp_endGy_zeros 0000\XINT_addp_endGy 0000#1\Z{ #1}%
-\def\XINT_addp_endGy #1#2#3#4#5\Z{ #5#1#2#3#4}%
-\def\xint_addp_Gz\W\XINT_addp_G #1#2{ #2}%
-\def\xintiiAdd {\romannumeral0\xintiiadd }%
-\def\xintiiadd #1{\expandafter\xint_iiadd\romannumeral-`0#1\Z }%
-\def\xint_iiadd #1#2\Z #3%
+\def\XINT_add_hi\Z
+ \expandafter\XINT_add_i\the\numexpr#1+#2+#3-\xint_c_ii.#4\W
{%
- \expandafter\XINT_add_fork\expandafter #1\romannumeral-`0#3\Z #2\Z
+ \XINT_add_k #1#3!%
}%
-\def\xintiAdd {\romannumeral0\xintiadd }%
-\def\xintiadd #1%
+\def\XINT_add_i #1#2.%
{%
- \expandafter\xint_add\romannumeral0\xintnum{#1}\Z
+ 1#2\expandafter!\the\numexpr\XINT_add_a #1%
}%
-\def\xint_add #1#2\Z #3%
+%%%%%%%%%%%%
+\def\XINT_add_k #1%
+ {\if #12\expandafter\XINT_add_ke\else\expandafter\XINT_add_l \fi}%
+\def\XINT_add_ke #1%
{%
- \expandafter\XINT_add_fork\expandafter #1\romannumeral0\xintnum{#3}\Z #2\Z
+ \xint_gob_til_Z #1\XINT_add_kf\Z 1%
}%
-\let\xintAdd\xintiAdd \let\xintadd\xintiadd
-\def\XINT_add_fork #1#2%
+\def\XINT_add_kf\Z 1{1}%
+\def\XINT_add_l #1%
{%
- \xint_UDzerofork
- #1\XINT_add_firstiszero
- #2\XINT_add_secondiszero
- 0{}%
- \krof
- \xint_UDsignsfork
- #1#2\XINT_add_minusminus
- #1-\XINT_add_minusplus
- #2-\XINT_add_plusminus
- --\XINT_add_plusplus
- \krof #1#2%
+ \xint_gob_til_Z #1\XINT_add_lf\Z \XINT_add_m 1%
}%
-\def\XINT_add_firstiszero #1\krof #2#3\Z #4\Z { #3}%
-\def\XINT_add_secondiszero #1\krof #2#3\Z #4\Z { #2#4}%
-\def\XINT_add_plusplus #1#2#3\Z #4\Z {\XINT_add_pre {#1#4}{#2#3}}%
-\def\XINT_add_minusminus #1#2#3\Z #4\Z
- {\expandafter\xint_minus_thenstop\romannumeral0\XINT_add_pre {#4}{#3}}%
-\def\XINT_add_minusplus #1#2#3\Z #4\Z {\XINT_sub_pre {#2#3}{#4}}%
-\def\XINT_add_plusminus #1#2#3\Z #4\Z {\XINT_sub_pre {#1#4}{#3}}%
-\def\XINT_add_pre #1%
+\def\XINT_add_lf\Z\XINT_add_m 1{100000001}%
+\def\XINT_add_m #1!%
{%
- \expandafter\XINT_add_pre_b\expandafter
- {\romannumeral0\XINT_RQ {}#1\R\R\R\R\R\R\R\R\Z }%
+ \expandafter\XINT_add_n\the\numexpr\xint_c_i+#1.%
}%
-\def\XINT_add_pre_b #1#2%
+\def\XINT_add_n #1#2.%
{%
- \expandafter\XINT_add_A
- \expandafter0\expandafter{\expandafter}%
- \romannumeral0\XINT_RQ {}#2\R\R\R\R\R\R\R\R\Z
- \W\X\Y\Z #1\W\X\Y\Z
+ 1#2\expandafter!\the\numexpr\XINT_add_o #1%
}%
+\def\XINT_add_o #1%
+ {\if #12\expandafter\XINT_add_l\else\expandafter\XINT_add_ke \fi}%
\def\xintiiSub {\romannumeral0\xintiisub }%
-\def\xintiisub #1{\expandafter\xint_iisub\romannumeral-`0#1\Z }%
-\def\xint_iisub #1#2\Z #3%
+\def\xintiisub #1{\expandafter\XINT_iisub\romannumeral-`0#1\Z }%
+\def\XINT_iisub #1#2\Z #3%
{%
- \expandafter\XINT_sub_fork\expandafter #1\romannumeral-`0#3\Z #2\Z
+ \expandafter\XINT_sub_nfork\expandafter #1\romannumeral-`0#3\Z #2\Z
}%
-\def\xintiSub {\romannumeral0\xintisub }%
-\def\xintisub #1%
+\def\xintiSub {\romannumeral0\xintisub }%
+\def\xintisub #1{\expandafter\XINT_isub\romannumeral0\xintnum{#1}\Z }%
+\def\XINT_isub #1#2\Z #3%
{%
- \expandafter\xint_sub\romannumeral0\xintnum{#1}\Z
+ \expandafter\XINT_sub_nfork\expandafter #1\romannumeral0\xintnum{#3}\Z #2\Z
}%
-\def\xint_sub #1#2\Z #3%
-{%
- \expandafter\XINT_sub_fork\expandafter #1\romannumeral0\xintnum{#3}\Z #2\Z
-}%
-\let\xintSub\xintiSub \let\xintsub\xintisub
-\def\XINT_sub_fork #1#2%
+\def\XINT_sub_nfork #1#2%
{%
\xint_UDzerofork
#1\XINT_sub_firstiszero
@@ -944,612 +735,401 @@
--\XINT_sub_plusplus
\krof #1#2%
}%
-\def\XINT_sub_firstiszero #1\krof #2#3\Z #4\Z {\XINT_opp #3}%
-\def\XINT_sub_secondiszero #1\krof #2#3\Z #4\Z { #2#4}%
-\def\XINT_sub_plusplus #1#2#3\Z #4\Z {\XINT_sub_pre {#1#4}{#2#3}}%
-\def\XINT_sub_minusminus #1#2#3\Z #4\Z {\XINT_sub_pre {#3}{#4}}%
-\def\XINT_sub_minusplus #1#2#3\Z #4\Z
- {\expandafter\xint_minus_thenstop\romannumeral0\XINT_add_pre {#4}{#2#3}}%
-\def\XINT_sub_plusminus #1#2#3\Z #4\Z {\XINT_add_pre {#1#4}{#3}}%
-\def\XINT_sub_pre #1%
-{%
- \expandafter\XINT_sub_pre_b\expandafter
- {\romannumeral0\XINT_RQ {}#1\R\R\R\R\R\R\R\R\Z }%
-}%
-\def\XINT_sub_pre_b #1#2%
-{%
- \expandafter\XINT_sub_A
- \expandafter1\expandafter{\expandafter}%
- \romannumeral0\XINT_RQ {}#2\R\R\R\R\R\R\R\R\Z
- \W\X\Y\Z #1 \W\X\Y\Z
-}%
-\def\XINT_sub_A #1#2#3\W\X\Y\Z #4#5#6#7%
-{%
- \xint_gob_til_W
- #4\xint_sub_az
- \W\XINT_sub_B #1{#4#5#6#7}{#2}#3\W\X\Y\Z
-}%
-\def\XINT_sub_B #1#2#3#4#5#6#7%
-{%
- \xint_gob_til_W
- #4\xint_sub_bz
- \W\XINT_sub_onestep #1#2{#7#6#5#4}{#3}%
-}%
-\def\XINT_sub_onestep #1#2#3#4#5#6%
-{%
- \expandafter\XINT_sub_backtoA\the\numexpr 11#5#4#3#2-#6+#1-\xint_c_i.%
+\def\XINT_sub_firstiszero #1\krof 0#2#3\Z #4\Z {\XINT_opp #2#3}%
+\def\XINT_sub_secondiszero #1\krof #20#3\Z #4\Z { #2#4}%
+\def\XINT_sub_plusminus #1#2{\XINT_add_pp_a #1{}}%
+\def\XINT_sub_plusplus #1#2%
+ {\expandafter\XINT_opp\romannumeral0\XINT_sub_mm_a #1#2}%
+\def\XINT_sub_minusplus #1#2%
+ {\expandafter\xint_minus_thenstop\romannumeral0\XINT_add_pp_a {}#2}%
+\def\XINT_sub_minusminus #1#2{\XINT_sub_mm_a {}{}}%
+\def\XINT_sub_mm_a #1#2#3\Z
+{%
+ \expandafter\XINT_sub_mm_b
+ \romannumeral0\expandafter\XINT_sepandrev_andcount
+ \romannumeral0\XINT_zeroes_forviii #2#3\R\R\R\R\R\R\R\R{10}0000001\W
+ #2#3\XINT_rsepbyviii_end_A 2345678%
+ \XINT_rsepbyviii_end_B 2345678\relax\xint_c_ii\xint_c_iii
+ \R.\xint_c_vi\R.\xint_c_v\R.\xint_c_iv\R.\xint_c_iii
+ \R.\xint_c_ii\R.\xint_c_i\R.\xint_c_\W
+ \X #1%
+}%
+\def\XINT_sub_mm_b #1.#2\X #3\Z
+{%
+ \expandafter\XINT_sub_checklengths
+ \the\numexpr #1\expandafter.%
+ \romannumeral0\expandafter\XINT_sepandrev_andcount
+ \romannumeral0\XINT_zeroes_forviii #3\R\R\R\R\R\R\R\R{10}0000001\W
+ #3\XINT_rsepbyviii_end_A 2345678%
+ \XINT_rsepbyviii_end_B 2345678\relax \xint_c_ii\xint_c_iii
+ \R.\xint_c_vi\R.\xint_c_v\R.\xint_c_iv\R.\xint_c_iii
+ \R.\xint_c_ii\R.\xint_c_i\R.\xint_c_\W
+ \Z!\Z!\Z!\Z!\Z!\W #2\Z!\Z!\Z!\Z!\Z!\W
+}%
+\def\XINT_sub_checklengths #1.#2.%
+{%
+ \ifnum #2>#1
+ \expandafter\XINT_sub_exchange
+ \else
+ \expandafter\XINT_sub_aa
+ \fi
}%
-\def\XINT_sub_backtoA #1#2#3.#4%
+\def\XINT_sub_exchange #1\Z!\Z!\Z!\Z!\Z!\W #2\Z
{%
- \XINT_sub_A #2{#3#4}%
+ \expandafter\XINT_opp\romannumeral0\XINT_sub_aa
+ #2\Z!\Z!\Z!\Z!\Z!\W #1\Z
}%
-\def\xint_sub_bz
- \W\XINT_sub_onestep #1#2#3#4#5#6#7%
+%%%%%%%%%%%%
+\def\XINT_sub_prepare_rescue #1\W {\relax\Z-\W}%
+\def\XINT_sub_prepare_cuz #1\W {\relax\XINT_cuz_byviii!\Z 0\W\R}%
+%%%%%%%%%%%%
+\def\XINT_sub_aa {\expandafter\XINT_sub_out\the\numexpr\XINT_sub_a \xint_c_i }%
+\def\XINT_sub_out #1\Z #2#3\W
{%
- \xint_UDzerofork
- #1\XINT_sub_C % une retenue
- 0\XINT_sub_D % pas de retenue
- \krof
- {#7}#2#3#4#5%
-}%
-\def\XINT_sub_D #1#2\W\X\Y\Z
-{%
- \expandafter
- \xint_cleanupzeros_andstop
- \romannumeral0%
- \XINT_rord_main {}#2%
- \xint_relax
- \xint_bye\xint_bye\xint_bye\xint_bye
- \xint_bye\xint_bye\xint_bye\xint_bye
- \xint_relax
- #1%
+ \if-#2\expandafter\XINT_sub_startrescue\fi
+ \expandafter\XINT_cuz_small
+ \romannumeral0\XINT_unrevbyviii {}#11\Z!1\R!1\R!1\R!1\R!1\R!1\R!1\R!1\R!\W
}%
-\def\XINT_sub_C #1#2#3#4#5%
+\def\XINT_sub_startrescue\expandafter\XINT_cuz_small
+ \romannumeral0\XINT_unrevbyviii #1#2\Z!#3\W
{%
- \xint_gob_til_W
- #2\xint_sub_cz
- \W\XINT_sub_AC_onestep {#5#4#3#2}{#1}%
+ \expandafter\XINT_sub_rescue_finish
+ \the\numexpr\XINT_sub_rescue_a #2!%
+ 1\Z!1\R!1\R!1\R!1\R!1\R!1\R!1\R!1\R!\W \R
}%
-\def\XINT_sub_AC_onestep #1%
+\def\XINT_sub_rescue_finish
+ {\expandafter-\romannumeral0\expandafter\XINT_cuz
+ \romannumeral0\XINT_unrevbyviii {}}%
+\def\XINT_sub_rescue_a #1!%
{%
- \expandafter\XINT_sub_backtoC\the\numexpr 11#1-\xint_c_i.%
+ \expandafter\XINT_sub_rescue_c\the\numexpr \xint_c_xii_e_viii-#1.%
}%
-\def\XINT_sub_backtoC #1#2#3.#4%
+\def\XINT_sub_rescue_c 1#1#2.%
{%
- \XINT_sub_AC_checkcarry #2{#3#4}% la retenue va \^etre examin\'ee
+ 1#2\expandafter!\the\numexpr\XINT_sub_rescue_d #1%
}%
-\def\XINT_sub_AC_checkcarry #1%
+\def\XINT_sub_rescue_d #1#2#3!%
{%
- \xint_gob_til_one #1\xint_sub_AC_nocarry 1\XINT_sub_C
+ \xint_gob_til_minus #2\XINT_sub_rescue_z -%
+ \expandafter\XINT_sub_rescue_c\the\numexpr \xint_c_xii_e_viii_mone-#2#3+#1.%
}%
-\def\xint_sub_AC_nocarry 1\XINT_sub_C #1#2\W\X\Y\Z
+\def\XINT_sub_rescue_z #1.{1!}%
+%%%%%%%%%%%%
+\def\XINT_sub_a #1!#2!#3!#4!#5\W #6!#7!#8!#9!%
{%
- \expandafter
- \XINT_cuz_loop
- \romannumeral0%
- \XINT_rord_main {}#2%
- \xint_relax
- \xint_bye\xint_bye\xint_bye\xint_bye
- \xint_bye\xint_bye\xint_bye\xint_bye
- \xint_relax
- #1\W\W\W\W\W\W\W\Z
+ \XINT_sub_b #1!#6!#2!#7!#3!#8!#4!#9!#5\W
}%
-\def\xint_sub_cz\W\XINT_sub_AC_onestep #1%
+\def\XINT_sub_b #1#2#3!#4!%
{%
- \XINT_cuz
+ \xint_gob_til_Z #2\XINT_sub_bi \Z
+ \expandafter\XINT_sub_c\the\numexpr#1+1#4-#3-\xint_c_i.%
}%
-\def\xint_sub_az\W\XINT_sub_B #1#2#3#4#5#6#7%
+\def\XINT_sub_c 1#1#2.%
{%
- \xint_gob_til_W
- #4\xint_sub_ez
- \W\XINT_sub_Eenter #1{#3}#4#5#6#7%
+ 1#2\expandafter!\the\numexpr\XINT_sub_d #1%
}%
-\def\XINT_sub_Eenter #1#2%
+\def\XINT_sub_d #1#2#3!#4!%
{%
- \expandafter
- \XINT_sub_E\expandafter1\expandafter{\expandafter}%
- \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
- \W\X\Y\Z #1%
+ \xint_gob_til_Z #2\XINT_sub_di \Z
+ \expandafter\XINT_sub_e\the\numexpr#1+1#4-#3-\xint_c_i.%
}%
-\def\XINT_sub_E #1#2#3#4#5#6%
+\def\XINT_sub_e 1#1#2.%
{%
- \xint_gob_til_W #3\xint_sub_F\W
- \XINT_sub_Eonestep #1{#6#5#4#3}{#2}%
+ 1#2\expandafter!\the\numexpr\XINT_sub_f #1%
}%
-\def\XINT_sub_Eonestep #1#2%
+\def\XINT_sub_f #1#2#3!#4!%
{%
- \expandafter\XINT_sub_backtoE\the\numexpr 109999-#2+#1.%
+ \xint_gob_til_Z #2\XINT_sub_fi \Z
+ \expandafter\XINT_sub_g\the\numexpr#1+1#4-#3-\xint_c_i.%
}%
-\def\XINT_sub_backtoE #1#2#3.#4%
+\def\XINT_sub_g 1#1#2.%
{%
- \XINT_sub_E #2{#3#4}%
+ 1#2\expandafter!\the\numexpr\XINT_sub_h #1%
}%
-\def\xint_sub_F\W\XINT_sub_Eonestep #1#2#3#4%
+\def\XINT_sub_h #1#2#3!#4!%
{%
- \xint_UDonezerofork
- #4#1{\XINT_sub_Fdec 0}% soustraire 1. Et faire signe -
- #1#4{\XINT_sub_Finc 1}% additionner 1. Et faire signe -
- 10\XINT_sub_DD % terminer. Mais avec signe -
- \krof
- {#3}%
+ \xint_gob_til_Z #2\XINT_sub_hi \Z
+ \expandafter\XINT_sub_i\the\numexpr#1+1#4-#3-\xint_c_i.%
}%
-\def\XINT_sub_DD {\expandafter\xint_minus_thenstop\romannumeral0\XINT_sub_D }%
-\def\XINT_sub_Fdec #1#2#3#4#5#6%
+\def\XINT_sub_i 1#1#2.%
{%
- \xint_gob_til_W #3\xint_sub_Fdec_finish\W
- \XINT_sub_Fdec_onestep #1{#6#5#4#3}{#2}%
+ 1#2\expandafter!\the\numexpr\XINT_sub_a #1%
}%
-\def\XINT_sub_Fdec_onestep #1#2%
+\def\XINT_sub_bi\Z
+ \expandafter\XINT_sub_c\the\numexpr#1+1#2-#3.#4!#5!#6!#7!#8!#9!\Z !\W
{%
- \expandafter\XINT_sub_backtoFdec\the\numexpr 11#2+#1-\xint_c_i.%
+ \XINT_sub_k #1#2!#5!#7!#9!%
}%
-\def\XINT_sub_backtoFdec #1#2#3.#4%
+\def\XINT_sub_di\Z
+ \expandafter\XINT_sub_e\the\numexpr#1+1#2-#3.#4!#5!#6!#7!#8\W
{%
- \XINT_sub_Fdec #2{#3#4}%
+ \XINT_sub_k #1#2!#5!#7!%
}%
-\def\xint_sub_Fdec_finish\W\XINT_sub_Fdec_onestep #1#2%
+\def\XINT_sub_fi\Z
+ \expandafter\XINT_sub_g\the\numexpr#1+1#2-#3.#4!#5!#6\W
{%
- \expandafter\xint_minus_thenstop\romannumeral0\XINT_cuz
+ \XINT_sub_k #1#2!#5!%
}%
-\def\XINT_sub_Finc #1#2#3#4#5#6%
+\def\XINT_sub_hi\Z
+ \expandafter\XINT_sub_i\the\numexpr#1+1#2-#3.#4\W
{%
- \xint_gob_til_W #3\xint_sub_Finc_finish\W
- \XINT_sub_Finc_onestep #1{#6#5#4#3}{#2}%
+ \XINT_sub_k #1#2!%
}%
-\def\XINT_sub_Finc_onestep #1#2%
+%%%%%%%%%%%%
+\def\XINT_sub_k #1#2%
{%
- \expandafter\XINT_sub_backtoFinc\the\numexpr 10#2+#1.%
+ \xint_gob_til_Z #2\XINT_sub_p\Z \XINT_sub_l #1#2%
}%
-\def\XINT_sub_backtoFinc #1#2#3.#4%
+\def\XINT_sub_l #1%
{%
- \XINT_sub_Finc #2{#3#4}%
+ \xint_UDzerofork
+ #1\XINT_sub_m
+ 0{}%
+ \krof
}%
-\def\xint_sub_Finc_finish\W\XINT_sub_Finc_onestep #1#2#3%
+\def\XINT_sub_m #1!%
{%
- \xint_UDzerofork
- #1{\expandafter\expandafter\expandafter
- \xint_minus_thenstop\xint_cleanupzeros_nostop}%
- 0{ -1}%
- \krof
- #3%
+ \expandafter\XINT_sub_n\the\numexpr 1#1-\xint_c_i!%
}%
-\def\xint_sub_ez\W\XINT_sub_Eenter #1%
+\def\XINT_sub_n 1#1%
{%
\xint_UDzerofork
- #1\XINT_sub_K % il y a une retenue
- 0\XINT_sub_L % pas de retenue
+ #1{\XINT_sub_o}%
+ 0{\XINT_sub_n_checkzero}%
\krof
}%
-\def\XINT_sub_L #1\W\X\Y\Z {\XINT_cuz_loop #1\W\W\W\W\W\W\W\Z }%
-\def\XINT_sub_K #1%
+\def\XINT_sub_o #1!{1#1\expandafter!\the\numexpr\XINT_sub_m }%
+\def\XINT_sub_n_checkzero #1!%
{%
- \expandafter
- \XINT_sub_KK\expandafter1\expandafter{\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
+ \xint_gob_til_eightzeroes #1\XINT_sub_n_prepare_cuz 00000000%
+ 1#1!%
}%
-\def\XINT_sub_KK #1#2#3#4#5#6%
+\def\XINT_sub_n_prepare_cuz 00000000100000000{1\XINT_sub_prepare_cuz}%
+\def\XINT_sub_p\Z\XINT_sub_l #1\Z!%
{%
- \xint_gob_til_W #3\xint_sub_KK_finish\W
- \XINT_sub_KK_onestep #1{#6#5#4#3}{#2}%
-}%
-\def\XINT_sub_KK_onestep #1#2%
-{%
- \expandafter\XINT_sub_backtoKK\the\numexpr 109999-#2+#1.%
+ \xint_UDzerofork
+ #1{-1\XINT_sub_prepare_rescue}%
+ 0{1\XINT_sub_prepare_cuz }%
+ \krof
}%
-\def\XINT_sub_backtoKK #1#2#3.#4%
+\def\xintiMul {\romannumeral0\xintimul }%
+\def\xintimul #1%
{%
- \XINT_sub_KK #2{#3#4}%
+ \expandafter\XINT_imul\romannumeral0\xintnum{#1}\Z
}%
-\def\xint_sub_KK_finish\W\XINT_sub_KK_onestep #1#2#3%
+\def\XINT_imul #1#2\Z #3%
{%
- \expandafter\xint_minus_thenstop
- \romannumeral0\XINT_cuz_loop #3\W\W\W\W\W\W\W\Z
+ \expandafter\XINT_mul_nfork\expandafter #1\romannumeral0\xintnum{#3}\Z #2\Z
}%
\def\xintiiMul {\romannumeral0\xintiimul }%
\def\xintiimul #1%
{%
- \expandafter\xint_iimul\expandafter {\romannumeral-`0#1}%
-}%
-\def\xint_iimul #1#2%
-{%
- \expandafter\XINT_mul_fork \romannumeral-`0#2\Z #1\Z
-}%
-\def\xintiMul {\romannumeral0\xintimul }%
-\def\xintimul #1%
-{%
- \expandafter\xint_mul\expandafter {\romannumeral0\xintnum{#1}}%
+ \expandafter\XINT_iimul\romannumeral-`0#1\Z
}%
-\def\xint_mul #1#2%
+\def\XINT_iimul #1#2\Z #3%
{%
- \expandafter\XINT_mul_fork \romannumeral0\xintnum{#2}\Z #1\Z
+ \expandafter\XINT_mul_nfork\expandafter #1\romannumeral-`0#3\Z #2\Z
}%
-\let\xintMul\xintiMul \let\xintmul\xintimul
-\def\XINT_Mul #1#2{\romannumeral0\XINT_mul_fork #2\Z #1\Z }%
-\def\XINT_mul_fork #1#2\Z #3#4\Z
+\def\XINT_mul_fork #1#2\Z #3\Z{\XINT_mul_nfork #1#3\Z #2\Z}%
+\def\XINT_mul_nfork #1#2%
{%
\xint_UDzerofork
#1\XINT_mul_zero
- #3\XINT_mul_zero
+ #2\XINT_mul_zero
0{}%
\krof
\xint_UDsignsfork
- #1#3\XINT_mul_minusminus % #1 = #3 = -
- #1-{\XINT_mul_minusplus #3}% % #1 = -
- #3-{\XINT_mul_plusminus #1}% % #3 = -
- --{\XINT_mul_plusplus #1#3}%
- \krof
- {#2}{#4}%
-}%
-\def\XINT_mul_zero #1\krof #2#3{ 0}%
-\def\XINT_mul_minusminus #1#2%
-{%
- \expandafter\XINT_mul_choice_a
- \expandafter{\romannumeral0\xintlength {#2}}%
- {\romannumeral0\xintlength {#1}}{#1}{#2}%
-}%
-\def\XINT_mul_minusplus #1#2#3%
-{%
- \expandafter\xint_minus_thenstop\romannumeral0\expandafter
- \XINT_mul_choice_a
- \expandafter{\romannumeral0\xintlength {#1#3}}%
- {\romannumeral0\xintlength {#2}}{#2}{#1#3}%
-}%
-\def\XINT_mul_plusminus #1#2#3%
-{%
- \expandafter\xint_minus_thenstop\romannumeral0\expandafter
- \XINT_mul_choice_a
- \expandafter{\romannumeral0\xintlength {#3}}%
- {\romannumeral0\xintlength {#1#2}}{#1#2}{#3}%
-}%
-\def\XINT_mul_plusplus #1#2#3#4%
-{%
- \expandafter\XINT_mul_choice_a
- \expandafter{\romannumeral0\xintlength {#2#4}}%
- {\romannumeral0\xintlength {#1#3}}{#1#3}{#2#4}%
-}%
-\def\XINT_mul_choice_a #1#2%
-{%
- \expandafter\XINT_mul_choice_b\expandafter{#2}{#1}%
-}%
-\def\XINT_mul_choice_b #1#2%
-{%
- \ifnum #1<\xint_c_v
- \expandafter\XINT_mul_choice_littlebyfirst
- \else
- \ifnum #2<\xint_c_v
- \expandafter\expandafter\expandafter\XINT_mul_choice_littlebysecond
- \else
- \expandafter\expandafter\expandafter\XINT_mul_choice_compare
- \fi
- \fi
- {#1}{#2}%
-}%
-\def\XINT_mul_choice_littlebyfirst #1#2#3#4%
-{%
- \expandafter\XINT_mul_M
- \expandafter{\the\numexpr #3\expandafter}%
- \romannumeral0\XINT_RQ {}#4\R\R\R\R\R\R\R\R\Z \Z\Z\Z\Z
-}%
-\def\XINT_mul_choice_littlebysecond #1#2#3#4%
-{%
- \expandafter\XINT_mul_M
- \expandafter{\the\numexpr #4\expandafter}%
- \romannumeral0\XINT_RQ {}#3\R\R\R\R\R\R\R\R\Z \Z\Z\Z\Z
-}%
-\def\XINT_mul_choice_compare #1#2%
-{%
- \ifnum #1>#2
- \expandafter \XINT_mul_choice_i
- \else
- \expandafter \XINT_mul_choice_ii
- \fi
- {#1}{#2}%
-}%
-\def\XINT_mul_choice_i #1#2%
-{%
- \ifnum #1<\numexpr\ifcase \numexpr (#2-\xint_c_iii)/\xint_c_iv\relax
- \or 330\or 168\or 109\or 80\or 66\or 52\else 0\fi\relax
- \expandafter\XINT_mul_choice_same
- \else
- \expandafter\XINT_mul_choice_permute
- \fi
-}%
-\def\XINT_mul_choice_ii #1#2%
-{%
- \ifnum #2<\numexpr\ifcase \numexpr (#1-\xint_c_iii)/\xint_c_iv\relax
- \or 330\or 168\or 109\or 80\or 66\or 52\else 0\fi\relax
- \expandafter\XINT_mul_choice_permute
- \else
- \expandafter\XINT_mul_choice_same
- \fi
-}%
-\def\XINT_mul_choice_same #1#2%
-{%
- \expandafter\XINT_mul_enter
- \romannumeral0\XINT_RQ {}#1\R\R\R\R\R\R\R\R\Z
- \Z\Z\Z\Z #2\W\W\W\W
-}%
-\def\XINT_mul_choice_permute #1#2%
-{%
- \expandafter\XINT_mul_enter
- \romannumeral0\XINT_RQ {}#2\R\R\R\R\R\R\R\R\Z
- \Z\Z\Z\Z #1\W\W\W\W
-}%
-\def\XINT_mul_Ar #1#2#3#4#5#6%
-{%
- \xint_gob_til_Z #6\xint_mul_br\Z\XINT_mul_Br #1{#6#5#4#3}{#2}%
-}%
-\def\xint_mul_br\Z\XINT_mul_Br #1#2%
-{%
- \XINT_addr_AC_checkcarry #1%
-}%
-\def\XINT_mul_Br #1#2#3#4\W\X\Y\Z #5#6#7#8%
-{%
- \expandafter\XINT_mul_ABEAr
- \the\numexpr #1+10#2+#8#7#6#5.{#3}#4\W\X\Y\Z
-}%
-\def\XINT_mul_ABEAr #1#2#3#4#5#6.#7%
-{%
- \XINT_mul_Ar #2{#7#6#5#4#3}%
-}%
-\def\XINT_mul_Mr #1%
-{%
- \expandafter\XINT_mul_Mr_checkifzeroorone\expandafter{\the\numexpr #1}%
-}%
-\def\XINT_mul_Mr_checkifzeroorone #1%
-{%
- \ifcase #1
- \expandafter\XINT_mul_Mr_zero
- \or
- \expandafter\XINT_mul_Mr_one
- \else
- \expandafter\XINT_mul_Nr
- \fi
- {0000}{}{#1}%
-}%
-\def\XINT_mul_Mr_zero #1\Z\Z\Z\Z { 0000}%
-\def\XINT_mul_Mr_one #1#2#3#4\Z\Z\Z\Z { #4}%
-\def\XINT_mul_Nr #1#2#3#4#5#6#7%
-{%
- \xint_gob_til_Z #4\xint_mul_pr\Z\XINT_mul_Pr {#1}{#3}{#7#6#5#4}{#2}{#3}%
-}%
-\def\XINT_mul_Pr #1#2#3%
-{%
- \expandafter\XINT_mul_Lr\the\numexpr \xint_c_x^viii+#1+#2*#3\relax
-}%
-\def\XINT_mul_Lr 1#1#2#3#4#5#6#7#8#9%
-{%
- \XINT_mul_Nr {#1#2#3#4}{#9#8#7#6#5}%
-}%
-\def\xint_mul_pr\Z\XINT_mul_Pr #1#2#3#4#5%
-{%
- \xint_gob_til_zeros_iv #1\XINT_mul_Mr_end_nocarry 0000%
- \XINT_mul_Mr_end_carry #1{#4}%
-}%
-\def\XINT_mul_Mr_end_nocarry 0000\XINT_mul_Mr_end_carry 0000#1{ #1}%
-\def\XINT_mul_Mr_end_carry #1#2#3#4#5{ #5#4#3#2#1}%
-\def\XINT_mul_M #1%
-{%
- \expandafter\XINT_mul_M_checkifzeroorone\expandafter{\the\numexpr #1}%
+ #1#2\XINT_mul_minusminus
+ #1-\XINT_mul_minusplus
+ #2-\XINT_mul_plusminus
+ --\XINT_mul_plusplus
+ \krof #1#2%
}%
-\def\XINT_mul_M_checkifzeroorone #1%
-{%
- \ifcase #1
- \expandafter\XINT_mul_M_zero
- \or
- \expandafter\XINT_mul_M_one
+\def\XINT_mul_zero #1\krof #2#3\Z #4\Z { 0}%
+\def\XINT_mul_minusminus #1#2{\XINT_mul_plusplus {}{}}%
+\def\XINT_mul_minusplus #1#2%
+ {\expandafter\xint_minus_thenstop\romannumeral0\XINT_mul_plusplus {}#2}%
+\def\XINT_mul_plusminus #1#2%
+ {\expandafter\xint_minus_thenstop\romannumeral0\XINT_mul_plusplus #1{}}%
+\def\XINT_mul_plusplus #1#2#3\Z
+{%
+ \expandafter\XINT_mul_pre_b
+ \romannumeral0\expandafter\XINT_sepandrev_andcount
+ \romannumeral0\XINT_zeroes_forviii #2#3\R\R\R\R\R\R\R\R{10}0000001\W
+ #2#3\XINT_rsepbyviii_end_A 2345678%
+ \XINT_rsepbyviii_end_B 2345678\relax\xint_c_ii\xint_c_iii
+ \R.\xint_c_vi\R.\xint_c_v\R.\xint_c_iv\R.\xint_c_iii
+ \R.\xint_c_ii\R.\xint_c_i\R.\xint_c_\W
+ \W #1%
+}%
+\def\XINT_mul_pre_b #1.#2\W #3\Z
+{%
+ \expandafter\XINT_mul_checklengths
+ \the\numexpr #1\expandafter.%
+ \romannumeral0\expandafter\XINT_sepandrev_andcount
+ \romannumeral0\XINT_zeroes_forviii #3\R\R\R\R\R\R\R\R{10}0000001\W
+ #3\XINT_rsepbyviii_end_A 2345678%
+ \XINT_rsepbyviii_end_B 2345678\relax\xint_c_ii\xint_c_iii
+ \R.\xint_c_vi\R.\xint_c_v\R.\xint_c_iv\R.\xint_c_iii
+ \R.\xint_c_ii\R.\xint_c_i\R.\xint_c_\W
+ 1\Z!\W #21\Z!%
+ 1\R!1\R!1\R!1\R!1\R!1\R!1\R!1\R!\W
+}%
+\def\XINT_mul_checklengths #1.#2.%
+{%
+ \ifnum #2=\xint_c_i\expandafter\XINT_mul_smallbyfirst\fi
+ \ifnum #1=\xint_c_i\expandafter\XINT_mul_smallbysecond\fi
+ \ifnum #2<#1
+ \ifnum \numexpr (#2-\xint_c_i)*(#1-#2)<383
+ \XINT_mul_exchange
+ \fi
\else
- \expandafter\XINT_mul_N
+ \ifnum \numexpr (#1-\xint_c_i)*(#2-#1)>383
+ \XINT_mul_exchange
+ \fi
\fi
- {0000}{}{#1}%
-}%
-\def\XINT_mul_M_zero #1\Z\Z\Z\Z { 0}%
-\def\XINT_mul_M_one #1#2#3#4\Z\Z\Z\Z
-{%
- \expandafter\xint_cleanupzeros_andstop\romannumeral0\xintreverseorder{#4}%
-}%
-\def\XINT_mul_N #1#2#3#4#5#6#7%
-{%
- \xint_gob_til_Z #4\xint_mul_p\Z\XINT_mul_P {#1}{#3}{#7#6#5#4}{#2}{#3}%
-}%
-\def\XINT_mul_P #1#2#3%
-{%
- \expandafter\XINT_mul_L\the\numexpr \xint_c_x^viii+#1+#2*#3\relax
-}%
-\def\XINT_mul_L 1#1#2#3#4#5#6#7#8#9%
-{%
- \XINT_mul_N {#1#2#3#4}{#5#6#7#8#9}%
-}%
-\def\xint_mul_p\Z\XINT_mul_P #1#2#3#4#5%
-{%
- \XINT_mul_M_end #1#4%
-}%
-\edef\XINT_mul_M_end #1#2#3#4#5#6#7#8%
-{%
- \noexpand\expandafter\space\noexpand\the\numexpr #1#2#3#4#5#6#7#8\relax
-}%
-\def\XINT_mul_enter #1\Z\Z\Z\Z #2#3#4#5%
-{%
- \xint_gob_til_W #5\XINT_mul_exit_a\W
- \XINT_mul_start {#2#3#4#5}#1\Z\Z\Z\Z
-}%
-\def\XINT_mul_exit_a\W\XINT_mul_start #1%
-{%
- \XINT_mul_exit_b #1%
-}%
-\def\XINT_mul_exit_b #1#2#3#4%
-{%
- \xint_gob_til_W
- #2\XINT_mul_exit_ci
- #3\XINT_mul_exit_cii
- \W\XINT_mul_exit_ciii #1#2#3#4%
-}%
-\def\XINT_mul_exit_ciii #1\W #2\Z\Z\Z\Z \W\W\W
-{%
- \XINT_mul_M {#1}#2\Z\Z\Z\Z
+ \XINT_mul_start
}%
-\def\XINT_mul_exit_cii\W\XINT_mul_exit_ciii #1\W\W #2\Z\Z\Z\Z \W\W
+\def\XINT_mul_smallbyfirst #1\XINT_mul_start 1#2!1\Z!\W
{%
- \XINT_mul_M {#1}#2\Z\Z\Z\Z
+ \ifnum#2=\xint_c_i\expandafter\XINT_mul_oneisone\fi
+ \ifnum#2<\xint_c_xxii\expandafter\XINT_mul_verysmall\fi
+ \expandafter\XINT_mul_out\the\numexpr\XINT_smallmul 1#2!%
}%
-\def\XINT_mul_exit_ci\W\XINT_mul_exit_cii
- \W\XINT_mul_exit_ciii #1\W\W\W #2\Z\Z\Z\Z \W
+\def\XINT_mul_smallbysecond #1\XINT_mul_start #2\W 1#3!1\Z!%
{%
- \XINT_mul_M {#1}#2\Z\Z\Z\Z
+ \ifnum#3=\xint_c_i\expandafter\XINT_mul_oneisone\fi
+ \ifnum#3<\xint_c_xxii\expandafter\XINT_mul_verysmall\fi
+ \expandafter\XINT_mul_out\the\numexpr\XINT_smallmul 1#3!#2%
}%
-\def\XINT_mul_start #1#2\Z\Z\Z\Z
+\def\XINT_mul_oneisone #1!{\XINT_mul_out }%
+\def\XINT_mul_verysmall\expandafter\XINT_mul_out
+ \the\numexpr\XINT_smallmul 1#1!%
+ {\expandafter\XINT_mul_out\the\numexpr\XINT_verysmallmul 0.#1!}%
+\def\XINT_mul_exchange #1\XINT_mul_start #2\W #31\Z!%
+ {\fi\fi\XINT_mul_start #31\Z!\W #2}%
+\def\XINT_mul_start
+ {\expandafter\XINT_mul_out\the\numexpr\XINT_mul_loop 100000000!\Z\W}%
+\def\XINT_mul_out
+ {\expandafter\XINT_cuz_small\romannumeral0\XINT_unrevbyviii {}}%
+\def\XINT_mul_loop #1\Z #2\W #3\W 1#4!%
{%
- \expandafter\XINT_mul_main\expandafter
- {\romannumeral0\XINT_mul_Mr {#1}#2\Z\Z\Z\Z}#2\Z\Z\Z\Z
+ \xint_gob_til_Z #4\XINT_mul_e \Z
+ \expandafter\XINT_mul_a\the\numexpr \XINT_smallmul 1#4!#3\W
+ #11!\W #3\W
}%
-\def\XINT_mul_main #1#2\Z\Z\Z\Z #3#4#5#6%
+\def\XINT_mul_a #11\Z!\W #2!1!#3\W
{%
- \xint_gob_til_W #6\XINT_mul_finish_a\W
- \XINT_mul_compute {#3#4#5#6}{#1}#2\Z\Z\Z\Z
+ \expandafter\XINT_mul_b\the\numexpr
+ \XINT_add_a \xint_c_ii #2!\Z!\Z!\Z!\Z!\Z!\W #1\Z!\Z!\Z!\Z!\Z!\W
}%
-\def\XINT_mul_compute #1#2#3\Z\Z\Z\Z
+\def\XINT_mul_b 1#1!{1#1\expandafter!\the\numexpr\XINT_mul_loop }%
+\def\XINT_mul_e\Z #1\W #2!1!#3\W #4\W {#2!1\Z!}%
+\def\XINT_minimulwc_a 1#1.#2.#3!#4#5#6#7#8.%
{%
- \expandafter\XINT_mul_main\expandafter
- {\romannumeral0\expandafter
- \XINT_mul_Ar\expandafter0\expandafter{\expandafter}%
- \romannumeral0\XINT_mul_Mr {#1}#3\Z\Z\Z\Z
- \W\X\Y\Z 0000#2\W\X\Y\Z }#3\Z\Z\Z\Z
+ \expandafter\XINT_minimulwc_b
+ \the\numexpr \xint_c_x^ix+#1+#3*#8.#3*#4#5#6#7+#2*#8.#2*#4#5#6#7.%
}%
-\def\XINT_mul_finish_a\W\XINT_mul_compute #1%
+\def\XINT_minimulwc_b 1#1#2#3#4#5#6.#7.%
{%
- \XINT_mul_finish_b #1%
+ \expandafter\XINT_minimulwc_c
+ \the\numexpr \xint_c_x^ix+#1#2#3#4#5+#7.#6.%
}%
-\def\XINT_mul_finish_b #1#2#3#4%
+\def\XINT_minimulwc_c 1#1#2#3#4#5#6.#7.#8.%
{%
- \xint_gob_til_W
- #1\XINT_mul_finish_c
- #2\XINT_mul_finish_ci
- #3\XINT_mul_finish_cii
- \W\XINT_mul_finish_ciii #1#2#3#4%
+ 1#6#7\expandafter!%
+ \the\numexpr\expandafter\XINT_smallmul_a
+ \the\numexpr \xint_c_x^viii+#1#2#3#4#5+#8.%
}%
-\def\XINT_mul_finish_ciii #1\W #2#3\Z\Z\Z\Z \W\W\W
+\def\XINT_smallmul 1#1#2#3#4#5!{\XINT_smallmul_a 100000000.#1#2#3#4.#5!}%
+\def\XINT_smallmul_a #1.#2.#3!1#4!%
{%
- \expandafter\XINT_addm_A\expandafter0\expandafter{\expandafter}%
- \romannumeral0\XINT_mul_Mr {#1}#3\Z\Z\Z\Z \W\X\Y\Z 000#2\W\X\Y\Z
+ \xint_gob_til_Z #4\XINT_smallmul_e\Z
+ \XINT_minimulwc_a #1.#2.#3!#4.#2.#3!%
}%
-\def\XINT_mul_finish_cii
- \W\XINT_mul_finish_ciii #1\W\W #2#3\Z\Z\Z\Z \W\W
+\def\XINT_smallmul_e\Z\XINT_minimulwc_a 1#1.#2\Z #3!%
+ {\xint_gob_til_eightzeroes #1\XINT_smallmul_f 000000001\relax #1!1\Z!}%
+\def\XINT_smallmul_f 000000001\relax 00000000!1{1\relax}%
+\def\XINT_verysmallmul #1.#2!1#3!%
{%
- \expandafter\XINT_addm_A\expandafter0\expandafter{\expandafter}%
- \romannumeral0\XINT_mul_Mr {#1}#3\Z\Z\Z\Z \W\X\Y\Z 00#2\W\X\Y\Z
+ \xint_gob_til_Z #3\XINT_verysmallmul_e\Z
+ \expandafter\XINT_verysmallmul_a
+ \the\numexpr #2*#3+#1.#2!%
}%
-\def\XINT_mul_finish_ci #1\XINT_mul_finish_ciii #2\W\W\W #3#4\Z\Z\Z\Z \W
+\def\XINT_verysmallmul_e\Z\expandafter\XINT_verysmallmul_a\the\numexpr
+ #1+#2#3.#4!%
+{\xint_gob_til_zero #2\XINT_verysmallmul_f 0\xint_c_x^viii+#2#3!1\Z!}%
+\def\XINT_verysmallmul_f #1!1{1\relax}%
+\def\XINT_verysmallmul_a #1#2.%
{%
- \expandafter\XINT_addm_A\expandafter0\expandafter{\expandafter}%
- \romannumeral0\XINT_mul_Mr {#2}#4\Z\Z\Z\Z \W\X\Y\Z 0#3\W\X\Y\Z
+ \unless\ifnum #1#2<\xint_c_x^ix
+ \expandafter\XINT_verysmallmul_bi\else
+ \expandafter\XINT_verysmallmul_bj\fi
+ \the\numexpr \xint_c_x^ix+#1#2.%
}%
-\def\XINT_mul_finish_c #1\XINT_mul_finish_ciii \W\W\W\W #2#3\Z\Z\Z\Z
+\def\XINT_verysmallmul_bj{\expandafter\XINT_verysmallmul_cj }%
+\def\XINT_verysmallmul_cj 1#1#2.%
+ {1#2\expandafter!\the\numexpr\XINT_verysmallmul #1.}%
+\def\XINT_verysmallmul_bi\the\numexpr\xint_c_x^ix+#1#2#3.%
+ {1#3\expandafter!\the\numexpr\XINT_verysmallmul #1#2.}%
+\def\XINT_minimul_a #1.#2!#3#4#5#6#7!%
{%
- \expandafter\xint_cleanupzeros_andstop\romannumeral0\xintreverseorder{#2}%
+ \expandafter\XINT_minimul_b
+ \the\numexpr \xint_c_x^viii+#2*#7.#2*#3#4#5#6+#1*#7.#1*#3#4#5#6.%
}%
-\def\XINT_mulr_enter #1\Z\Z\Z\Z #2#3#4#5%
+\def\XINT_minimul_b 1#1#2#3#4#5.#6.%
{%
- \xint_gob_til_W #5\XINT_mulr_exit_a\W
- \XINT_mulr_start {#2#3#4#5}#1\Z\Z\Z\Z
+ \expandafter\XINT_minimul_c
+ \the\numexpr \xint_c_x^ix+#1#2#3#4+#6.#5.%
}%
-\def\XINT_mulr_exit_a\W\XINT_mulr_start #1%
+\def\XINT_minimul_c 1#1#2#3#4#5#6.#7.#8.%
{%
- \XINT_mulr_exit_b #1%
+ 1#6#7\expandafter!\the\numexpr \xint_c_x^viii+#1#2#3#4#5+#8!%
}%
-\def\XINT_mulr_exit_b #1#2#3#4%
-{%
- \xint_gob_til_W
- #2\XINT_mulr_exit_ci
- #3\XINT_mulr_exit_cii
- \W\XINT_mulr_exit_ciii #1#2#3#4%
-}%
-\def\XINT_mulr_exit_ciii #1\W #2\Z\Z\Z\Z \W\W\W
-{%
- \XINT_mul_Mr {#1}#2\Z\Z\Z\Z
-}%
-\def\XINT_mulr_exit_cii\W\XINT_mulr_exit_ciii #1\W\W #2\Z\Z\Z\Z \W\W
-{%
- \XINT_mul_Mr {#1}#2\Z\Z\Z\Z
-}%
-\def\XINT_mulr_exit_ci\W\XINT_mulr_exit_cii
- \W\XINT_mulr_exit_ciii #1\W\W\W #2\Z\Z\Z\Z \W
-{%
- \XINT_mul_Mr {#1}#2\Z\Z\Z\Z
-}%
-\def\XINT_mulr_start #1#2\Z\Z\Z\Z
-{%
- \expandafter\XINT_mulr_main\expandafter
- {\romannumeral0\XINT_mul_Mr {#1}#2\Z\Z\Z\Z}#2\Z\Z\Z\Z
-}%
-\def\XINT_mulr_main #1#2\Z\Z\Z\Z #3#4#5#6%
-{%
- \xint_gob_til_W #6\XINT_mulr_finish_a\W
- \XINT_mulr_compute {#3#4#5#6}{#1}#2\Z\Z\Z\Z
-}%
-\def\XINT_mulr_compute #1#2#3\Z\Z\Z\Z
-{%
- \expandafter\XINT_mulr_main\expandafter
- {\romannumeral0\expandafter
- \XINT_mul_Ar\expandafter0\expandafter{\expandafter}%
- \romannumeral0\XINT_mul_Mr {#1}#3\Z\Z\Z\Z
- \W\X\Y\Z 0000#2\W\X\Y\Z }#3\Z\Z\Z\Z
-}%
-\def\XINT_mulr_finish_a\W\XINT_mulr_compute #1%
-{%
- \XINT_mulr_finish_b #1%
-}%
-\def\XINT_mulr_finish_b #1#2#3#4%
+\def\xintiiSqr {\romannumeral0\xintiisqr }%
+\def\xintiisqr #1%
{%
- \xint_gob_til_W
- #1\XINT_mulr_finish_c
- #2\XINT_mulr_finish_ci
- #3\XINT_mulr_finish_cii
- \W\XINT_mulr_finish_ciii #1#2#3#4%
+ \expandafter\XINT_sqr\romannumeral0\xintiiabs{#1}\Z
}%
-\def\XINT_mulr_finish_ciii #1\W #2#3\Z\Z\Z\Z \W\W\W
+\def\xintiSqr {\romannumeral0\xintisqr }%
+\def\xintisqr #1%
{%
- \expandafter\XINT_addp_A\expandafter0\expandafter{\expandafter}%
- \romannumeral0\XINT_mul_Mr {#1}#3\Z\Z\Z\Z \W\X\Y\Z 000#2\W\X\Y\Z
+ \expandafter\XINT_sqr\romannumeral0\xintiabs{#1}\Z
}%
-\def\XINT_mulr_finish_cii
- \W\XINT_mulr_finish_ciii #1\W\W #2#3\Z\Z\Z\Z \W\W
+\def\XINT_sqr #1\Z
{%
- \expandafter\XINT_addp_A\expandafter0\expandafter{\expandafter}%
- \romannumeral0\XINT_mul_Mr {#1}#3\Z\Z\Z\Z \W\X\Y\Z 00#2\W\X\Y\Z
+ \expandafter\XINT_sqr_a
+ \romannumeral0\expandafter\XINT_sepandrev_andcount
+ \romannumeral0\XINT_zeroes_forviii #1\R\R\R\R\R\R\R\R{10}0000001\W
+ #1\XINT_rsepbyviii_end_A 2345678%
+ \XINT_rsepbyviii_end_B 2345678\relax\xint_c_ii\xint_c_iii
+ \R.\xint_c_vi\R.\xint_c_v\R.\xint_c_iv\R.\xint_c_iii
+ \R.\xint_c_ii\R.\xint_c_i\R.\xint_c_\W
+ \Z
}%
-\def\XINT_mulr_finish_ci #1\XINT_mulr_finish_ciii #2\W\W\W #3#4\Z\Z\Z\Z \W
+\def\XINT_sqr_a #1.%
{%
- \expandafter\XINT_addp_A\expandafter0\expandafter{\expandafter}%
- \romannumeral0\XINT_mul_Mr {#2}#4\Z\Z\Z\Z \W\X\Y\Z 0#3\W\X\Y\Z
+ \ifnum #1=\xint_c_i \expandafter\XINT_sqr_small
+ \else\expandafter\XINT_sqr_start\fi
}%
-\def\XINT_mulr_finish_c #1\XINT_mulr_finish_ciii \W\W\W\W #2#3\Z\Z\Z\Z { #2}%
-\def\xintiiSqr {\romannumeral0\xintiisqr }%
-\def\xintiisqr #1%
+\def\XINT_sqr_small 1#1#2#3#4#5!\Z
{%
- \expandafter\XINT_sqr\expandafter {\romannumeral0\xintiiabs{#1}}%
+ \ifnum #1#2#3#4#5<46341 \expandafter\XINT_sqr_verysmall\fi
+ \expandafter\XINT_sqr_small_out
+ \the\numexpr\XINT_minimul_a #1#2#3#4.#5!#1#2#3#4#5!%
}%
-\def\xintiSqr {\romannumeral0\xintisqr }%
-\def\xintisqr #1%
+\edef\XINT_sqr_verysmall
+ \expandafter\XINT_sqr_small_out\the\numexpr\XINT_minimul_a #1!#2!%
+ {\noexpand\expandafter\space\noexpand\the\numexpr #2*#2\relax}%
+\def\XINT_sqr_small_out 1#1!1#2!%
{%
- \expandafter\XINT_sqr\expandafter {\romannumeral0\xintiabs{#1}}%
+ \XINT_cuz #2#1\R
}%
-\let\xintSqr\xintiSqr \let\xintsqr\xintisqr
-\def\XINT_sqr #1%
+\def\XINT_sqr_start #1\Z
{%
- \expandafter\XINT_mul_enter
- \romannumeral0%
- \XINT_RQ {}#1\R\R\R\R\R\R\R\R\Z
- \Z\Z\Z\Z #1\W\W\W\W
+ \expandafter\XINT_mul_out
+ \the\numexpr\XINT_mul_loop 100000000!\Z\W #11\Z!\W #11\Z!%
+ 1\R!1\R!1\R!1\R!1\R!1\R!1\R!1\R!\W
}%
\def\xintiiPow {\romannumeral0\xintiipow }%
\def\xintiipow #1%
@@ -1561,7 +1141,6 @@
{%
\expandafter\xint_pow\romannumeral0\xintnum{#1}\Z%
}%
-\let\xintPow\xintiPow \let\xintpow\xintipow
\def\xint_pow #1#2\Z
{%
\xint_UDsignfork
@@ -1614,7 +1193,7 @@
\ifcase\XINT_cntSgn #1\Z
\expandafter\XINT_pow_BisZero
\or
- \expandafter\XINT_pow_checkBsize
+ \expandafter\XINT_pow_I_in
\else
\expandafter\XINT_pow_BisNegative
\fi
@@ -1623,75 +1202,198 @@
\edef\XINT_pow_BisNegative #1#2%
{\noexpand\xintError:FractionRoundedToZero\space 0}%
\def\XINT_pow_BisZero #1#2{ 1}%
-\def\XINT_pow_checkBsize #1%
+%%%%%%%%%%%%
+\def\XINT_pow_I_in #1#2%
{%
- \ifnum #1>100000
- \expandafter\XINT_pow_BtooBig
- \else
- \expandafter\XINT_pow_loopI
- \fi
- {#1}%
+ \expandafter\XINT_pow_I_loop
+ \the\numexpr #1\expandafter.%
+ \romannumeral0\expandafter\XINT_sepandrev
+ \romannumeral0\XINT_zeroes_forviii #2\R\R\R\R\R\R\R\R{10}0000001\W
+ #2\XINT_rsepbyviii_end_A 2345678%
+ \XINT_rsepbyviii_end_B 2345678\relax XX%
+ \R.\R.\R.\R.\R.\R.\R.\R.\W 1\Z!\W
+ 1\R!1\R!1\R!1\R!1\R!1\R!1\R!1\R!\W
}%
-\edef\XINT_pow_BtooBig #1#2{\noexpand\xintError:ExponentTooBig\space 0}%
-\def\XINT_pow_loopI #1%
+\def\XINT_pow_I_loop #1.%
{%
- \ifnum #1=\xint_c_i\XINT_pow_Iend\fi
+ \ifnum #1 = \xint_c_i\expandafter\XINT_pow_I_exit\fi
\ifodd #1
- \expandafter\XINT_pow_loopI_odd
+ \expandafter\XINT_pow_II_in
\else
- \expandafter\XINT_pow_loopI_even
- \fi
- {#1}%
+ \expandafter\XINT_pow_I_squareit
+ \fi #1.%
+}%
+\def\XINT_pow_I_exit \ifodd #1\fi #2.#3\W {\XINT_mul_out #3}%
+\def\XINT_pow_I_squareit #1.#2\W%
+{%
+ \expandafter\XINT_pow_I_loop
+ \the\numexpr #1/\xint_c_ii\expandafter.%
+ \the\numexpr\XINT_pow_mulbutcheckifsmall #2\W #2\W
}%
-\edef\XINT_pow_Iend\fi #1\fi #2#3{\noexpand\fi\space #3}%
-\def\XINT_pow_loopI_even #1#2%
+%%%%%%%%%%%%
+\def\XINT_pow_mulbutcheckifsmall #1!1#2%
{%
- \expandafter\XINT_pow_loopI\expandafter
- {\the\numexpr #1/\xint_c_ii\expandafter}\expandafter
- {\romannumeral0\xintiisqr {#2}}%
+ \xint_gob_til_Z #2\XINT_pow_mul_small\Z
+ \XINT_mul_loop 100000000!\Z\W #1!1#2%
}%
-\def\XINT_pow_loopI_odd #1#2%
+\def\XINT_pow_mul_small\Z\XINT_mul_loop 100000000!\Z\W 1#1!1\Z!\W
{%
- \expandafter\XINT_pow_loopI_odda\expandafter
- {\romannumeral0\XINT_RQ {}#2\R\R\R\R\R\R\R\R\Z }{#1}{#2}%
+ \XINT_smallmul 1#1!%
}%
-\def\XINT_pow_loopI_odda #1#2#3%
+%%%%%%%%%%%%
+\def\XINT_pow_II_in #1.#2\W
{%
- \expandafter\XINT_pow_loopII\expandafter
- {\the\numexpr #2/\xint_c_ii-\xint_c_i\expandafter}\expandafter
- {\romannumeral0\xintiisqr {#3}}{#1}%
+ \expandafter\XINT_pow_II_loop
+ \the\numexpr #1/\xint_c_ii-\xint_c_i\expandafter.%
+ \the\numexpr\XINT_pow_mulbutcheckifsmall #2\W #2\W #2\W
}%
-\def\XINT_pow_loopII #1%
+\def\XINT_pow_II_loop #1.%
{%
- \ifnum #1 = \xint_c_i\XINT_pow_IIend\fi
+ \ifnum #1 = \xint_c_i\expandafter\XINT_pow_II_exit\fi
\ifodd #1
- \expandafter\XINT_pow_loopII_odd
+ \expandafter\XINT_pow_II_odda
\else
- \expandafter\XINT_pow_loopII_even
+ \expandafter\XINT_pow_II_even
+ \fi #1.%
+}%
+\def\XINT_pow_II_exit\ifodd #1\fi #2.#3\W #4\W
+{%
+ \expandafter\XINT_mul_out
+ \the\numexpr\XINT_pow_mulbutcheckifsmall #4\W #3%
+}%
+\def\XINT_pow_II_even #1.#2\W
+{%
+ \expandafter\XINT_pow_II_loop
+ \the\numexpr #1/\xint_c_ii\expandafter.%
+ \the\numexpr\XINT_pow_mulbutcheckifsmall #2\W #2\W
+}%
+\def\XINT_pow_II_odda #1.#2\W #3\W
+{%
+ \expandafter\XINT_pow_II_oddb
+ \the\numexpr #1/\xint_c_ii-\xint_c_i\expandafter.%
+ \the\numexpr\XINT_pow_mulbutcheckifsmall #3\W #2\W #2\W
+}%
+\def\XINT_pow_II_oddb #1.#2\W #3\W
+{%
+ \expandafter\XINT_pow_II_loop
+ \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-`0#1}%
+}%
+\let\xintFac\xintiFac \let\xintfac\xintifac
+\def\XINT_fac_fork #1%
+{%
+ \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}%
}%
-\def\XINT_pow_loopII_even #1#2%
+\def\XINT_fac_checksize #1%
+{%
+ \ifnum #1>9999
+ \xint_dothis{\expandafter\xintError:FactorialOfTooBigNumber
+ \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
+ \xint_orthat{\XINT_fac_smallloop_a #1.\XINT_mul_out}%
+ 1\R!1\R!1\R!1\R!1\R!1\R!1\R!1\R!\W
+}%
+\def\XINT_fac_bigloop_a #1.%
+{%
+ \expandafter\XINT_fac_bigloop_b \the\numexpr
+ #1+\xint_c_i-\xint_c_ii*((#1-464)/\xint_c_ii).#1.%
+}%
+\def\XINT_fac_bigloop_b #1.#2.%
+{%
+ \expandafter\XINT_fac_medloop_a
+ \the\numexpr #1-\xint_c_i.{\XINT_fac_bigloop_loop #1.#2.}%
+}%
+\def\XINT_fac_bigloop_loop #1.#2.%
+{%
+ \ifnum #1>#2 \expandafter\XINT_fac_bigloop_exit\fi
+ \expandafter\XINT_fac_bigloop_loop
+ \the\numexpr #1+\xint_c_ii\expandafter.%
+ \the\numexpr #2\expandafter.\the\numexpr\XINT_fac_bigloop_mul #1!%
+}%
+\def\XINT_fac_bigloop_exit #1!{\XINT_mul_out}%
+\def\XINT_fac_bigloop_mul #1!%
+{%
+ \expandafter\XINT_smallmul
+ \the\numexpr \xint_c_x^viii+#1*(#1+\xint_c_i)!%
+}%
+\def\XINT_fac_medloop_a #1.%
+{%
+ \expandafter\XINT_fac_medloop_b
+ \the\numexpr #1+\xint_c_i-\xint_c_iii*((#1-100)/\xint_c_iii).#1.%
+}%
+\def\XINT_fac_medloop_b #1.#2.%
+{%
+ \expandafter\XINT_fac_smallloop_a
+ \the\numexpr #1-\xint_c_i.{\XINT_fac_medloop_loop #1.#2.}%
+}%
+\def\XINT_fac_medloop_loop #1.#2.%
{%
- \expandafter\XINT_pow_loopII\expandafter
- {\the\numexpr #1/\xint_c_ii\expandafter}\expandafter
- {\romannumeral0\xintiisqr {#2}}%
+ \ifnum #1>#2 \expandafter\XINT_fac_loop_exit\fi
+ \expandafter\XINT_fac_medloop_loop
+ \the\numexpr #1+\xint_c_iii\expandafter.%
+ \the\numexpr #2\expandafter.\the\numexpr\XINT_fac_medloop_mul #1!%
}%
-\def\XINT_pow_loopII_odd #1#2#3%
+\def\XINT_fac_medloop_mul #1!%
{%
- \expandafter\XINT_pow_loopII_odda\expandafter
- {\romannumeral0\XINT_mulr_enter #3\Z\Z\Z\Z #2\W\W\W\W}{#1}{#2}%
+ \expandafter\XINT_smallmul
+ \the\numexpr
+ \xint_c_x^viii+#1*(#1+\xint_c_i)*(#1+\xint_c_ii)!%
}%
-\def\XINT_pow_loopII_odda #1#2#3%
+\def\XINT_fac_smallloop_a #1.%
{%
- \expandafter\XINT_pow_loopII\expandafter
- {\the\numexpr #2/\xint_c_ii-\xint_c_i\expandafter}\expandafter
- {\romannumeral0\xintiisqr {#3}}{#1}%
+ \csname
+ XINT_fac_smallloop_\the\numexpr #1-\xint_c_iv*(#1/\xint_c_iv)\relax
+ \endcsname #1.%
}%
-\def\XINT_pow_IIend\fi #1\fi #2#3#4%
+\expandafter\def\csname XINT_fac_smallloop_1\endcsname #1.%
{%
- \fi\XINT_mul_enter #4\Z\Z\Z\Z #3\W\W\W\W
+ \XINT_fac_smallloop_loop 2.#1.100000001!1\Z!%
}%
+\expandafter\def\csname XINT_fac_smallloop_-2\endcsname #1.%
+{%
+ \XINT_fac_smallloop_loop 3.#1.100000002!1\Z!%
+}%
+\expandafter\def\csname XINT_fac_smallloop_-1\endcsname #1.%
+{%
+ \XINT_fac_smallloop_loop 4.#1.100000006!1\Z!%
+}%
+\expandafter\def\csname XINT_fac_smallloop_0\endcsname #1.%
+{%
+ \XINT_fac_smallloop_loop 5.#1.1000000024!1\Z!%
+}%
+\def\XINT_fac_smallloop_loop #1.#2.%
+{%
+ \ifnum #1>#2 \expandafter\XINT_fac_loop_exit\fi
+ \expandafter\XINT_fac_smallloop_loop
+ \the\numexpr #1+\xint_c_iv\expandafter.%
+ \the\numexpr #2\expandafter.\the\numexpr\XINT_fac_smallloop_mul #1!%
+}%
+\def\XINT_fac_smallloop_mul #1!%
+{%
+ \expandafter\XINT_smallmul
+ \the\numexpr
+ \xint_c_x^viii+#1*(#1+\xint_c_i)*(#1+\xint_c_ii)*(#1+\xint_c_iii)!%
+}%
+\def\XINT_fac_loop_exit #1!#2\Z!#3{#3#2\Z!}%
\def\xintiiQuo {\romannumeral0\xintiiquo }%
\def\xintiiRem {\romannumeral0\xintiirem }%
\def\xintiiquo {\expandafter\xint_firstoftwo_thenstop\romannumeral0\xintiidivision }%
@@ -1700,12 +1402,11 @@
\def\xintiRem {\romannumeral0\xintirem }%
\def\xintiquo {\expandafter\xint_firstoftwo_thenstop\romannumeral0\xintidivision }%
\def\xintirem {\expandafter\xint_secondoftwo_thenstop\romannumeral0\xintidivision }%
-\let\xintQuo\xintiQuo\let\xintquo\xintiquo % deprecated (1.1)
-\let\xintRem\xintiRem\let\xintrem\xintirem % deprecated (1.1)
+\let\xintQuo\xintiQuo\let\xintquo\xintiquo % deprecated
+\let\xintRem\xintiRem\let\xintrem\xintirem % deprecated
\def\xintiDivision {\romannumeral0\xintidivision }%
-\def\xintidivision #1{\expandafter\XINT_division\romannumeral0\xintnum{#1}\Z }%
-\let\xintDivision\xintiDivision \let\xintdivision\xintidivision % deprecated
-\def\XINT_division #1#2\Z #3{\expandafter\XINT_iidivision_a\expandafter #1%
+\def\xintidivision #1{\expandafter\XINT_idivision\romannumeral0\xintnum{#1}\Z }%
+\def\XINT_idivision #1#2\Z #3{\expandafter\XINT_iidivision_a\expandafter #1%
\romannumeral0\xintnum{#3}\Z #2\Z }%
\def\xintiiDivision {\romannumeral0\xintiidivision }%
\def\xintiidivision #1{\expandafter\XINT_iidivision \romannumeral-`0#1\Z }%
@@ -1719,10 +1420,10 @@
\romannumeral0\XINT_iidivision_bpos #1}\fi
\xint_orthat{\XINT_iidivision_bpos #1#2}%
}%
-\def\XINT_iidivision_divbyzero #1\Z #2\Z {\xintError:DivisionByZero\space {0}{0}}%
-\def\XINT_iidivision_aiszero #1\Z #2\Z { {0}{0}}%
+\def\XINT_iidivision_divbyzero #1\Z #2\Z {\xintError:DivisionByZero{0}{0}}%
+\def\XINT_iidivision_aiszero #1\Z #2\Z {{0}{0}}%
\def\XINT_iidivision_bneg #1% q->-q, r unchanged
- {\expandafter\space\expandafter{\romannumeral0\XINT_opp #1}}%
+ {\expandafter{\romannumeral0\XINT_opp #1}}%
\def\XINT_iidivision_bpos #1%
{%
\xint_UDsignfork
@@ -1739,7 +1440,7 @@
\else
\expandafter\XINT_iidivision_aneg_rpos
\fi {#1}{#2}}%
-\def\XINT_iidivision_aneg_rzero #1#2#3{ {-#1}{0}}% necessarily q was >0
+\def\XINT_iidivision_aneg_rzero #1#2#3{{-#1}{0}}% necessarily q was >0
\def\XINT_iidivision_aneg_rpos #1%
{%
\expandafter\XINT_iidivision_aneg_end\expandafter
@@ -1747,155 +1448,185 @@
}%
\def\XINT_iidivision_aneg_end #1#2#3%
{%
- \expandafter\xint_exchangetwo_keepbraces_thenstop
- \expandafter{\romannumeral0\XINT_sub_pre {#3}{#2}}{#1}% r-> b-r
+ \expandafter\xint_exchangetwo_keepbraces
+ \expandafter{\romannumeral0\XINT_sub_mm_a {}{}#3\Z #2\Z}{#1}% r-> b-r
}%
+%%%%%%%%%%%%
\def\XINT_div_prepare #1%
{%
- \expandafter \XINT_div_prepareB_aa \expandafter
- {\romannumeral0\xintlength {#1}}{#1}% B > 0 ici
-}%
-\def\XINT_div_prepareB_aa #1%
-{%
- \ifnum #1=\xint_c_i
- \expandafter\XINT_div_prepareB_onedigit
- \else
- \expandafter\XINT_div_prepareB_a
- \fi
- {#1}%
+ \XINT_div_prepare_a #1\R\R\R\R\R\R\R\R {10}0000001\W !{#1}%
}%
-\def\XINT_div_prepareB_a #1%
+\def\XINT_div_prepare_a #1#2#3#4#5#6#7#8#9%
{%
- \expandafter\XINT_div_prepareB_c\expandafter
- {\the\numexpr \xint_c_iv*((#1+\xint_c_i)/\xint_c_iv)}{#1}%
+ \xint_gob_til_R #9\XINT_div_prepare_small\R
+ \XINT_div_prepare_b #9%
}%
-\def\XINT_div_prepareB_onedigit #1#2%
+%%%%%%%%%%%%
+\def\XINT_div_prepare_small\R #1!#2%
{%
- \ifcase#2
+ \ifcase #2
\or\expandafter\XINT_div_BisOne
\or\expandafter\XINT_div_BisTwo
- \else\expandafter\XINT_div_prepareB_e
- \fi {000}{0}{4}{#2}%
+ \else\expandafter\XINT_div_small_a
+ \fi {#2}%
}%
-\def\XINT_div_BisOne #1#2#3#4#5{ {#5}{0}}%
-\def\XINT_div_BisTwo #1#2#3#4#5%
+\def\XINT_div_BisOne #1#2{{#2}{0}}%
+\def\XINT_div_BisTwo #1#2%
{%
\expandafter\expandafter\expandafter\XINT_div_BisTwo_a
- \ifodd\xintiiLDg{#5} \expandafter1\else \expandafter0\fi {#5}%
+ \ifodd\xintLDg{#2} \expandafter1\else \expandafter0\fi {#2}%
}%
-\edef\XINT_div_BisTwo_a #1#2%
+\def\XINT_div_BisTwo_a #1#2%
{%
- \noexpand\expandafter\space\noexpand\expandafter
- {\noexpand\romannumeral0\noexpand\xinthalf {#2}}{#1}%
+ \expandafter{\romannumeral0\xinthalf {#2}}{#1}%
}%
-\def\XINT_div_prepareB_c #1#2%
+\def\XINT_div_small_a #1#2%
{%
- \csname XINT_div_prepareB_d\romannumeral\numexpr#1-#2\endcsname
- {#1}%
+ \expandafter\XINT_div_small_b
+ \the\numexpr #1/\xint_c_ii\expandafter
+ .\the\numexpr \xint_c_x^viii+#1\expandafter!%
+ \romannumeral0%
+ \XINT_div_small_ba #2\R\R\R\R\R\R\R\R{10}0000001\W
+ #2\XINT_sepbyviii_Z_end 2345678\relax
}%
-\def\XINT_div_prepareB_d {\XINT_div_prepareB_e {}{0000}}%
-\def\XINT_div_prepareB_di {\XINT_div_prepareB_e {0}{000}}%
-\def\XINT_div_prepareB_dii {\XINT_div_prepareB_e {00}{00}}%
-\def\XINT_div_prepareB_diii {\XINT_div_prepareB_e {000}{0}}%
-\def\XINT_div_cleanR #10000.{{#1}}%
-\def\XINT_div_prepareB_e #1#2#3#4%
+\def\XINT_div_small_b #1!#2{#2#1!}%
+\def\XINT_div_small_ba #1#2#3#4#5#6#7#8#9%
{%
- \ifnum#3=\xint_c_iv\expandafter\XINT_div_prepareLittleB_f
- \else\expandafter\XINT_div_prepareB_f
- \fi
- #4#1{#3}{#2}{#1}%
+ \xint_gob_til_R #9\XINT_div_smallsmall\R
+ \expandafter\XINT_div_dosmalldiv
+ \the\numexpr\expandafter\XINT_sepbyviii_Z
+ \romannumeral0\XINT_zeroes_forviii
+ #1#2#3#4#5#6#7#8#9%
}%
-\def\XINT_div_prepareB_f #1#2#3#4#5#{%
- \expandafter\XINT_div_prepareB_g
- \the\numexpr #1#2#3#4+\xint_c_i\expandafter
- .\the\numexpr (#1#2#3#4+\xint_c_i)/\xint_c_ii\expandafter
- .\romannumeral0\xintreverseorder {#1#2#3#4#5}.{#1#2#3#4}%
+\def\XINT_div_smallsmall\R
+ \expandafter\XINT_div_dosmalldiv
+ \the\numexpr\expandafter\XINT_sepbyviii_Z
+ \romannumeral0\XINT_zeroes_forviii #1\R #2\relax
+ {{\XINT_div_dosmallsmall}{#1}}%
+\def\XINT_div_dosmallsmall #1.1#2!#3%
+{%
+ \expandafter\XINT_div_smallsmallend
+ \the\numexpr (#3+#1)/#2-\xint_c_i.#2.#3.%
}%
-\def\XINT_div_prepareLittleB_f #1#{%
- \expandafter\XINT_div_prepareB_g \the\numexpr #1/\xint_c_ii.{}.{}.{#1}%
+\def\XINT_div_smallsmallend #1.#2.#3.{\expandafter
+ {\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!%
+{%
+ \XINT_div_prepare_d #1.00000000!{#1}%
}%
-\def\XINT_div_prepareB_g #1.#2.#3.#4#5#6#7#8%
+\def\XINT_div_prepare_d #1#2#3#4#5#6#7#8#9%
{%
- \XINT_div_prepareA_a {#8#7}{#5}{{#1}{#2}{#4}}{#3}{#6}%
+ \expandafter\XINT_div_prepare_e\xint_gob_til_dot #1#2#3#4#5#6#7#8#9!%
}%
-\def\XINT_div_prepareA_a #1%
+\def\XINT_div_prepare_e #1!#2!#3#4%
{%
- \expandafter\XINT_div_prepareA_b\expandafter
- {\romannumeral0\xintlength {#1}}{#1}%
+ \XINT_div_prepare_f #4#3\X {#1}{#3}%
}%
-\def\XINT_div_prepareA_b #1%
+\def\XINT_div_prepare_f #1#2#3#4#5#6#7#8#9\X
{%
- \expandafter\XINT_div_prepareA_c\expandafter
- {\the\numexpr \xint_c_iv*((#1+\xint_c_i)/\xint_c_iv)}{#1}%
+ \expandafter\XINT_div_prepare_g
+ \the\numexpr #1#2#3#4#5#6#7#8+\xint_c_i\expandafter
+ .\the\numexpr (#1#2#3#4#5#6#7#8+\xint_c_i)/\xint_c_ii\expandafter
+ .\the\numexpr #1#2#3#4#5#6#7#8\expandafter
+ .\romannumeral0\XINT_sepandrev_andcount
+ #1#2#3#4#5#6#7#8#9\XINT_rsepbyviii_end_A 2345678%
+ \XINT_rsepbyviii_end_B 2345678%
+ \relax\xint_c_ii\xint_c_iii
+ \R.\xint_c_vi\R.\xint_c_v\R.\xint_c_iv\R.\xint_c_iii
+ \R.\xint_c_ii\R.\xint_c_i\R.\xint_c_\W
+ \X
}%
-\def\XINT_div_prepareA_c #1#2%
+\def\XINT_div_prepare_g #1.#2.#3.#4.#5\X #6#7#8%
{%
- \csname XINT_div_prepareA_d\romannumeral\numexpr #1-#2\endcsname
- {#1}%
+ \expandafter\XINT_div_prepare_h
+ \the\numexpr\expandafter\XINT_sepbyviii_andcount
+ \romannumeral0\XINT_zeroes_forviii #8#7\R\R\R\R\R\R\R\R{10}0000001\W
+ #8#7\XINT_sepbyviii_end 2345678\relax
+ \xint_c_vii!\xint_c_vi!\xint_c_v!\xint_c_iv!%
+ \xint_c_iii!\xint_c_ii!\xint_c_i!\xint_c_\W
+ {#1}{#2}{#3}{#4}{#5}{#6}%
}%
-\def\XINT_div_prepareA_d {\XINT_div_prepareA_e {}}%
-\def\XINT_div_prepareA_di {\XINT_div_prepareA_e {0}}%
-\def\XINT_div_prepareA_dii {\XINT_div_prepareA_e {00}}%
-\def\XINT_div_prepareA_diii {\XINT_div_prepareA_e {000}}%
-\def\XINT_div_prepareA_e #1#2#3#4#5%
+\def\XINT_div_prepare_h #11.#2.#3#4#5#6%#7#8%
{%
- \XINT_div_start_a {#2}{#4}{#1#3}#5%
+ \XINT_div_start_a {#2}{#6}{#1}{#3}{#4}{#5}%{#7}{#8}%
}%
\def\XINT_div_start_a #1#2%
{%
- \ifnum #2=\xint_c_iv \expandafter\XINT_div_little_b
+ \ifnum #1 < #2
+ \expandafter\XINT_div_zeroQ
\else
- \ifnum #1 < #2
- \expandafter\expandafter\expandafter\XINT_div_III_aa
- \else
- \expandafter\expandafter\expandafter\XINT_div_start_b
- \fi
+ \expandafter\XINT_div_start_b
\fi
{#1}{#2}%
}%
-\def\XINT_div_III_aa #1#2#3#4#5#6#7%
+\def\XINT_div_zeroQ #1#2#3#4#5#6#7%
{%
- \expandafter\expandafter\expandafter
- \XINT_div_III_b\xint_cleanupzeros_nostop #3.{0000}%
+ \expandafter\XINT_div_zeroQ_end
+ \romannumeral0\XINT_unsep_cuzsmall
+ #31\R!1\R!1\R!1\R!1\R!1\R!1\R!1\R!\W .%
}%
-\def\XINT_div_III_b #1%
+\def\XINT_div_zeroQ_end #1.#2%
+ {\expandafter{\expandafter0\expandafter}\XINT_div_cleanR #1#2.}%
+\def\XINT_div_start_b #1#2#3#4#5#6%
{%
- \if0#1%
- \expandafter\XINT_div_III_bRzero
- \else
- \expandafter\XINT_div_III_bRpos
- \fi
- #1%
+ \expandafter\XINT_div_finish\the\numexpr
+ \XINT_div_start_c {#2}.#3.{#6}{{#1}{#2}{{#4}{#5}}{#6}}%
}%
-\def\XINT_div_III_bRzero 0.#1#2%
+\def\XINT_div_finish
{%
- \expandafter\space\expandafter
- {\romannumeral0\XINT_cuz_loop #1\W\W\W\W\W\W\W\Z}{0}%
+ \expandafter\XINT_div_finish_a \romannumeral-`0\XINT_div_unsepQ
}%
-\def\XINT_div_III_bRpos #1.#2#3%
+\def\XINT_div_finish_a #1\Z #2.{\XINT_div_finish_b #2.{#1}}%
+\def\XINT_div_finish_b #1%
{%
- \expandafter\XINT_div_III_c \XINT_div_cleanR #1#3.{#2}%
+ \if0#1%
+ \expandafter\XINT_div_finish_bRzero
+ \else
+ \expandafter\XINT_div_finish_bRpos
+ \fi
+ #1%
}%
-\def\XINT_div_III_c #1#2%
+\def\XINT_div_finish_bRzero 0.#1#2{{#1}{0}}%
+\def\XINT_div_finish_bRpos #1.#2#3%
{%
- \expandafter\space\expandafter
- {\romannumeral0\XINT_cuz_loop #2\W\W\W\W\W\W\W\Z}{#1}%
+ \expandafter\xint_exchangetwo_keepbraces\XINT_div_cleanR #1#3.{#2}%
}%
-\def\XINT_div_start_b #1#2#3#4#5#6%
+\def\XINT_div_cleanR #100000000.{{#1}}%
+\def\XINT_div_start_c #1%
{%
- \XINT_div_start_c {#2}.#3.{#6}{{#1}{#2}{{#4}{#5}}{#6}}%
+ \ifnum #1>\xint_c_vi
+ \expandafter\XINT_div_start_ca
+ \else
+ \expandafter\XINT_div_start_cb
+ \fi {#1}%
}%
-\def\XINT_div_start_c #1#2.#3#4#5#6%
+\def\XINT_div_start_ca #1#2.#3!#4!#5!#6!#7!#8!#9!%
{%
- \ifnum #1=\xint_c_iv\XINT_div_start_ca\fi
\expandafter\XINT_div_start_c\expandafter
- {\the\numexpr #1-\xint_c_iv}#2#3#4#5#6.%
-}%
-\def\XINT_div_start_ca\fi\expandafter\XINT_div_start_c\expandafter
- #1#2#3#4#5{\fi\XINT_div_start_d {#2#3#4#5}#2#3#4#5}%
-\def\XINT_div_start_d #1#2.#3.#4#5#6%
-{%
- \XINT_div_I_a {#1}{#4}{#2}{#6}{0000}#5{#3}{#6}{}%
+ {\the\numexpr #1-\xint_c_vii}#2#3!#4!#5!#6!#7!#8!#9!.%
+}%
+\def\XINT_div_start_cb #1%
+ {\csname XINT_div_start_c_\romannumeral\numexpr#1\endcsname}%
+\def\XINT_div_start_c_i #1.#2!%
+ {\XINT_div_start_c_ #1#2!.}%
+\def\XINT_div_start_c_ii #1.#2!#3!%
+ {\XINT_div_start_c_ #1#2!#3!.}%
+\def\XINT_div_start_c_iii #1.#2!#3!#4!%
+ {\XINT_div_start_c_ #1#2!#3!#4!.}%
+\def\XINT_div_start_c_iv #1.#2!#3!#4!#5!%
+ {\XINT_div_start_c_ #1#2!#3!#4!#5!.}%
+\def\XINT_div_start_c_v #1.#2!#3!#4!#5!#6!%
+ {\XINT_div_start_c_ #1#2!#3!#4!#5!#6!.}%
+\def\XINT_div_start_c_vi #1.#2!#3!#4!#5!#6!#7!%
+ {\XINT_div_start_c_ #1#2!#3!#4!#5!#6!#7!.}%
+\def\XINT_div_start_c_ 1#1!#2.#3.#4#5#6%
+{%
+ \XINT_div_I_a {#1}{#4}{1#1!#2}{#6}{00000000}#5{#3}{#6}%
}%
\def\XINT_div_I_a #1#2%
{%
@@ -1905,11 +1636,10 @@
{%
\xint_gob_til_zero #1\XINT_div_I_czero 0\XINT_div_I_c #1%
}%
-\def\XINT_div_I_czero 0%
- \XINT_div_I_c 0.#1#2#3#4#5{\XINT_div_I_g {#5}{#3}}%
+\def\XINT_div_I_czero 0\XINT_div_I_c 0.#1#2#3#4#5{1#5\XINT_div_I_g {#3}}%
\def\XINT_div_I_c #1.#2#3%
{%
- \expandafter\XINT_div_I_da\the\numexpr #2-#1*#3.#1.%
+ \expandafter\XINT_div_I_da\the\numexpr #2-#1*#3.#1.{#2}{#3}%
}%
\def\XINT_div_I_da #1.%
{%
@@ -1925,238 +1655,351 @@
}%
\def\XINT_div_I_dN #1.%
{%
- \expandafter\XINT_div_I_dP\the\numexpr #1-\xint_c_i.%
+ \expandafter\XINT_div_I_b\the\numexpr #1-\xint_c_i.%
}%
-\def\XINT_div_I_db #1.#2#3% #1=q=un chiffre, #2=alpha, #3=B
+\def\XINT_div_I_db #1.#2#3#4#5%
{%
- \expandafter\XINT_div_I_dc\expandafter
- {\romannumeral0\expandafter\XINT_div_sub_xpxp\expandafter
- {\romannumeral0\xintreverseorder{#2}}%
- {\romannumeral0\XINT_mul_Mr {#1}#3\Z\Z\Z\Z }}%
- #1{#2}{#3}%
+ \expandafter\XINT_div_I_dc\expandafter #1%
+ \romannumeral0\expandafter\XINT_div_sub\expandafter
+ {\romannumeral0\XINT_rev_nounsep {}#4\R!\R!\R!\R!\R!\R!\R!\R!\W}%
+ {\the\numexpr\XINT_div_verysmallmul #1!#51\Z!}%
+ \Z {#4}{#5}%
}%
\def\XINT_div_I_dc #1#2%
{%
- \if-#1% s'arranger pour que si n\'egatif on ait renvoy\'e alpha=-.
- \expandafter\xint_firstoftwo
- \else\expandafter\xint_secondoftwo\fi
- {\expandafter\XINT_div_I_dP\the\numexpr #2-\xint_c_i.}%
- {\XINT_div_I_e {#1}#2}%
+ \if-#2\expandafter\XINT_div_I_dd\else\expandafter\XINT_div_I_de\fi
+ #1#2%
+}%
+\def\XINT_div_I_dd #1-\Z
+{%
+ \if #11\expandafter\XINT_div_I_dz\fi
+ \expandafter\XINT_div_I_dP\the\numexpr #1-\xint_c_i.XX%
}%
-\def\XINT_div_I_e #1#2#3#4#5%
+\def\XINT_div_I_dz #1XX#2#3#4%
{%
- \expandafter\XINT_div_I_f \the\numexpr \xint_c_x^iv+#2+#5{#1}%
+ 1#4\XINT_div_I_g {#2}%
}%
-\def\XINT_div_I_dP #1.#2#3#4%
+\def\XINT_div_I_de #1#2\Z #3#4#5{1#5+#1\XINT_div_I_g {#2}}%
+\def\XINT_div_I_dP #1.#2#3#4#5#6%
{%
- \expandafter \XINT_div_I_f \the\numexpr \xint_c_x^iv+#1+#4\expandafter
- {\romannumeral0\expandafter\XINT_div_sub_xpxp\expandafter
- {\romannumeral0\xintreverseorder{#2}}%
- {\romannumeral0\XINT_mul_Mr {#1}#3\Z\Z\Z\Z }}%
+ 1#6+#1\expandafter\XINT_div_I_g\expandafter
+ {\romannumeral0\expandafter\XINT_div_sub\expandafter
+ {\romannumeral0\XINT_rev_nounsep {}#4\R!\R!\R!\R!\R!\R!\R!\R!\W}%
+ {\the\numexpr\XINT_div_verysmallmul #1!#51\Z!}%
+ }%
}%
-\def\XINT_div_I_f 1#1#2#3#4{\XINT_div_I_g {#1#2#3#4}}%
-\def\XINT_div_I_g #1#2#3#4#5#6#7#8#9%
+\def\XINT_div_I_g #1#2#3#4#5#6#7%
{%
- \ifnum#3=#4
- \expandafter\XINT_div_III_ab
+ \expandafter !\the\numexpr
+ \ifnum#2=#3
+ \expandafter\XINT_div_exittofinish
\else
\expandafter\XINT_div_I_h
\fi
- {#5}#2.#7.{{#5}{#6}{#4}{#3}}{#8}{#9#1}%
+ {#4}#1.#6.{{#4}{#5}{#3}{#2}}{#7}%
}%
-\def\XINT_div_III_ab #1#2.#3.#4#5%
+\def\XINT_div_exittofinish #1#2.#3.#4#5%
{%
- \expandafter\XINT_div_III_b
- \romannumeral0\XINT_cuz_loop #2#3\W\W\W\W\W\W\W\Z.%
+ 1\expandafter\expandafter\expandafter!\expandafter\XINT_unsep_delim
+ \romannumeral0\XINT_div_unsepR #2#31\R!1\R!1\R!1\R!1\R!1\R!1\R!1\R!\W.%
}%
-\def\XINT_div_I_h #1.#2#3#4#5#6.#7#8%
+\def\XINT_div_I_h #1.#2!#3.#4#5%
{%
- \XINT_div_II_b #1#2#3#4#5.{#8}{#7}{#6}{#8}%
+ \XINT_div_II_b #1#2!.{#5}{#4}{#3}{#5}%
}%
-\def\XINT_div_II_b #1#2#3#4#5#6#7#8#9%
+\def\XINT_div_II_b #11#2!#3!%
{%
- \xint_gob_til_zeros_iv #2#3#4#5\XINT_div_II_skipc 0000%
- \XINT_div_II_c #1{#2#3#4#5}{#6#7#8#9}%
+ \xint_gob_til_eightzeroes #2\XINT_div_II_skipc 00000000%
+ \XINT_div_II_c #1{1#2}{#3}%
}%
-\def\XINT_div_II_skipc 0000\XINT_div_II_c #1#2#3#4#5.#6#7%
+\def\XINT_div_II_skipc 00000000\XINT_div_II_c #1#2#3#4#5.#6#7%
{%
- \XINT_div_II_k #7{#4#5}{#6}{0000}%
+ \XINT_div_II_k #7{#4!#5}{#6}{00000000}%
}%
\def\XINT_div_II_c #1#2#3#4%
{%
- \expandafter\XINT_div_II_d\the\numexpr (#3#4+#2)/#1+\xint_c_ixixixix\relax
- {#1}{#2}#3#4%
+ \expandafter\XINT_div_II_d\the\numexpr\XINT_div_mini
+ #1.#2!#3!#4!{#1}{#2}#3!#4!%
}%
-\def\XINT_div_II_d 1#1#2#3#4#5#6#7.#8%
+\def\XINT_div_II_d 1#1#2#3#4#5!#6#7#8.#9%
{%
\expandafter\XINT_div_II_e
- \romannumeral0\expandafter\XINT_div_sub_xpxp\expandafter
- {\romannumeral0\xintreverseorder{#7}}%
- {\romannumeral0\XINT_mul_Mr {#1#2#3#4}#8\Z\Z\Z\Z }.%
- {#5}{#6}{#8}{#1#2#3#4}%
+ \romannumeral0\expandafter\XINT_div_sub\expandafter
+ {\romannumeral0\XINT_rev_nounsep {}#8\R!\R!\R!\R!\R!\R!\R!\R!\W}%
+ {\the\numexpr\XINT_div_smallmul_a 100000000.#1#2#3#4.#5!#91\Z!}%
+ .{#6}{#7}{#9}{#1#2#3#4#5}%
}%
-\def\XINT_div_II_e #1#2#3#4%
+\def\XINT_div_II_e 1#1!%
{%
- \xint_gob_til_zeros_iv #1#2#3#4\XINT_div_II_skipf 0000%
- \XINT_div_II_f #1#2#3#4%
+ \xint_gob_til_eightzeroes #1\XINT_div_II_skipf 00000000%
+ \XINT_div_II_f 1#1!%
}%
-\def\XINT_div_II_skipf 0000\XINT_div_II_f 0000#1.#2#3#4#5#6%
+\def\XINT_div_II_skipf 00000000\XINT_div_II_f 100000000!#1.#2#3#4#5#6%
{%
\XINT_div_II_k #6{#1}{#4}{#5}%
}%
-\def\XINT_div_II_f #1#2#3#4#5#6#7#8#9.%
+\def\XINT_div_II_f #1!#2!#3.%
{%
- \XINT_div_II_fa {#1#2#3#4#5#6#7#8}{#1#2#3#4#5#6#7#8#9}%
+ \XINT_div_II_fa {#1!#2!}{#1!#2!#3}%
}%
\def\XINT_div_II_fa #1#2#3#4%
{%
- \expandafter\XINT_div_II_g\expandafter
- {\the\numexpr (#1+#4)/#3-\xint_c_i}{#2}%
+ \expandafter\XINT_div_II_g \the\numexpr\XINT_div_mini #3.#4!#1{#2}%
}%
-\def\XINT_div_II_g #1#2#3#4%
+\def\XINT_div_II_g 1#1#2#3#4#5!#6#7#8%
{%
\expandafter \XINT_div_II_h
- \the\numexpr #4+#1+\xint_c_x^iv\expandafter\expandafter\expandafter
- {\expandafter\xint_gobble_iv
- \romannumeral0\expandafter\XINT_div_sub_xpxp\expandafter
- {\romannumeral0\xintreverseorder{#2}}%
- {\romannumeral0\XINT_mul_Mr {#1}#3\Z\Z\Z\Z }}{#3}%
+ \the\numexpr 1#1#2#3#4#5+#8\expandafter\expandafter\expandafter
+ .\expandafter\expandafter\expandafter
+ {\expandafter\xint_gob_til_exclam
+ \romannumeral0\expandafter\XINT_div_sub\expandafter
+ {\romannumeral0\XINT_rev_nounsep {}#6\R!\R!\R!\R!\R!\R!\R!\R!\W}%
+ {\the\numexpr\XINT_div_smallmul_a 100000000.#1#2#3#4.#5!#71\Z!}}%
+ {#7}%
}%
-\def\XINT_div_II_h 1#1#2#3#4#5#6#7%
+\def\XINT_div_II_h 1#1.#2#3#4%
{%
- \XINT_div_II_k #7{#5}{#6}{#1#2#3#4}%
+ \XINT_div_II_k #4{#2}{#3}{#1}%
}%
\def\XINT_div_II_k #1#2#3#4#5%
{%
- \expandafter\XINT_div_II_l \the\numexpr #4-\xint_c_iv.{#3}#1{#2}#5.%
+ \expandafter\XINT_div_II_l \the\numexpr #4-\xint_c_i.{#3}#1{#2}#5.%
}%
-\def\XINT_div_II_l #1.#2#3#4#5#6#7#8#9%
+\def\XINT_div_II_l #1.#2#3#4#51#6!%
{%
- \XINT_div_II_m {{#1}{#2}{{#3}{#4}}{#5}}{#5}{#6#7#8#9}#6#7#8#9%
+ \XINT_div_II_m {{#1}{#2}{{#3}{#4}}{#5}}{#5}{#6}1#6!%
}%
\def\XINT_div_II_m #1#2#3#4.#5#6%
{%
\XINT_div_I_a {#3}{#2}{#4}{#5}{#6}#1%
}%
-\def\XINT_div_little_b #1#2#3#4#5#6#7%
+\def\XINT_div_minimulwc_a 1#1.#2.#3!#4#5#6#7#8.%
{%
- \XINT_div_little_c #3.{{#4}{#6}}{#1}%
+ \expandafter\XINT_div_minimulwc_b
+ \the\numexpr \xint_c_x^ix+#1+#3*#8.#3*#4#5#6#7+#2*#8.#2*#4#5#6#7.%
}%
-\def\XINT_div_little_c #1#2#3#4#5.#6#7%
+\def\XINT_div_minimulwc_b 1#1#2#3#4#5#6.#7.%
{%
- \XINT_div_littleI_a {#1#2#3#4}#6{#7}{#5}%
+ \expandafter\XINT_div_minimulwc_c
+ \the\numexpr \xint_c_x^ix+#1#2#3#4#5+#7.#6.%
}%
-\def\XINT_div_littleI_a #1#2#3%
+\def\XINT_div_minimulwc_c 1#1#2#3#4#5#6.#7.#8.%
{%
- \expandafter\XINT_div_littleI_b
- \the\numexpr (#1+#2)/#3-\xint_c_i{#1}{#2}{#3}%
+ 1#6#7\expandafter!%
+ \the\numexpr\expandafter\XINT_div_smallmul_a
+ \the\numexpr \xint_c_x^viii+#1#2#3#4#5+#8.%
}%
-\def\XINT_div_littleI_b #1%
+\def\XINT_div_smallmul_a #1.#2.#3!1#4!%
{%
- \xint_gob_til_zero #1\XINT_div_littleI_skip 0\XINT_div_littleI_c #1%
+ \xint_gob_til_Z #4\XINT_div_smallmul_e\Z
+ \XINT_div_minimulwc_a #1.#2.#3!#4.#2.#3!%
}%
-\def\XINT_div_littleI_skip 0\XINT_div_littleI_c 0#1#2#3#4#5%
- {\XINT_div_littleII_a {#4}{#1}#5.{{#2}{#3}}{0000}}%
-\def\XINT_div_littleI_c #1#2#3#4%
+\def\XINT_div_smallmul_e\Z\XINT_div_minimulwc_a 1#1.#2\Z #3!{1\relax #1!}%
+\def\XINT_div_verysmallmul #1%
+ {\xint_gob_til_one #1\XINT_div_verysmallisone 1\XINT_div_verysmallmul_a 0.#1}%
+\def\XINT_div_verysmallisone 1\XINT_div_verysmallmul_a 0.1!1#11\Z!%
+ {1\relax #1100000000!}%
+\def\XINT_div_verysmallmul_a #1.#2!1#3!%
{%
- \expandafter\expandafter\expandafter\XINT_div_littleI_e
- \expandafter\expandafter\expandafter
- {\expandafter\xint_gobble_i\the\numexpr \xint_c_x^iv+#2-#1*#4}#1{{#3}{#4}}%
+ \xint_gob_til_Z #3\XINT_div_verysmallmul_e\Z
+ \expandafter\XINT_div_verysmallmul_b
+ \the\numexpr \xint_c_x^ix+#2*#3+#1.#2!%
}%
-\def\XINT_div_littleI_e #1#2#3#4#5%
- {\XINT_div_littleII_a {#4}{#1}#5.{#3}{000#2}}%
-\def\XINT_div_littleII_a #1%
+\def\XINT_div_verysmallmul_b 1#1#2.%
+ {1#2\expandafter!\the\numexpr\XINT_div_verysmallmul_a #1.}%
+\def\XINT_div_verysmallmul_e\Z #1\Z +#2#3!{1\relax 0000000#2!}%
+\def\XINT_div_sub #1#2%
{%
- \ifnum#1=\xint_c_iv
- \expandafter\XINT_div_littleIII_ab
- \else
- \expandafter\XINT_div_littleII_b
- \fi {#1}%
+ \expandafter\XINT_div_sub_clean
+ \the\numexpr\expandafter\XINT_div_sub_a\expandafter
+ 1#2\Z!\Z!\Z!\Z!\Z!\W #1\Z!\Z!\Z!\Z!\Z!\W
}%
-\def\XINT_div_littleIII_ab #1#2#3.#4%
+\def\XINT_div_sub_clean #1-#2#3\W
{%
- \expandafter\XINT_div_III_b\the\numexpr #2#3.%
+ \if1#2\expandafter\XINT_rev_nounsep\else\expandafter\XINT_div_sub_neg\fi
+ {}#1\R!\R!\R!\R!\R!\R!\R!\R!\W
}%
-\def\XINT_div_littleII_b #1%
+\def\XINT_div_sub_neg #1\W { -}%
+\def\XINT_div_sub_a #1!#2!#3!#4!#5\W #6!#7!#8!#9!%
{%
- \expandafter\XINT_div_littleII_c\expandafter {\the\numexpr #1-\xint_c_iv}%
+ \XINT_div_sub_b #1!#6!#2!#7!#3!#8!#4!#9!#5\W
}%
-\def\XINT_div_littleII_c #1#2#3#4#5#6#7.#8%
+\def\XINT_div_sub_b #1#2#3!#4!%
{%
- \XINT_div_littleII_d {#2#3#4#5#6}#8{#1}{#7}%
+ \xint_gob_til_Z #4\XINT_div_sub_bi \Z
+ \expandafter\XINT_div_sub_c\the\numexpr#1-#3+1#4-\xint_c_i.%
}%
-\def\XINT_div_littleII_d #1#2#3%
+\def\XINT_div_sub_c 1#1#2.%
{%
- \expandafter\XINT_div_littleII_e\the\numexpr (#1+#2)/#3+\xint_c_ixixixix.%
- {#1}{#2}{#3}%
+ 1#2\expandafter!\the\numexpr\XINT_div_sub_d #1%
}%
-\def\XINT_div_littleII_e 1#1.#2#3#4%
+\def\XINT_div_sub_d #1#2#3!#4!%
{%
- \expandafter\expandafter\expandafter\XINT_div_littleII_f
- \expandafter\xint_gobble_i\the\numexpr \xint_c_x^iv+#2-#1*#4.%
- {#1}{{#3}{#4}}%
+ \xint_gob_til_Z #4\XINT_div_sub_di \Z
+ \expandafter\XINT_div_sub_e\the\numexpr#1-#3+1#4-\xint_c_i.%
}%
-\def\XINT_div_littleII_f #1.#2#3#4#5#6%
+\def\XINT_div_sub_e 1#1#2.%
{%
- \XINT_div_littleII_a {#4}{#1}#5.{#3}{#6#2}%
+ 1#2\expandafter!\the\numexpr\XINT_div_sub_f #1%
}%
-\def\XINT_div_sub_xpxp #1#2% #1=alpha d\'ej\`a renvers\'e, #2 se d\'eveloppe en qB
+\def\XINT_div_sub_f #1#2#3!#4!%
{%
- \expandafter\XINT_div_sub_xpxp_b #2\W\X\Y\Z #1\W\X\Y\Z
+ \xint_gob_til_Z #4\XINT_div_sub_fi \Z
+ \expandafter\XINT_div_sub_g\the\numexpr#1-#3+1#4-\xint_c_i.%
}%
-\def\XINT_div_sub_xpxp_b
+\def\XINT_div_sub_g 1#1#2.%
{%
- \XINT_div_sub_A 1{}%
+ 1#2\expandafter!\the\numexpr\XINT_div_sub_h #1%
}%
-\def\XINT_div_sub_A #1#2#3#4#5#6%
+\def\XINT_div_sub_h #1#2#3!#4!%
{%
- \xint_gob_til_W #3\xint_div_sub_az\W
- \XINT_div_sub_B #1{#3#4#5#6}{#2}%
+ \xint_gob_til_Z #4\XINT_div_sub_hi \Z
+ \expandafter\XINT_div_sub_i\the\numexpr#1-#3+1#4-\xint_c_i.%
}%
-\def\XINT_div_sub_B #1#2#3#4\W\X\Y\Z #5#6#7#8%
+\def\XINT_div_sub_i 1#1#2.%
{%
- \xint_gob_til_W #5\xint_div_sub_bz\W
- \XINT_div_sub_onestep #1#2{#8#7#6#5}{#3}#4\W\X\Y\Z
+ 1#2\expandafter!\the\numexpr\XINT_div_sub_a #1%
}%
-\def\XINT_div_sub_onestep #1#2#3#4#5#6%
+\def\XINT_div_sub_bi\Z
+ \expandafter\XINT_div_sub_c\the\numexpr#1-#2+#3.#4!#5!#6!#7!#8!#9!\Z !\W
{%
- \expandafter\XINT_div_sub_backtoA
- \the\numexpr 11#6-#5#4#3#2+#1-\xint_c_i.%
+ \XINT_div_sub_l #1#2!#5!#7!#9!%
}%
-\def\XINT_div_sub_backtoA #1#2#3.#4%
+\def\XINT_div_sub_di\Z
+ \expandafter\XINT_div_sub_e\the\numexpr#1-#2+#3.#4!#5!#6!#7!#8\W
{%
- \XINT_div_sub_A #2{#3#4}%
+ \XINT_div_sub_l #1#2!#5!#7!%
}%
-\def\xint_div_sub_bz\W\XINT_div_sub_onestep #1\Z { -}%
-\def\xint_div_sub_az\W\XINT_div_sub_B #1#2{\XINT_div_sub_C #1}%
-\def\XINT_div_sub_C #1#2#3#4#5#6%
+\def\XINT_div_sub_fi\Z
+ \expandafter\XINT_div_sub_g\the\numexpr#1-#2+#3.#4!#5!#6\W
{%
- \xint_gob_til_W #3\xint_div_sub_cz\W
- \XINT_div_sub_C_onestep #1{#6#5#4#3}{#2}%
+ \XINT_div_sub_l #1#2!#5!%
}%
-\def\XINT_div_sub_C_onestep #1#2%
+\def\XINT_div_sub_hi\Z
+ \expandafter\XINT_div_sub_i\the\numexpr#1-#2+#3.#4\W
{%
- \expandafter\XINT_div_sub_backtoC \the\numexpr 11#2+#1-\xint_c_i.%
+ \XINT_div_sub_l #1#2!%
}%
-\def\XINT_div_sub_backtoC #1#2#3.#4%
+\def\XINT_div_sub_l #1%
{%
- \XINT_div_sub_C #2{#3#4}%
+ \xint_UDzerofork
+ #1{-2\relax}%
+ 0\XINT_div_sub_r
+ \krof
}%
-\def\xint_div_sub_cz\W\XINT_div_sub_C_onestep #1#2%
+\def\XINT_div_sub_r #1!%
{%
- \if#10% retenue
- \expandafter\xint_div_sub_neg
- \else\expandafter\xint_div_sub_ok
- \fi
+ -\ifnum 0#1=\xint_c_ 1\else2\fi\relax
+}%
+%%%%%%%%%%%%
+\def\XINT_sdiv_out #1\Z #2\W%
+ {\expandafter
+ {\romannumeral0\XINT_unsep_cuzsmall#11\R!1\R!1\R!1\R!1\R!1\R!1\R!1\R!\W}%
+ {#2}}%
+\def\XINT_smalldivx_a #1.1#2!1#3!%
+{%
+ \expandafter\XINT_smalldivx_b
+ \the\numexpr (#3+#1)/#2-\xint_c_i!#1.#2!#3!%
+}%
+\def\XINT_smalldivx_b #1!%
+{%
+ \if0#1\else
+ \xint_c_x^viii+#1\xint_afterfi{\expandafter!\the\numexpr}\fi
+ \XINT_smalldiv_c #1!%
+}%
+\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!%
+{%
+ \xint_gob_til_Z #4\XINT_smalldiv_end \Z
+ \XINT_smalldiv_e #1!#2!#3#4!%
+}%
+\def\XINT_smalldiv_end\Z\XINT_smalldiv_e #1!#2!1\Z!{1!\Z #1\W }%
+\def\XINT_smalldiv_e #1!#2.#3!%
+{%
+ \expandafter\XINT_smalldiv_f\the\numexpr
+ \xint_c_xi_e_viii_mone+#1*\xint_c_x^viii/#3!#2.#3!#1!%
+}%
+\def\XINT_smalldiv_f 1#1#2#3#4#5#6!#7.#8!%
+{%
+ \xint_gob_til_zero #1\XINT_smalldiv_fz 0%
+ \expandafter\XINT_smalldiv_g
+ \the\numexpr\XINT_minimul_a #2#3#4#5.#6!#8!#2#3#4#5#6!#7.#8!%
+}%
+\def\XINT_smalldiv_fz 0%
+ \expandafter\XINT_smalldiv_g\the\numexpr\XINT_minimul_a
+ 9999.9999!#1!99999999!#2!0!1#3!%
+{%
+ \XINT_smalldiv_i .#3!\xint_c_!#2!%
+}%
+\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!%
+}%
+\def\XINT_smalldiv_h 1#1#2.#3!#4!%
+{%
+ \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!%
+}%
+\def\XINT_smalldiv_j #1!#2!%
+{%
+ \xint_c_x^viii+#1+#2\expandafter!\the\numexpr\XINT_smalldiv_k
+ #1!%
+}%
+\def\XINT_smalldiv_k #1!#2!#3.#4!%
+{%
+ \expandafter\XINT_smalldiv_d\the\numexpr #2-#1*#4!#3.#4!%
+}%
+%%%%%%%%%%%%
+\def\XINT_div_mini #1.#2!1#3!%
+{%
+ \expandafter\XINT_div_mini_a\the\numexpr
+ \xint_c_xi_e_viii_mone+#3*\xint_c_x^viii/#1!#1.#2!#3!%
+}%
+\def\XINT_div_mini_a 1#1#2#3#4#5#6!#7.#8!%
+{%
+ \xint_gob_til_zero #1\XINT_div_mini_w 0%
+ \expandafter\XINT_div_mini_b
+ \the\numexpr\XINT_minimul_a #2#3#4#5.#6!#7!#2#3#4#5#6!#7.#8!%
+}%
+\def\XINT_div_mini_w 0%
+ \expandafter\XINT_div_mini_b\the\numexpr\XINT_minimul_a
+ 9999.9999!#1!99999999!#2.#3!00000000!#4!%
+{%
+ \xint_c_x^viii_mone+(#4+#3)/#2!%
+}%
+\def\XINT_div_mini_b 1#1!1#2!#3!#4!#5!#6!%
+{%
+ \expandafter\XINT_div_mini_c
+ \the\numexpr 1#6-#1.#2!#5!#3!#4!%
+}%
+\def\XINT_div_mini_c 1#1#2.#3!#4!%
+{%
+ \expandafter\XINT_div_mini_d
+ \the\numexpr #4-#3+#1-\xint_c_i.#2!%
+}%
+\def\XINT_div_mini_d #1.#2!#3!#4.#5!%
+{%
+ \xint_c_x^viii_mone+#3+(#1#2+#5)/#4!%
}%
-\def\xint_div_sub_neg #1{ -}%
-\def\xint_div_sub_ok #1{ #1}%
\def\xintiDivRound {\romannumeral0\xintidivround }%
-\def\xintidivround #1{\expandafter\XINT_iidivround\romannumeral0\xintnum{#1}\Z }%
+\def\xintidivround #1%
+ {\expandafter\XINT_idivround\romannumeral0\xintnum{#1}\Z }%
\def\xintiiDivRound {\romannumeral0\xintiidivround }%
\def\xintiidivround #1{\expandafter\XINT_iidivround \romannumeral-`0#1\Z }%
-\def\XINT_iidivround #1#2\Z #3{\expandafter\XINT_iidivround_a\expandafter #1%
- \romannumeral-`0#3\Z #2\Z }%
+\def\XINT_idivround #1#2\Z #3%
+ {\expandafter\XINT_iidivround_a\expandafter #1%
+ \romannumeral0\xintnum{#3}\Z #2\Z }%
+\def\XINT_iidivround #1#2\Z #3%
+ {\expandafter\XINT_iidivround_a\expandafter #1\romannumeral-`0#3\Z #2\Z }%
\def\XINT_iidivround_a #1#2% #1 de A, #2 de B.
{%
\if0#2\xint_dothis\XINT_iidivround_divbyzero\fi
@@ -2180,19 +2023,50 @@
-{\xintiiopp\XINT_iidivround_pos #1}%
\krof
}%
-\def\XINT_iidivround_pos #1#2\Z #3\Z{\expandafter\XINT_iidivround_pos_a
- \romannumeral0\XINT_div_prepare {#2}{#1#30}}%
-\def\XINT_iidivround_pos_a #1#2{\xintReverseOrder {#1\XINT_iidivround_pos_b}\Z }%
-\def\XINT_iidivround_pos_b #1#2{\xint_gob_til_Z #2\XINT_iidivround_pos_small\Z
- \XINT_iidivround_pos_c #1#2}%
-\def\XINT_iidivround_pos_c #1#2\Z {\ifnum #1>\xint_c_iv
- \expandafter\XINT_iidivround_pos_up
- \else \expandafter\xintreverseorder
- \fi {#2}}%
-\def\XINT_iidivround_pos_up #1{\xintinc {\xintReverseOrder{#1}}}%
-\def\XINT_iidivround_pos_small\Z\XINT_iidivround_pos_c #1#2%
- {\ifnum #1>\xint_c_iv\expandafter\xint_secondoftwo\else\expandafter
- \xint_firstoftwo\fi { 0}{ 1}}%
+\def\XINT_iidivround_pos #1#2\Z #3\Z
+{%
+ \expandafter\XINT_iidivround_pos_a
+ \romannumeral0\XINT_div_prepare {#2}{#1#30}%
+}%
+\def\XINT_iidivround_pos_a #1#2%
+{%
+ \expandafter\XINT_iidivround_pos_b
+ \romannumeral0\expandafter\XINT_sepandrev
+ \romannumeral0\XINT_zeroes_forviii #1\R\R\R\R\R\R\R\R{10}0000001\W
+ #1\XINT_rsepbyviii_end_A 2345678\XINT_rsepbyviii_end_B 2345678\relax XX%
+ \R.\R.\R.\R.\R.\R.\R.\R.\W
+ \Z!\Z!\Z!\Z!\Z!\W
+}%
+\def\XINT_iidivround_pos_b 1#1#2#3#4#5#6#7#8!#9%
+{%
+ \xint_gob_til_Z #9\XINT_iidivround_small\Z
+ \ifnum #8>\xint_c_iv
+ \expandafter\XINT_iidivround_pos_up
+ \else \expandafter\XINT_iidivround_pos_finish
+ \fi
+ 1#1#2#3#4#5#6#70!#9%
+}%
+\def\XINT_iidivround_pos_up
+{%
+ \expandafter\XINT_iidivround_pos_finish
+ \the\numexpr\XINT_add_a\xint_c_ii 100000010!\Z!\Z!\Z!\Z!\Z!\W
+}%
+\def\XINT_iidivround_pos_finish #10!#2\Z #3\W
+{%
+ \expandafter\XINT_cuz_small\romannumeral0\XINT_unrevbyviii {}%
+ #1!#21\Z!1\R!1\R!1\R!1\R!1\R!1\R!1\R!1\R!\W
+}%
+\def\XINT_iidivround_small\Z\ifnum #1>#2\fi 1#30!#4\W
+{%
+ \ifnum #1>\xint_c_iv
+ \expandafter\XINT_iidivround_small_up
+ \else \expandafter\XINT_iidivround_small_trunc
+ \fi {#3}%
+}%
+\edef\XINT_iidivround_small_up #1%
+ {\noexpand\expandafter\space\noexpand\the\numexpr #1+\xint_c_i\relax }%
+\edef\XINT_iidivround_small_trunc #1%
+ {\noexpand\expandafter\space\noexpand\the\numexpr #1\relax }%
\def\xintiDivTrunc {\romannumeral0\xintidivtrunc }%
\def\xintidivtrunc #1{\expandafter\XINT_iidivtrunc\romannumeral0\xintnum{#1}\Z }%
\def\xintiiDivTrunc {\romannumeral0\xintiidivtrunc }%
@@ -2221,7 +2095,8 @@
\krof
}%
\def\XINT_iidivtrunc_pos #1#2\Z #3\Z%
- {\expandafter\xint_firstoftwo_thenstop\romannumeral0\XINT_div_prepare {#2}{#1#3}}%
+ {\expandafter\xint_firstoftwo_thenstop
+ \romannumeral0\XINT_div_prepare {#2}{#1#3}}%
\def\xintiMod {\romannumeral0\xintimod }%
\def\xintimod #1{\expandafter\XINT_iimod\romannumeral0\xintnum{#1}\Z }%
\def\xintiiMod {\romannumeral0\xintiimod }%
@@ -2250,7 +2125,16 @@
\krof
}%
\def\XINT_iimod_pos #1#2\Z #3\Z%
- {\expandafter\xint_secondoftwo_thenstop\romannumeral0\XINT_div_prepare {#2}{#1#3}}%
+ {\expandafter\xint_secondoftwo_thenstop\romannumeral0\XINT_div_prepare
+ {#2}{#1#3}}%
+\catcode`! 11
+\def\xintAbs {\Did_you_mean_iiAbs?or_load_xintfrac!}%
+\def\xintOpp {\Did_you_mean_iiOpp?or_load_xintfrac!}%
+\def\xintAdd {\Did_you_mean_iiAdd?or_load_xintfrac!}%
+\def\xintSub {\Did_you_mean_iiSub?or_load_xintfrac!}%
+\def\xintMul {\Did_you_mean_iiMul?or_load_xintfrac!}%
+\def\xintPow {\Did_you_mean_iiPow?or_load_xintfrac!}%
+\def\xintSqr {\Did_you_mean_iiSqr?or_load_xintfrac!}%
\XINT_restorecatcodes_endinput%
\endinput
%%
diff --git a/Master/texmf-dist/tex/generic/xint/xintexpr.sty b/Master/texmf-dist/tex/generic/xint/xintexpr.sty
index a7bc350cadd..72e5194b49e 100644
--- a/Master/texmf-dist/tex/generic/xint/xintexpr.sty
+++ b/Master/texmf-dist/tex/generic/xint/xintexpr.sty
@@ -21,7 +21,7 @@
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%% ---------------------------------------------------------------
-%% The xint bundle v1.1c 2015/09/12
+%% The xint bundle v1.2 2015/10/10
%% Copyright (C) 2013-2015 by Jean-Francois Burnol
%% xintexpr: Expandable expression parser
%% ---------------------------------------------------------------
@@ -81,13 +81,24 @@
\XINTsetupcatcodes%
\XINT_providespackage
\ProvidesPackage{xintexpr}%
- [2015/09/12 v1.1c Expandable expression parser (jfB)]%
-\def\xint_gob_til_! #1!{}% this ! has catcode 11
-\edef\XINT_expr_lockscan#1!{\noexpand\expandafter\space\noexpand\csname .=#1\endcsname }%
-\edef\XINT_expr_lockit #1{\noexpand\expandafter\space\noexpand\csname .=#1\endcsname }%
-\def\XINT_expr_inintpart #1!{\XINT_num{#1}}%
-\def\XINT_expr_infracpart #1e#2!{#1![\the\numexpr#2-\xintLength{#1}]!}%
-\def\XINT_expr_inexppart e#1!{![\the\numexpr #1]!}%
+ [2015/10/10 v1.2 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
+ {\noexpand\expandafter\space\noexpand\csname .=#1\endcsname }%
+\edef\XINT_expr_lockit
+ #1{\noexpand\expandafter\space\noexpand\csname .=#1\endcsname }%
+\def\XINT_expr_unlock_hex_in #1% expanded inside \csname..\endcsname
+ {\expandafter\XINT_expr_inhex\romannumeral-`0\XINT_expr_unlock#1;}%
+\def\XINT_expr_inhex #1.#2#3;% expanded inside \csname..\endcsname
+{%
+ \if#2>\xintHexToDec{#1}%
+ \else
+ \xintiiMul{\xintiiPow{625}{\xintLength{#3}}}{\xintHexToDec{#1#3}}%
+ [\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 }%
@@ -253,14 +264,18 @@
\def\XINT_expr_subexpr !#1\fi !{\expandafter\XINT_expr_getop\xint_gobble_iii }%
\def\XINT_expr_countetc #1%
{%
- \ifx\count#1\else\ifx#1\dimen\else\ifx#1\numexpr\else\ifx#1\dimexpr\else
- \ifx\skip#1\else\ifx\glueexpr#1\else\ifx\fontdimen#1\else
+ \ifx\count#1\else\ifx\dimen#1\else\ifx\numexpr#1\else\ifx\dimexpr#1\else
+ \ifx\skip#1\else\ifx\glueexpr#1\else\ifx\fontdimen#1\else\ifx\ht#1\else
+ \ifx\dp#1\else\ifx\wd#1\else\ifx\fontcharht#1\else\ifx\fontcharwd#1\else
+ \ifx\fontchardp#1\else\ifx\fontcharic#1\else
\XINT_expr_unpackvar
- \fi\fi\fi\fi\fi\fi\fi
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
\expandafter\XINT_expr_getnext\number #1%
}%
-\def\XINT_expr_unpackvar\fi\fi\fi\fi\fi\fi\fi\expandafter\XINT_expr_getnext\number #1%
- {\fi\fi\fi\fi\fi\fi\fi\expandafter\XINT_expr_getop\csname .=\number#1\endcsname }%
+\def\XINT_expr_unpackvar\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
+ \expandafter\XINT_expr_getnext\number #1%
+ {\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
+ \expandafter\XINT_expr_getop\csname .=\number#1\endcsname }%
\begingroup
\lccode`*=`#
\lowercase{\endgroup
@@ -268,7 +283,7 @@
\if#1*\xint_dothis {\XINT_expr_scan_macropar *}\fi
\if#1[\xint_dothis {\xint_c_xviii ({}}\fi
\if#1+\xint_dothis \XINT_expr_getnext \fi
- \if#1.\xint_dothis {\XINT_expr_scandec_II\XINT_expr_infracpart}\fi
+ \if#1.\xint_dothis {\XINT_expr_startdec}\fi
\if#1-\xint_dothis -\fi
\if#1(\xint_dothis {\xint_c_xviii ({}}\fi
\xint_orthat {\XINT_expr_scan_nbr_or_func #1}%
@@ -279,135 +294,161 @@
{%
\if "#1\xint_dothis \XINT_expr_scanhex_I\fi
\if `#1\xint_dothis {\XINT_expr_onlitteral_`}\fi
- \ifnum \xint_c_ix<1#1 \xint_dothis \XINT_expr_scandec_I\fi
+ \ifnum \xint_c_ix<1#1 \xint_dothis \XINT_expr_startint\fi
\xint_orthat \XINT_expr_scanfunc #1%
}%
\catcode96 12 % `
-\def\XINT_expr_scandec_I
+\def\XINT_expr_startint #1%
{%
- \expandafter\XINT_expr_getop\romannumeral-`0\expandafter
- \XINT_expr_lockscan\romannumeral0\expandafter\XINT_expr_inintpart
- \romannumeral-`0\XINT_expr_scanintpart_b
+ \if #10\expandafter\XINT_expr_gobz_a\else\XINT_expr_scanint_a\fi #1%
}%
-\def\XINT_expr_scandec_II
+\def\XINT_expr_scanint_a #1#2%
+ {\expandafter\XINT_expr_getop\csname.=#1%
+ \expandafter\XINT_expr_scanint_b\romannumeral-`0#2}%
+\def\XINT_expr_gobz_a #1%
+ {\expandafter\XINT_expr_getop\csname.=%
+ \expandafter\XINT_expr_gobz_scanint_b\romannumeral-`0#1}%
+\def\XINT_expr_startdec #1%
+ {\expandafter\XINT_expr_getop\csname.=%
+ \expandafter\XINT_expr_scandec_a\romannumeral-`0#1}%
+\def\XINT_expr_scanint_b #1%
{%
- \expandafter\XINT_expr_getop\romannumeral-`0\expandafter
- \XINT_expr_lockscan\romannumeral0\expandafter\XINT_expr_inintpart
- \romannumeral-`0\XINT_expr_scanfracpart_b
+ \ifcat \relax #1\expandafter\XINT_expr_scanint_endbycs\expandafter #1\fi
+ \ifnum\xint_c_ix<1\string#1 \else\expandafter\XINT_expr_scanint_c\fi
+ \string#1\XINT_expr_scanint_d
}%
-\def\XINT_expr_scanintpart_a #1%
-{% careful that ! has catcode letter here
- \ifcat \relax #1\xint_dothis{!!#1}\fi % stops the scan
- \if e#1\xint_dothis{\expandafter\XINT_expr_inexppart
- \romannumeral-`0\XINT_expr_scanexppart_a e}\fi
- \if E#1\xint_dothis{\expandafter\XINT_expr_inexppart
- \romannumeral-`0\XINT_expr_scanexppart_a e}\fi
- \ifcat a#1\xint_dothis{!!*#1}\fi % includes subexpressions (#1=! letter)
- \xint_orthat {\expandafter\XINT_expr_scanintpart_aa\string #1}%
+\def\XINT_expr_scanint_d #1%
+{%
+ \expandafter\XINT_expr_scanint_b\romannumeral-`0#1%
}%
-\def\XINT_expr_scanintpart_aa #1%
+\def\XINT_expr_scanint_endbycs#1#2\XINT_expr_scanint_d{\endcsname #1}%
+\def\XINT_expr_scanint_c\string #1\XINT_expr_scanint_d
{%
- \if .#1\xint_dothis\XINT_expr_scandec_transition\fi
- \ifnum \xint_c_ix<1#1 \xint_dothis\XINT_expr_scanintpart_b\fi
- \xint_orthat {!!}#1%
+ \if e#1\xint_dothis{[\the\numexpr0\XINT_expr_scanexp_a +}\fi
+ \if E#1\xint_dothis{[\the\numexpr0\XINT_expr_scanexp_a +}\fi
+ \ifcat a#1\xint_dothis{\endcsname*#1}\fi
+ \if .#1\xint_dothis{\XINT_expr_startdec_a .}\fi
+ \xint_orthat {\expandafter\endcsname \string#1}%
}%
-\def\XINT_expr_scanintpart_b #1#2%
+\def\XINT_expr_startdec_a .#1%
{%
- \expandafter #1\romannumeral-`0\expandafter
- \XINT_expr_scanintpart_a\romannumeral-`0#2%
+ \expandafter\XINT_expr_scandec_a\romannumeral-`0#1%
}%
-\def\XINT_expr_scandec_transition .#1%
+\def\XINT_expr_scandec_a #1%
{%
- \expandafter\XINT_expr_scandec_trans_a\romannumeral-`0#1%
+ \if .#1\xint_dothis{\endcsname..}\fi
+ \xint_orthat {\XINT_expr_scandec_b 0.#1}%
}%
-\def\XINT_expr_scandec_trans_a #1%
+\def\XINT_expr_gobz_scanint_b #1%
{%
- \if .#1\xint_dothis{!!..}\fi
- \xint_orthat {\expandafter\XINT_expr_infracpart
- \romannumeral-`0\XINT_expr_scanfracpart_a #1}%
+ \ifcat \relax #1\expandafter\XINT_expr_gobz_scanint_endbycs\expandafter #1\fi
+ \ifnum\xint_c_x<1\string#1 \else\expandafter\XINT_expr_gobz_scanint_c\fi
+ \string#1\XINT_expr_scanint_d
}%
-\def\XINT_expr_scanfracpart_a #1%
+\def\XINT_expr_gobz_scanint_endbycs#1#2\XINT_expr_scanint_d{0\endcsname #1}%
+\def\XINT_expr_gobz_scanint_c\string #1\XINT_expr_scanint_d
{%
- \ifcat \relax #1\xint_dothis{e!#1}\fi % stops the scan
- \if e#1\xint_dothis{\XINT_expr_scanexppart_a e}\fi
- \if E#1\xint_dothis{\XINT_expr_scanexppart_a e}\fi
- \ifcat a#1\xint_dothis{e!*#1}\fi % and also the case of subexpressions (!)
- \xint_orthat {\expandafter\XINT_expr_scanfracpart_aa\string #1}%
+ \if e#1\xint_dothis{0[\the\numexpr0\XINT_expr_scanexp_a +}\fi
+ \if E#1\xint_dothis{0[\the\numexpr0\XINT_expr_scanexp_a +}\fi
+ \ifcat a#1\xint_dothis{0\endcsname*#1}\fi
+ \if .#1\xint_dothis{\XINT_expr_gobz_startdec_a .}\fi
+ \if 0#1\xint_dothis\XINT_expr_gobz_scanint_d\fi
+ \xint_orthat {0\expandafter\endcsname \string#1}%
}%
-\def\XINT_expr_scanfracpart_aa #1%
+\def\XINT_expr_gobz_scanint_d #1%
{%
- \ifnum \xint_c_ix<1#1
- \expandafter\XINT_expr_scanfracpart_b
- \else
- \xint_afterfi {e!}%
- \fi
- #1%
+ \expandafter\XINT_expr_gobz_scanint_b\romannumeral-`0#1%
}%
-\def\XINT_expr_scanfracpart_b #1#2%
+\def\XINT_expr_gobz_startdec_a .#1%
{%
- \expandafter #1\romannumeral-`0\expandafter
- \XINT_expr_scanfracpart_a\romannumeral-`0#2%
+ \expandafter\XINT_expr_gobz_scandec_a\romannumeral-`0#1%
}%
-\def\XINT_expr_scanexppart_a #1#2%
+\def\XINT_expr_gobz_scandec_a #1%
{%
- \expandafter #1\romannumeral-`0\expandafter
- \XINT_expr_scanexppart_b\romannumeral-`0#2%
+ \if .#1\xint_dothis{0\endcsname..}\fi
+ \xint_orthat {\XINT_expr_gobz_scandec_b 0.#1}%
}%
-\def\XINT_expr_scanexppart_b #1%
+\def\XINT_expr_scandec_b #1.#2%
{%
- \ifcat \relax #1\xint_dothis{0!#1}\fi % stops the scan (incorrect syntax)
- \ifcat a#1\xint_dothis{0!*#1}\fi % idem
- \if +#1\xint_dothis {\XINT_expr_scanexppart_a +}\fi
- \if -#1\xint_dothis {\XINT_expr_scanexppart_a -}\fi
- \xint_orthat {\expandafter\XINT_expr_scanexppart_c\string #1}%
+ \ifcat \relax #2\expandafter\XINT_expr_scandec_endbycs\expandafter#2\fi
+ \ifnum\xint_c_ix<1\string#2 \else\expandafter\XINT_expr_scandec_c\fi
+ \string#2\expandafter\XINT_expr_scandec_d\the\numexpr #1-\xint_c_i.%
}%
-\def\XINT_expr_scanexppart_c #1%
+\def\XINT_expr_scandec_endbycs #1#2\XINT_expr_scandec_d
+ \the\numexpr#3-\xint_c_i.{[#3]\endcsname #1}%
+\def\XINT_expr_scandec_d #1.#2%
{%
- \ifnum \xint_c_ix<1#1
- \expandafter\XINT_expr_scanexppart_d
- \else
- \expandafter !%
- \fi
- #1%
+ \expandafter\XINT_expr_scandec_b
+ \the\numexpr #1\expandafter.\romannumeral-`0#2%
}%
-\def\XINT_expr_scanexppart_d #1#2%
+\def\XINT_expr_scandec_c\string #1#2\the\numexpr#3-\xint_c_i.%
{%
- \expandafter #1\romannumeral-`0\expandafter
- \XINT_expr_scanexppart_e\romannumeral-`0#2%
+ \if e#1\xint_dothis{[\the\numexpr#3\XINT_expr_scanexp_a +}\fi
+ \if E#1\xint_dothis{[\the\numexpr#3\XINT_expr_scanexp_a +}\fi
+ \ifcat a#1\xint_dothis{[#3]\endcsname *#1}\fi
+ \xint_orthat {[#3]\expandafter\endcsname \string#1}%
}%
-\def\XINT_expr_scanexppart_e #1%
+\def\XINT_expr_gobz_scandec_b 0.#1%
{%
- \ifcat \relax #1\xint_dothis{!#1}\fi % stops the scan
- \ifcat a#1\xint_dothis{!*#1}\fi % idem
- \xint_orthat {\expandafter\XINT_expr_scanexppart_f\string #1}%
+ \ifcat \relax #1\expandafter\XINT_expr_gobz_scandec_endbycs\expandafter#1\fi
+ \ifnum\xint_c_ix<1\string#1 \else\expandafter\XINT_expr_gobz_scandec_c\fi
+ \string#1\expandafter\XINT_expr_scandec_d\the\numexpr\xint_c_mone.%
}%
-\def\XINT_expr_scanexppart_f #1%
+\def\XINT_expr_gobz_scandec_endbycs #1#2\xint_c_mone.{0[0]\endcsname #1}%
+\def\XINT_expr_gobz_scandec_c\string #1#2\xint_c_mone.%
{%
- \ifnum \xint_c_ix<1#1
- \expandafter\XINT_expr_scanexppart_d
- \else
- \expandafter !%
- \fi
- #1%
+ \if e#1\xint_dothis{0[\the\numexpr0\XINT_expr_scanexp_a +}\fi
+ \if E#1\xint_dothis{0[\the\numexpr0\XINT_expr_scanexp_a +}\fi
+ \ifcat a#1\xint_dothis{0[0]\endcsname *#1}\fi
+ \xint_orthat {0[0]\expandafter\endcsname \string#1}%
}%
-\def\XINT_expr_scanhex_I #1%
+\def\XINT_expr_scanexp_a #1#2%
{%
- \expandafter\XINT_expr_getop\romannumeral-`0\expandafter
- \XINT_expr_lockscan\expandafter\XINT_expr_inhex
- \romannumeral-`0\XINT_expr_scanhexI_a
+ #1\expandafter\XINT_expr_scanexp_b\romannumeral-`0#2%
}%
-\def\XINT_expr_inhex #1.#2#3;% expanded inside \csname..\endcsname
+\def\XINT_expr_scanexp_b #1%
{%
- \if#2I\xintHexToDec{#1}%
- \else
- \xintiiMul{\xintiiPow{625}{\xintLength{#3}}}{\xintHexToDec{#1#3}}%
- [\the\numexpr-4*\xintLength{#3}]%
- \fi
+ \ifcat \relax #1\expandafter\XINT_expr_scanexp_endbycs\expandafter #1\fi
+ \ifnum\xint_c_ix<1\string#1 \else\expandafter\XINT_expr_scanexp_c\fi
+ \string#1\XINT_expr_scanexp_d
+}%
+\def\XINT_expr_scanexpr_endbycs#1#2\XINT_expr_scanexp_d {]\endcsname #1}%
+\def\XINT_expr_scanexp_d #1%
+{%
+ \expandafter\XINT_expr_scanexp_bb\romannumeral-`0#1%
+}%
+\def\XINT_expr_scanexp_c\string #1\XINT_expr_scanexp_d
+{%
+ \ifcat a#1\xint_dothis {]\endcsname *#1}\fi
+ \if +#1\xint_dothis {\XINT_expr_scanexp_a +}\fi
+ \if -#1\xint_dothis {\XINT_expr_scanexp_a -}\fi
+ \xint_orthat {]\expandafter\endcsname\string #1}%
+}%
+\def\XINT_expr_scanexp_bb #1%
+{%
+ \ifcat \relax #1\expandafter\XINT_expr_scanexp_endbycs_b\expandafter #1\fi
+ \ifnum\xint_c_ix<1\string#1 \else\expandafter\XINT_expr_scanexp_cb\fi
+ \string#1\XINT_expr_scanexp_db
+}%
+\def\XINT_expr_scanexp_endbycs_b#1#2\XINT_expr_scanexp_db {]\endcsname #1}%
+\def\XINT_expr_scanexp_db #1%
+{%
+ \expandafter\XINT_expr_scanexp_bb\romannumeral-`0#1%
+}%
+\def\XINT_expr_scanexp_cb\string #1\XINT_expr_scanexp_db
+{%
+ \ifcat a#1\xint_dothis {]\endcsname *#1}\fi
+ \xint_orthat {]\expandafter\endcsname\string #1}%
+}%
+\def\XINT_expr_scanhex_I #1% #1="
+{%
+ \expandafter\XINT_expr_getop\csname.=\expandafter
+ \XINT_expr_unlock_hex_in\csname.=\XINT_expr_scanhexI_a
}%
\def\XINT_expr_scanhexI_a #1%
{%
- \ifcat #1\relax\xint_dothis{.I;!#1}\fi
- \ifx !#1\xint_dothis{.I;!*!}\fi % tacit multiplication
+ \ifcat #1\relax\xint_dothis{.>\endcsname\endcsname #1}\fi
+ \ifx !#1\xint_dothis{.>\endcsname\endcsname*!}\fi % tacit multiplication
\xint_orthat {\expandafter\XINT_expr_scanhexI_aa\string #1}%
}%
\def\XINT_expr_scanhexI_aa #1%
@@ -425,24 +466,23 @@
\expandafter\xint_secondoftwo
\fi
{\expandafter\XINT_expr_scanhex_transition}%
- {\xint_afterfi {.I;!}}%
+ {\xint_afterfi {.>\endcsname\endcsname}}%
\fi
#1%
}%
\def\XINT_expr_scanhexI_b #1#2%
{%
- \expandafter #1\romannumeral-`0\expandafter
- \XINT_expr_scanhexI_a\romannumeral-`0#2%
+ #1\expandafter\XINT_expr_scanhexI_a\romannumeral-`0#2%
}%
\def\XINT_expr_scanhex_transition .#1%
{%
- \expandafter.\expandafter.\romannumeral-`0\expandafter
+ \expandafter.\expandafter.\expandafter
\XINT_expr_scanhexII_a\romannumeral-`0#1%
}%
\def\XINT_expr_scanhexII_a #1%
{%
- \ifcat #1\relax\xint_dothis{;!#1}\fi
- \ifx !#1\xint_dothis{;!*!}\fi % tacit multiplication
+ \ifcat #1\relax\xint_dothis{\endcsname\endcsname#1}\fi
+ \ifx !#1\xint_dothis{\endcsname\endcsname*!}\fi % tacit multiplication
\xint_orthat {\expandafter\XINT_expr_scanhexII_aa\string #1}%
}%
\def\XINT_expr_scanhexII_aa #1%
@@ -454,14 +494,13 @@
0\else1\fi\else0\fi\else1\fi\else0\fi 1%
\expandafter\XINT_expr_scanhexII_b
\else
- \xint_afterfi {;!}%
+ \xint_afterfi {\endcsname\endcsname}%
\fi
#1%
}%
\def\XINT_expr_scanhexII_b #1#2%
{%
- \expandafter #1\romannumeral-`0\expandafter
- \XINT_expr_scanhexII_a\romannumeral-`0#2%
+ #1\expandafter\XINT_expr_scanhexII_a\romannumeral-`0#2%
}%
\def\XINT_expr_scanfunc
{%
@@ -1221,9 +1260,10 @@
\let\XINT_expr_precedence_! \xint_c_x
\def\XINT_expr_op_! #1{\expandafter\XINT_expr_getop
\csname .=\xintFac{\XINT_expr_unlock #1}\endcsname }%
-\let\XINT_flexpr_op_!\XINT_expr_op_!
+\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
- \csname .=\xintiFac{\XINT_expr_unlock #1}\endcsname }%
+ \csname .=\xintiiFac{\XINT_expr_unlock #1}\endcsname }%
\catcode`[ 11
\catcode`* 11
\let\XINT_expr_precedence_[ \xint_c_vii
@@ -1346,11 +1386,18 @@
{\expandafter\XINT_expr_getop\csname .=\xintToggle{#1}\endcsname }%
\def\XINT_expr_onlitteral_protect #1)%
{\expandafter\XINT_expr_getop\csname .=\detokenize{#1}\endcsname }%
-\def\XINT_expr_func_unknown #1#2#3{\expandafter #1\expandafter #2\csname .=0\endcsname }%
+\def\XINT_expr_func_unknown #1#2#3%
+ {\expandafter #1\expandafter #2\csname .=0\endcsname }%
\def\XINT_expr_func_break #1#2#3%
-{\expandafter #1\expandafter #2\csname.=?\romannumeral-`0\XINT_expr_unlock #3\endcsname }%
+ {\expandafter #1\expandafter #2\csname.=?\romannumeral-`0\XINT_expr_unlock #3\endcsname }%
\let\XINT_flexpr_func_break \XINT_expr_func_break
\let\XINT_iiexpr_func_break \XINT_expr_func_break
+\def\XINT_expr_onlitteral_qint #1)%
+ {\expandafter\XINT_expr_getop\csname .=\xintiNum{#1}\endcsname }%
+\def\XINT_expr_onlitteral_qfrac #1)%
+ {\expandafter\XINT_expr_getop\csname .=\xintRaw{#1}\endcsname }%
+\def\XINT_expr_onlitteral_qfloat #1)%
+ {\expandafter\XINT_expr_getop\csname .=\XINTinFloatdigits{#1}\endcsname }%
\def\XINT_expr_onlitteral_seq
{\expandafter\XINT_expr_onlitteral_seq_f\romannumeral-`0\XINT_expr_onlitteral_seq_a {}}%
\def\XINT_expr_onlitteral_seq_f #1#2{\xint_c_xviii `{seqx}#2)\relax #1}%
@@ -1379,7 +1426,7 @@
\def\XINT_isbalanced_a #1({\XINT_isbalanced_b #1)\xint_bye }%
\def\XINT_isbalanced_b #1)#2%
{\xint_bye #2\XINT_isbalanced_c\xint_bye\XINT_isbalanced_error }%
-\def\XINT_isbalanced_error #1)\xint_bye {\m@ne}%
+\def\XINT_isbalanced_error #1)\xint_bye {\xint_c_mone}%
\def\XINT_isbalanced_c\xint_bye\XINT_isbalanced_error #1%
{\xint_bye #1\XINT_isbalanced_yes\xint_bye\XINT_isbalanced_d #1}%
\def\XINT_isbalanced_yes\xint_bye\XINT_isbalanced_d\xint_bye )\xint_bye {\xint_c_ }%
@@ -2167,10 +2214,11 @@
\romannumeral-`0\expandafter\XINT_xptwo_getab_b
\romannumeral-`0####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,iFac,Bool,Toggle}\do
+ 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
@@ -2178,6 +2226,13 @@
\expandafter\XINT_NEfork_one\romannumeral-`0####1!{~xint#1}{xint#1}{}{}}%
}%
}%
+\toks0
+ \expandafter{\the\toks0
+ \let\XINTinFloatFacNE\XINTinFloatFac
+ \def\XINTinFloatFac ##1{%
+ \expandafter\XINT_NEfork_one
+ \romannumeral-`0##1!{~XINTinFloatFac}{XINTinFloatFac}{}{}}%
+ }%
\xintFor #1 in {Add,Sub,Mul,Div,Power,E,Mod,SeqA::csv}\do
{\toks0
\expandafter{\the\toks0%
diff --git a/Master/texmf-dist/tex/generic/xint/xintfrac.sty b/Master/texmf-dist/tex/generic/xint/xintfrac.sty
index f0e50614e0d..59030c1e9be 100644
--- a/Master/texmf-dist/tex/generic/xint/xintfrac.sty
+++ b/Master/texmf-dist/tex/generic/xint/xintfrac.sty
@@ -21,7 +21,7 @@
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%% ---------------------------------------------------------------
-%% The xint bundle v1.1c 2015/09/12
+%% The xint bundle v1.2 2015/10/10
%% Copyright (C) 2013-2015 by Jean-Francois Burnol
%% xintfrac: Expandable operations on fractions
%% ---------------------------------------------------------------
@@ -70,8 +70,7 @@
\XINTsetupcatcodes% defined in xintkernel.sty
\XINT_providespackage
\ProvidesPackage{xintfrac}%
- [2015/09/12 v1.1c Expandable operations on fractions (jfB)]%
-\chardef\xint_c_xviii 18
+ [2015/10/10 v1.2 Expandable operations on fractions (jfB)]%
\def\XINT_cntSgnFork #1%
{%
\ifcase #1\expandafter\xint_secondofthree
@@ -150,126 +149,132 @@
\def\XINT_inFrac {\romannumeral0\XINT_infrac }%
\def\XINT_infrac #1%
{%
- \expandafter\XINT_infrac_ \romannumeral-`0#1[\W]\Z\T
+ \expandafter\XINT_infrac_fork\romannumeral-`0#1/\XINT_W[\XINT_W\XINT_T
}%
-\def\XINT_infrac_ #1[#2#3]#4\Z
+\def\XINT_infrac_fork #1[#2%
{%
- \xint_UDwfork
- #2\XINT_infrac_A
- \W\XINT_infrac_B
+ \xint_UDXINTWfork
+ #2\XINT_frac_gen
+ \XINT_W\XINT_infrac_res_a % strict A[N] or A/B[N] input
\krof
- #1[#2#3]#4%
+ #1[#2%
}%
-\def\XINT_infrac_A #1[\W]\T
+\def\XINT_infrac_res_a #1%
{%
- \XINT_frac #1/\W\Z
+ \xint_gob_til_zero #1\XINT_infrac_res_zero 0\XINT_infrac_res_b #1%
}%
-\def\XINT_infrac_B #1%
+\def\XINT_infrac_res_zero 0\XINT_infrac_res_b #1\XINT_T {{0}{0}{1}}%
+\def\XINT_infrac_res_b #1/#2%
{%
- \xint_gob_til_zero #1\XINT_infrac_Zero0\XINT_infrac_BB #1%
-}%
-\def\XINT_infrac_BB #1[\W]\T {\XINT_infrac_BC #1/\W\Z }%
-\def\XINT_infrac_BC #1/#2#3\Z
-{%
- \xint_UDwfork
- #2\XINT_infrac_BCa
- \W{\expandafter\XINT_infrac_BCb \romannumeral-`0#2}%
+ \xint_UDXINTWfork
+ #2\XINT_infrac_res_ca
+ \XINT_W\XINT_infrac_res_cb
\krof
- #3\Z #1\Z
-}%
-\def\XINT_infrac_BCa \Z #1[#2]#3\Z { {#2}{#1}{1}}%
-\def\XINT_infrac_BCb #1[#2]/\W\Z #3\Z { {#2}{#3}{#1}}%
-\def\XINT_infrac_Zero #1\T { {0}{0}{1}}%
-\def\XINT_frac #1/#2#3\Z
-{%
- \xint_UDwfork
- #2\XINT_frac_A
- \W{\expandafter\XINT_frac_U \romannumeral-`0#2}%
+ #1/#2%
+}%
+\def\XINT_infrac_res_ca #1[#2]/\XINT_W[\XINT_W\XINT_T
+ {\expandafter{\the\numexpr 0#2}{#1}{1}}%
+\def\XINT_infrac_res_cb #1/#2[%
+ {\expandafter\XINT_infrac_res_cc\romannumeral-`0#2~#1[}%
+\def\XINT_infrac_res_cc #1~#2[#3]/\XINT_W[\XINT_W\XINT_T
+ {\expandafter{\the\numexpr 0#3}{#2}{#1}}%
+\def\XINT_frac_gen #1/#2%
+{%
+ \xint_UDXINTWfork
+ #2\XINT_frac_gen_A
+ \XINT_W\XINT_frac_gen_B
\krof
- #3e\W\Z #1e\W\Z
+ #1/#2%
}%
-\def\XINT_frac_U #1e#2#3\Z
+\def\XINT_frac_gen_A #1/\XINT_W [\XINT_W {\XINT_frac_gen_C 0~1!#1ee.\XINT_W }%
+\def\XINT_frac_gen_B #1/#2/\XINT_W[%\XINT_W
{%
- \xint_UDwfork
- #2\XINT_frac_Ua
- \W{\XINT_frac_Ub #2}%
- \krof
- #3\Z #1\Z
+ \expandafter\XINT_frac_gen_Ba
+ \romannumeral-`0#2ee.\XINT_W\XINT_Z #1ee.%\XINT_W
}%
-\def\XINT_frac_Ua \Z #1/\W\Z {\XINT_frac_B #1.\W\Z {0}}%
-\def\XINT_frac_Ub #1/\W e\W\Z #2\Z {\XINT_frac_B #2.\W\Z {#1}}%
-\def\XINT_frac_B #1.#2#3\Z
+\def\XINT_frac_gen_Ba #1.#2%
{%
- \xint_UDwfork
- #2\XINT_frac_Ba
- \W{\XINT_frac_Bb #2}%
+ \xint_UDXINTWfork
+ #2\XINT_frac_gen_Bb
+ \XINT_W\XINT_frac_gen_Bc
\krof
- #3\Z #1\Z
+ #1.#2%
}%
-\def\XINT_frac_Ba \Z #1\Z {\XINT_frac_T {0}{#1}}%
-\def\XINT_frac_Bb #1.\W\Z #2\Z
+\def\XINT_frac_gen_Bb #1e#2e#3\XINT_Z
+ {\expandafter\XINT_frac_gen_C\the\numexpr 0#2~#1!}%
+\def\XINT_frac_gen_Bc #1.#2e%
{%
- \expandafter \XINT_frac_T \expandafter
- {\romannumeral0\xintlength {#1}}{#2#1}%
+ \expandafter\XINT_frac_gen_Bd\romannumeral-`0#2.#1e%
}%
-\def\XINT_frac_A e\W\Z {\XINT_frac_T {0}{1}{0}}%
-\def\XINT_frac_T #1#2#3#4e#5#6\Z
+\def\XINT_frac_gen_Bd #1.#2e#3e#4\XINT_Z
{%
- \xint_UDwfork
- #5\XINT_frac_Ta
- \W{\XINT_frac_Tb #5}%
- \krof
- #6\Z #4\Z {#1}{#2}{#3}%
+ \expandafter\XINT_frac_gen_C\the\numexpr 0#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!%
}%
-\def\XINT_frac_Ta \Z #1\Z {\XINT_frac_C #1.\W\Z {0}}%
-\def\XINT_frac_Tb #1e\W\Z #2\Z {\XINT_frac_C #2.\W\Z {#1}}%
-\def\XINT_frac_C #1.#2#3\Z
+\def\XINT_frac_gen_C #1!#2.#3%
{%
- \xint_UDwfork
- #2\XINT_frac_Ca
- \W{\XINT_frac_Cb #2}%
+ \xint_UDXINTWfork
+ #3\XINT_frac_gen_Ca
+ \XINT_W\XINT_frac_gen_Cb
\krof
- #3\Z #1\Z
+ #1!#2.#3%
}%
-\def\XINT_frac_Ca \Z #1\Z {\XINT_frac_D {0}{#1}}%
-\def\XINT_frac_Cb #1.\W\Z #2\Z
+\def\XINT_frac_gen_Ca #1~#2!#3e#4e#5\XINT_T
{%
- \expandafter\XINT_frac_D\expandafter
- {\romannumeral0\xintlength {#1}}{#2#1}%
+ \expandafter\XINT_frac_gen_F\the\numexpr #4-#1\expandafter
+ ~\romannumeral0\XINT_num_loop
+ #2\xint_relax\xint_relax\xint_relax\xint_relax
+ \xint_relax\xint_relax\xint_relax\xint_relax\Z~#3~%
}%
-\def\XINT_frac_D #1#2#3#4#5#6%
+\def\XINT_frac_gen_Cb #1.#2e%
{%
- \expandafter \XINT_frac_E \expandafter
- {\the\numexpr -#1+#3+#4-#6\expandafter}\expandafter
- {\romannumeral0\XINT_num_loop #2%
- \xint_relax\xint_relax\xint_relax\xint_relax
- \xint_relax\xint_relax\xint_relax\xint_relax\Z }%
- {\romannumeral0\XINT_num_loop #5%
- \xint_relax\xint_relax\xint_relax\xint_relax
- \xint_relax\xint_relax\xint_relax\xint_relax\Z }%
+ \expandafter\XINT_frac_gen_Cc\romannumeral-`0#2.#1e%
}%
-\def\XINT_frac_E #1#2#3%
+\def\XINT_frac_gen_Cc #1.#2~#3!#4e#5e#6\XINT_T
{%
- \expandafter \XINT_frac_F #3\Z {#2}{#1}%
+ \expandafter\XINT_frac_gen_F\the\numexpr #5-#2-%
+ \romannumeral0\XINT_length_loop
+ 0.#1\xint_relax\xint_relax\xint_relax\xint_relax
+ \xint_relax\xint_relax\xint_relax\xint_relax\xint_bye\expandafter
+ ~\romannumeral0\XINT_num_loop
+ #3\xint_relax\xint_relax\xint_relax\xint_relax
+ \xint_relax\xint_relax\xint_relax\xint_relax\Z
+ ~#4#1~%
}%
-\def\XINT_frac_F #1%
+\def\XINT_frac_gen_F #1~#2%
{%
\xint_UDzerominusfork
- #1-\XINT_frac_Gdivisionbyzero
- 0#1\XINT_frac_Gneg
- 0-{\XINT_frac_Gpos #1}%
- \krof
+ #2-\XINT_frac_gen_Gdivbyzero
+ 0#2{\XINT_frac_gen_G -{}}%
+ 0-{\XINT_frac_gen_G {}#2}%
+ \krof #1~%
}%
-\edef\XINT_frac_Gdivisionbyzero #1\Z #2#3%
+\def\XINT_frac_gen_Gdivbyzero #1~~#2~%
{%
- \noexpand\xintError:DivisionByZero\space {0}{#2}{0}%
+ \expandafter\XINT_frac_gen_Gdivbyzero_a
+ \romannumeral0\XINT_num_loop
+ #2\xint_relax\xint_relax\xint_relax\xint_relax
+ \xint_relax\xint_relax\xint_relax\xint_relax\Z~#1~%
}%
-\def\XINT_frac_Gneg #1\Z #2#3%
+\def\XINT_frac_gen_Gdivbyzero_a #1~#2~%
{%
- \expandafter\XINT_frac_H \expandafter{\romannumeral0\XINT_opp #2}{#3}{#1}%
+ \xintError:DivisionByZero {#2}{#1}{0}%
}%
-\def\XINT_frac_H #1#2{ {#2}{#1}}%
-\def\XINT_frac_Gpos #1\Z #2#3{ {#3}{#2}{#1}}%
+\def\XINT_frac_gen_G #1#2#3~#4~#5~%
+{%
+ \expandafter\XINT_frac_gen_Ga
+ \romannumeral0\XINT_num_loop
+ #1#5\xint_relax\xint_relax\xint_relax\xint_relax
+ \xint_relax\xint_relax\xint_relax\xint_relax\Z~#3~{#2#4}%
+}%
+\def\XINT_frac_gen_Ga #1#2~#3~%
+{%
+ \xint_gob_til_zero #1\XINT_frac_gen_zero 0%
+ {#3}{#1#2}%
+}%
+\def\XINT_frac_gen_zero 0#1#2#3{{0}{0}{1}}%
\def\XINT_factortens #1%
{%
\expandafter\XINT_cuz_cnt_loop\expandafter
@@ -363,6 +368,96 @@
\xint_bye\xint_bye\xint_bye\xint_bye
\xint_relax }{#1}%
}%
+\def\XINT_addm_A #1#2#3#4#5#6%
+{%
+ \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%
+{%
+ \XINT_addm_AC_checkcarry #1%
+}%
+\def\XINT_addm_AB #1#2#3#4\W\X\Y\Z #5#6#7#8%
+{%
+ \XINT_addm_ABE #1#2{#8#7#6#5}{#3}#4\W\X\Y\Z
+}%
+\def\XINT_addm_ABE #1#2#3#4#5#6%
+{%
+ \expandafter\XINT_addm_ABEA\the\numexpr #1+10#5#4#3#2+#6.%
+}%
+\def\XINT_addm_ABEA #1#2#3.#4%
+{%
+ \XINT_addm_A #2{#3#4}%
+}%
+\def\XINT_addm_AC_checkcarry #1%
+{%
+ \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
+{%
+ \expandafter
+ \xint_cleanupzeros_andstop
+ \romannumeral0%
+ \XINT_rord_main {}#2%
+ \xint_relax
+ \xint_bye\xint_bye\xint_bye\xint_bye
+ \xint_bye\xint_bye\xint_bye\xint_bye
+ \xint_relax
+ #1%
+}%
+\def\XINT_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
+ \W\XINT_addm_CD {#5#4#3#2}{#1}%
+}%
+\def\XINT_addm_CD #1%
+{%
+ \expandafter\XINT_addm_CC\the\numexpr 1+10#1.%
+}%
+\def\XINT_addm_CC #1#2#3.#4%
+{%
+ \XINT_addm_AC_checkcarry #2{#3#4}%
+}%
+\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.%
+}%
+\def\XINT_addm_CDw #1.#2#3\X\Y\Z
+{%
+ \XINT_addm_end #1#3%
+}%
+\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.%
+}%
+\def\XINT_addm_CDx #1.#2#3\Y\Z
+{%
+ \XINT_addm_end #1#3%
+}%
+\def\xint_addm_cy
+ #1\xint_addm_cz
+ \W\XINT_addm_CD
+{%
+ \expandafter\XINT_addm_CDy\the\numexpr 1+#1.%
+}%
+\def\XINT_addm_CDy #1.#2#3\Z
+{%
+ \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 }%
\def\xintraw
{%
@@ -736,8 +831,8 @@
\def\XINT_jrr_loop_b #1#2#3#4#5#6#7%
{%
\expandafter \XINT_jrr_loop_c \expandafter
- {\romannumeral0\xintiiadd{\XINT_Mul{#4}{#1}}{#6}}%
- {\romannumeral0\xintiiadd{\XINT_Mul{#5}{#1}}{#7}}%
+ {\romannumeral0\xintiiadd{\XINT_mul_fork #4\Z #1\Z}{#6}}%
+ {\romannumeral0\xintiiadd{\XINT_mul_fork #5\Z #1\Z}{#7}}%
{#2}{#3}{#4}{#5}%
}%
\def\XINT_jrr_loop_c #1#2%
@@ -1058,33 +1153,7 @@
\expandafter\XINT_xtrunc_negNC\expandafter
{\the\numexpr\xintLength {#1}-#2}{#1}%
}%
-\def\XINT_xtrunc_Q #1%
-{%
- \expandafter\XINT_xtrunc_prepare_I
- \romannumeral0\XINT_dsx_zeroloop {#1}{}\Z
-}%
-\def\XINT_xtrunc_prepare_I #1.#2#3%
-{%
- \expandafter\XINT_xtrunc_prepareB_aa\expandafter
- {\romannumeral0\xintlength {#2}}{#2}{#1}%
-}%
-\def\XINT_xtrunc_prepareB_aa #1%
-{%
- \ifnum #1=\xint_c_i
- \expandafter\XINT_xtrunc_prepareB_onedigit
- \else
- \expandafter\XINT_xtrunc_prepareB_PaBa
- \fi
- {#1}%
-}%
-\def\XINT_xtrunc_prepareB_onedigit #1#2%
-{%
- \ifcase#2
- \or\expandafter\XINT_xtrunc_BisOne
- \or\expandafter\XINT_xtrunc_BisTwo
- \else\expandafter\XINT_xtrunc_prepareB_PaBe
- \fi {000}{0}{4}{#2}%
-}%
+%%%%%%%%%%%%
\def\XINT_xtrunc_BisOne #1#2#3#4#5#6#7%
{%
#5.\romannumeral0\expandafter\XINT_dsx_zeroloop\expandafter
@@ -1104,48 +1173,76 @@
0000000000000000000000000000000000000000000000000000000000000000%
\repeat
}%
-\def\XINT_xtrunc_prepareB_PaBa #1#2%
+%%%%%%%%%%%%
+\def\XINT_xtrunc_Q #1%
+{%
+ \expandafter\XINT_xtrunc_prepare
+ \romannumeral0\XINT_dsx_zeroloop {#1}{}\Z
+}%
+\def\XINT_xtrunc_prepare #1.#2#3%
{%
\expandafter\XINT_xtrunc_Pa\expandafter
- {\romannumeral0\XINT_xtrunc_prepareB_a {#1}{#2}}%
+ {\romannumeral0%
+ \XINT_xtrunc_prepare_a #2\R\R\R\R\R\R\R\R {10}0000001\W !{#2}}{#1}%
}%
-\def\XINT_xtrunc_prepareB_a #1%
+%%%%%%%%%%%%
+\def\XINT_xtrunc_prepare_a #1#2#3#4#5#6#7#8#9%
{%
- \expandafter\XINT_xtrunc_prepareB_c\expandafter
- {\the\numexpr \xint_c_iv*((#1+\xint_c_i)/\xint_c_iv)}{#1}%
+ \xint_gob_til_R #9\XINT_xtrunc_prepare_small\R
+ \XINT_xtrunc_prepare_b #9%
}%
-\def\XINT_xtrunc_prepareB_c #1#2%
+\def\XINT_xtrunc_prepare_small\R #1!#2%
{%
- \csname XINT_xtrunc_prepareB_d\romannumeral\numexpr#1-#2\endcsname
- {#1}%
+ \ifcase #2
+ \or\xint_afterfi{ \XINT_div_BisOne}%
+ \or\xint_afterfi{ \XINT_div_BisTwo}%
+ \else\expandafter\XINT_xtrunc_small_aa
+ \fi {#2}%
}%
-\def\XINT_xtrunc_prepareB_d {\XINT_xtrunc_prepareB_e {}{0000}}%
-\def\XINT_xtrunc_prepareB_di {\XINT_xtrunc_prepareB_e {0}{000}}%
-\def\XINT_xtrunc_prepareB_dii {\XINT_xtrunc_prepareB_e {00}{00}}%
-\def\XINT_xtrunc_prepareB_diii {\XINT_xtrunc_prepareB_e {000}{0}}%
-\def\XINT_xtrunc_prepareB_PaBe #1#2#3#4%
+\def\XINT_xtrunc_small_aa #1%
{%
- \expandafter\XINT_xtrunc_Pa\expandafter
- {\romannumeral0\XINT_xtrunc_prepareB_e {#1}{#2}{#3}{#4}}%
+ \expandafter\space\expandafter\XINT_xtrunc_small_a
+ \the\numexpr #1/\xint_c_ii\expandafter
+ .\the\numexpr \xint_c_x^viii+#1!%
}%
-\def\XINT_xtrunc_prepareB_e #1#2#3#4%
+%%%%%%%%%%%%
+\def\XINT_xtrunc_small_a #1.#2!#3%
{%
- \ifnum#3=\xint_c_iv\expandafter\XINT_xtrunc_prepareLittleB_f
- \else\expandafter\XINT_xtrunc_prepareB_f
- \fi
- #4#1{#3}{#2}{#1}%
+ \expandafter\XINT_div_small_b\the\numexpr #1\expandafter
+ .\the\numexpr #2\expandafter!%
+ \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_prepareB_f #1#2#3#4#5#{%
- \expandafter\space
- \expandafter\XINT_div_prepareB_g
- \the\numexpr #1#2#3#4+\xint_c_i\expandafter
- .\the\numexpr (#1#2#3#4+\xint_c_i)/\xint_c_ii\expandafter
- .\romannumeral0\xintreverseorder {#1#2#3#4#5}.{#1#2#3#4}%
+%%%%%%%%%%%%
+\def\XINT_xtrunc_prepare_b
+ {\expandafter\XINT_xtrunc_prepare_c\romannumeral0\XINT_zeroes_forviii }%
+\def\XINT_xtrunc_prepare_c #1!%
+{%
+ \XINT_xtrunc_prepare_d #1.00000000!{#1}%
}%
-\def\XINT_xtrunc_prepareLittleB_f #1#{%
- \expandafter\space\expandafter
- \XINT_div_prepareB_g \the\numexpr #1/\xint_c_ii.{}.{}.{#1}%
+\def\XINT_xtrunc_prepare_d #1#2#3#4#5#6#7#8#9%
+{%
+ \expandafter\XINT_xtrunc_prepare_e\xint_gob_til_dot #1#2#3#4#5#6#7#8#9!%
}%
+\def\XINT_xtrunc_prepare_e #1!#2!#3#4%
+{%
+ \XINT_xtrunc_prepare_f #4#3\X {#1}{#3}%
+}%
+\def\XINT_xtrunc_prepare_f #1#2#3#4#5#6#7#8#9\X
+{%
+ \expandafter\space\expandafter\XINT_div_prepare_g
+ \the\numexpr #1#2#3#4#5#6#7#8+\xint_c_i\expandafter
+ .\the\numexpr (#1#2#3#4#5#6#7#8+\xint_c_i)/\xint_c_ii\expandafter
+ .\the\numexpr #1#2#3#4#5#6#7#8\expandafter
+ .\romannumeral0\XINT_sepandrev_andcount
+ #1#2#3#4#5#6#7#8#9\XINT_rsepbyviii_end_A 2345678%
+ \XINT_rsepbyviii_end_B 2345678%
+ \relax\xint_c_ii\xint_c_iii
+ \R.\xint_c_vi\R.\xint_c_v\R.\xint_c_iv\R.\xint_c_iii
+ \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}%
@@ -1540,7 +1637,7 @@
}%
\def\XINT_fadd_C #1#2#3%
{%
- \ifcase\romannumeral0\XINT_cmp_pre {#2}{#3} %<- intentional space here.
+ \ifcase\romannumeral0\xintiicmp {#2}{#3} %<- intentional space here.
\expandafter\XINT_fadd_eq
\or\expandafter\XINT_fadd_D
\else\expandafter\XINT_fadd_Da
@@ -2000,10 +2097,10 @@
\expandafter\XINT_fcmp_Fe\expandafter
{\romannumeral0\XINT_dsx_addzerosnofuss {#1}{#3}}{#2}%
}%
-\def\XINT_fcmp_Fe #1#2{\XINT_cmp_pre {#2}{#1}}%
+\def\XINT_fcmp_Fe #1#2{\xintiicmp {#2}{#1}}%
\def\XINT_fcmp_Fn #1\Z #2#3%
{%
- \expandafter\XINT_cmp_pre\expandafter
+ \expandafter\xintiicmp\expandafter
{\romannumeral0\XINT_dsx_addzerosnofuss {#1}{#2}}{#3}%
}%
\def\xintAbs {\romannumeral0\xintabs }%
@@ -2391,6 +2488,209 @@
\fi\expandafter\XINT_flpow_III\the\numexpr #6\expandafter\relax
#4{#3}{#5}%
}%
+\def\xintFloatFac {\romannumeral0\xintfloatfac}%
+\def\xintfloatfac #1{\XINT_flfac_chkopt \xintfloat #1\xint_relax }%
+\def\XINTinFloatFac {\romannumeral0\XINTinfloatfac }%
+\def\XINTinfloatfac #1{\XINT_flfac_chkopt \XINTinfloat #1\xint_relax }%
+\def\XINT_flfac_chkopt #1#2%
+{%
+ \ifx [#2\expandafter\XINT_flfac_opt
+ \else\expandafter\XINT_flfac_noopt
+ \fi
+ #1#2%
+}%
+\def\XINT_flfac_noopt #1#2\xint_relax
+{%
+ \expandafter\XINT_FL_fac_start\expandafter
+ {\the\numexpr #2}{\XINTdigits}{#1[\XINTdigits]}%
+}%
+\def\XINT_flfac_opt #1[\xint_relax #2]#3%
+{%
+ \expandafter\XINT_FL_fac_start\expandafter
+ {\the\numexpr #3\expandafter}\expandafter{\the\numexpr#2}{#1[#2]}%
+}%
+\def\XINT_FL_fac_start #1%
+{%
+ \ifcase\XINT_cntSgn #1\Z
+ \expandafter\XINT_FL_fac_iszero
+ \or
+ \expandafter\XINT_FL_fac_increaseP
+ \else
+ \expandafter\XINT_FL_fac_isneg
+ \fi {#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%
+{%
+ \expandafter\XINT_FL_fac_fork
+ \the\numexpr \xint_c_viii*%
+ ((\xint_c_v+#2+\XINT_FL_fac_extradigits #187654321\Z)/\xint_c_viii).%
+ #1.%
+}%
+\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%
+{%
+ \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}%
+}%
+\def\XINT_FL_fac_toobig #1.#2.#3#4%
+ {\expandafter\xintError:FactorialOfTooBigNumber #4{1/1[0]}}%
+\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.%
+ \the\numexpr \xint_c_x^viii+#1.}%
+}%
+\def\XINT_FL_fac_vbigloop_loop #1.#2.%
+{%
+ \ifnum #1>#2 \expandafter\XINT_FL_fac_loop_exit\fi
+ \expandafter\XINT_FL_fac_vbigloop_loop
+ \the\numexpr #1+\xint_c_i\expandafter.%
+ \the\numexpr #2\expandafter.\the\numexpr\XINT_FL_fac_mul #1!%
+}%
+\def\XINT_FL_fac_bigloop_a #1.%
+{%
+ \expandafter\XINT_FL_fac_bigloop_b \the\numexpr
+ #1+\xint_c_i-\xint_c_ii*((#1-464)/\xint_c_ii).#1.%
+}%
+\def\XINT_FL_fac_bigloop_b #1.#2.#3.%
+{%
+ \expandafter\XINT_FL_fac_medloop_a
+ \the\numexpr #1-\xint_c_i.#3.{\XINT_FL_fac_bigloop_loop #1.#2.}%
+}%
+\def\XINT_FL_fac_bigloop_loop #1.#2.%
+{%
+ \ifnum #1>#2 \expandafter\XINT_FL_fac_loop_exit\fi
+ \expandafter\XINT_FL_fac_bigloop_loop
+ \the\numexpr #1+\xint_c_ii\expandafter.%
+ \the\numexpr #2\expandafter.\the\numexpr\XINT_FL_fac_bigloop_mul #1!%
+}%
+\def\XINT_FL_fac_bigloop_mul #1!%
+{%
+ \expandafter\XINT_FL_fac_mul
+ \the\numexpr \xint_c_x^viii+#1*(#1+\xint_c_i)!%
+}%
+\def\XINT_FL_fac_medloop_a #1.%
+{%
+ \expandafter\XINT_FL_fac_medloop_b
+ \the\numexpr #1+\xint_c_i-\xint_c_iii*((#1-100)/\xint_c_iii).#1.%
+}%
+\def\XINT_FL_fac_medloop_b #1.#2.#3.%
+{%
+ \expandafter\XINT_FL_fac_smallloop_a
+ \the\numexpr #1-\xint_c_i.#3.{\XINT_FL_fac_medloop_loop #1.#2.}%
+}%
+\def\XINT_FL_fac_medloop_loop #1.#2.%
+{%
+ \ifnum #1>#2 \expandafter\XINT_FL_fac_loop_exit\fi
+ \expandafter\XINT_FL_fac_medloop_loop
+ \the\numexpr #1+\xint_c_iii\expandafter.%
+ \the\numexpr #2\expandafter.\the\numexpr\XINT_FL_fac_medloop_mul #1!%
+}%
+\def\XINT_FL_fac_medloop_mul #1!%
+{%
+ \expandafter\XINT_FL_fac_mul
+ \the\numexpr
+ \xint_c_x^viii+#1*(#1+\xint_c_i)*(#1+\xint_c_ii)!%
+}%
+\def\XINT_FL_fac_smallloop_a #1.%
+{%
+ \csname
+ XINT_FL_fac_smallloop_\the\numexpr #1-\xint_c_iv*(#1/\xint_c_iv)\relax
+ \endcsname #1.%
+}%
+\expandafter\def\csname XINT_FL_fac_smallloop_1\endcsname #1.#2.%
+{%
+ \XINT_FL_fac_addzeros #2.100000001!.{2.#1.}{#2}%
+}%
+\expandafter\def\csname XINT_FL_fac_smallloop_-2\endcsname #1.#2.%
+{%
+ \XINT_FL_fac_addzeros #2.100000002!.{3.#1.}{#2}%
+}%
+\expandafter\def\csname XINT_FL_fac_smallloop_-1\endcsname #1.#2.%
+{%
+ \XINT_FL_fac_addzeros #2.100000006!.{4.#1.}{#2}%
+}%
+\expandafter\def\csname XINT_FL_fac_smallloop_0\endcsname #1.#2.%
+{%
+ \XINT_FL_fac_addzeros #2.100000024!.{5.#1.}{#2}%
+}%
+\def\XINT_FL_fac_addzeros #1.%
+{%
+ \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_smallloop_loop #1.#2.%
+{%
+ \ifnum #1>#2 \expandafter\XINT_FL_fac_loop_exit\fi
+ \expandafter\XINT_FL_fac_smallloop_loop
+ \the\numexpr #1+\xint_c_iv\expandafter.%
+ \the\numexpr #2\expandafter.\romannumeral0\XINT_FL_fac_smallloop_mul #1!%
+}%
+\def\XINT_FL_fac_smallloop_mul #1!%
+{%
+ \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_FL_fac_loop_exit #1!#2]#3{#3#2]}%
+\def\XINT_FL_fac_mul 1#1!%
+ {\expandafter\XINT_FL_fac_mul_a\the\numexpr\XINT_FL_fac_smallmul 10!{#1}}%
+\def\XINT_FL_fac_mul_a #1-#2%
+{%
+ \if#21\xint_afterfi{\expandafter\space\xint_gob_til_exclam}\else
+ \expandafter\space\fi #11\Z!%
+}%
+\def\XINT_FL_fac_minimulwc_a #1#2#3#4#5!#6#7#8#9%
+{%
+ \XINT_FL_fac_minimulwc_b {#1#2#3#4}{#5}{#6#7#8#9}%
+}%
+\def\XINT_FL_fac_minimulwc_b #1#2#3#4!#5%
+{%
+ \expandafter\XINT_FL_fac_minimulwc_c
+ \the\numexpr \xint_c_x^ix+#5+#2*#4.{{#1}{#2}{#3}{#4}}%
+}%
+\def\XINT_FL_fac_minimulwc_c 1#1#2#3#4#5#6.#7%
+{%
+ \expandafter\XINT_FL_fac_minimulwc_d {#1#2#3#4#5}#7{#6}%
+}%
+\def\XINT_FL_fac_minimulwc_d #1#2#3#4#5%
+{%
+ \expandafter\XINT_FL_fac_minimulwc_e
+ \the\numexpr \xint_c_x^ix+#1+#2*#5+#3*#4.{#2}{#4}%
+}%
+\def\XINT_FL_fac_minimulwc_e 1#1#2#3#4#5#6.#7#8#9%
+{%
+ 1#6#9\expandafter!%
+ \the\numexpr\expandafter\XINT_FL_fac_smallmul
+ \the\numexpr \xint_c_x^viii+#1#2#3#4#5+#7*#8!%
+}%
+\def\XINT_FL_fac_smallmul 1#1!#21#3!%
+{%
+ \xint_gob_til_Z #3\XINT_FL_fac_smallmul_end\Z
+ \XINT_FL_fac_minimulwc_a #2!#3!{#1}{#2}%
+}%
+\def\XINT_FL_fac_smallmul_end\Z\XINT_FL_fac_minimulwc_a #1!\Z!#2#3[#4]%
+{%
+ \ifnum #2=\xint_c_
+ \expandafter\xint_firstoftwo\else
+ \expandafter\xint_secondoftwo
+ \fi
+ {-2\relax[#4]}%
+ {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 }%
@@ -2539,7 +2839,7 @@
{%
\expandafter\XINT_flsqrt_big_j
\romannumeral0\xintiidivision
- {#1}{\romannumeral0\XINT_dbl_pos #2\R\R\R\R\R\R\R\Z \W\W\W\W\W\W\W }{#2}%
+ {#1}{\romannumeral0\XINT_dbl_pos #2\Z}{#2}%
}%
\def\XINT_flsqrt_big_j #1%
{%
@@ -2551,8 +2851,8 @@
\def\XINT_flsqrt_big_k #1#2#3%
{%
\expandafter\XINT_flsqrt_big_l\expandafter
- {\romannumeral0\XINT_sub_pre {#3}{#1}}%
- {\romannumeral0\xintiiadd {#2}{\romannumeral0\XINT_sqr {#1}}}%
+ {\romannumeral0\xintiisub {#3}{#1}}%
+ {\romannumeral0\xintiiadd {#2}{\romannumeral0\XINT_sqr #1\Z}}%
}%
\def\XINT_flsqrt_big_l #1#2%
{%
diff --git a/Master/texmf-dist/tex/generic/xint/xintgcd.sty b/Master/texmf-dist/tex/generic/xint/xintgcd.sty
index b5905103847..187a37133df 100644
--- a/Master/texmf-dist/tex/generic/xint/xintgcd.sty
+++ b/Master/texmf-dist/tex/generic/xint/xintgcd.sty
@@ -21,7 +21,7 @@
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%% ---------------------------------------------------------------
-%% The xint bundle v1.1c 2015/09/12
+%% The xint bundle v1.2 2015/10/10
%% Copyright (C) 2013-2015 by Jean-Francois Burnol
%% xintgcd: Euclidean algorithm with xint package
%% ---------------------------------------------------------------
@@ -70,7 +70,7 @@
\XINTsetupcatcodes% defined in xintkernel.sty
\XINT_providespackage
\ProvidesPackage{xintgcd}%
- [2015/09/12 v1.1c Euclide algorithm with xint package (jfB)]%
+ [2015/10/10 v1.2 Euclide algorithm with xint package (jfB)]%
\def\xintGCD {\romannumeral0\xintgcd }%
\def\xintgcd #1%
{%
@@ -250,8 +250,8 @@
\def\XINT_bezout_loop_b #1#2#3#4#5#6#7#8%
{%
\expandafter \XINT_bezout_loop_c \expandafter
- {\romannumeral0\xintiiadd{\XINT_Mul{#5}{#2}}{#7}}%
- {\romannumeral0\xintiiadd{\XINT_Mul{#6}{#2}}{#8}}%
+ {\romannumeral0\xintiiadd{\XINT_mul_fork #5\Z #2\Z}{#7}}%
+ {\romannumeral0\xintiiadd{\XINT_mul_fork #6\Z #2\Z}{#8}}%
{#1}{#3}{#4}{#5}{#6}%
}%
\def\XINT_bezout_loop_c #1#2%
diff --git a/Master/texmf-dist/tex/generic/xint/xintkernel.sty b/Master/texmf-dist/tex/generic/xint/xintkernel.sty
index 8904861217e..2b16addfa2b 100644
--- a/Master/texmf-dist/tex/generic/xint/xintkernel.sty
+++ b/Master/texmf-dist/tex/generic/xint/xintkernel.sty
@@ -21,7 +21,7 @@
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%% ---------------------------------------------------------------
-%% The xint bundle v1.1c 2015/09/12
+%% The xint bundle v1.2 2015/10/10
%% Copyright (C) 2013-2015 by Jean-Francois Burnol
%% xintkernel: Paraphernalia for the xint packages
%% ---------------------------------------------------------------
@@ -42,19 +42,21 @@
\else
\def\y#1#2{\PackageInfo{#1}{#2}}%
\fi
+ \let\z\relax
\expandafter
\ifx\csname numexpr\endcsname\relax
\y{xintkernel}{\numexpr not available, aborting input}%
- \aftergroup\endinput
+ \def\z{\endgroup\endinput}%
\else
\expandafter
\ifx\csname XINTsetupcatcodes\endcsname\relax
\else
\y{xintkernel}{I was already loaded, aborting input}%
- \aftergroup\endinput
+ \def\z{\endgroup\endinput}%
\fi
\fi
- \def\SetCatcodesIfInputNotAborted
+ \ifx\z\relax\else\expandafter\z\fi%
+ \def\PrepareCatcodes
{%
\endgroup
\def\XINT_restorecatcodes
@@ -123,19 +125,19 @@
\catcode36=3 % $
\catcode91=12 % [
\catcode93=12 % ]
- \catcode33=11 % ! LETTER
+ \catcode33=12 % !
\catcode64=11 % @ LETTER
\catcode38=12 % &
\catcode124=12 % |
\catcode63=11 % ? LETTER
\catcode34=12 % "
\catcode39=12 % '
- \catcode126=3 % ~
+ \catcode126=3 % ~ MATH
\catcode59=12 % ;
}%
\XINT_setcatcodes
}%
-\SetCatcodesIfInputNotAborted
+\PrepareCatcodes
\def\XINTsetupcatcodes {% for use by other modules
\edef\XINT_restorecatcodes_endinput
{%
@@ -152,7 +154,47 @@
\fi
\XINT_providespackage
\ProvidesPackage {xintkernel}%
- [2015/09/12 v1.1c Paraphernalia for the xint packages (jfB)]%
+ [2015/10/10 v1.2 Paraphernalia for the xint packages (jfB)]%
+\chardef\xint_c_ 0
+\chardef\xint_c_i 1
+\chardef\xint_c_ii 2
+\chardef\xint_c_iii 3
+\chardef\xint_c_iv 4
+\chardef\xint_c_v 5
+\chardef\xint_c_vi 6
+\chardef\xint_c_vii 7
+\chardef\xint_c_viii 8
+\chardef\xint_c_ix 9
+\chardef\xint_c_x 10
+\chardef\xint_c_xiv 14
+\chardef\xint_c_xvi 16
+\chardef\xint_c_xviii 18
+\chardef\xint_c_xxii 22
+\chardef\xint_c_ii^v 32
+\chardef\xint_c_ii^vi 64
+\chardef\xint_c_ii^vii 128
+\mathchardef\xint_c_ii^viii 256
+\mathchardef\xint_c_ii^xii 4096
+\mathchardef\xint_c_x^iv 10000
+\def\XINT_tmpa { }%
+\ifx\XINT_tmpa\space\else
+ \immediate\write-1{Package xintkernel Warning: ATTENTION!}%
+ \immediate\write-1{\string\space\XINT_tmpa macro does not have its normal
+ meaning.}%
+ \immediate\write-1{\XINT_tmpa\XINT_tmpa\XINT_tmpa\XINT_tmpa
+ All kinds of catastrophes will ensue!!!!}%
+\fi
+\def\XINT_tmpb {}%
+\ifx\XINT_tmpb\empty\else
+ \immediate\write-1{Package xintkernel Warning: ATTENTION!}%
+ \immediate\write-1{\string\empty\XINT_tmpa macro does not have its normal
+ meaning.}%
+ \immediate\write-1{\XINT_tmpa\XINT_tmpa\XINT_tmpa\XINT_tmpa
+ All kinds of catastrophes will ensue!!!!}%
+\fi
+\let\XINT_tmpa\relax \let\XINT_tmpb\relax
+\ifdefined\space\else\def\space { }\fi
+\ifdefined\empty\else\def\empty {}\fi
\long\def\xint_gobble_ {}%
\long\def\xint_gobble_i #1{}%
\long\def\xint_gobble_ii #1#2{}%
@@ -168,11 +210,29 @@
\long\def\xint_firstofone_thenstop #1{ #1}%
\long\def\xint_firstoftwo_thenstop #1#2{ #1}%
\long\def\xint_secondoftwo_thenstop #1#2{ #2}%
-\def\xint_gob_til_zero #10{}%
-\def\xint_UDzerominusfork #10-#2#3\krof {#2}%
+\def\xint_minus_thenstop { -}%
+\def\xint_exchangetwo_keepbraces #1#2{{#2}{#1}}%
\long\def\xint_gob_til_R #1\R {}%
\long\def\xint_gob_til_W #1\W {}%
\long\def\xint_gob_til_Z #1\Z {}%
+\def\xint_gob_til_zero #10{}%
+\def\xint_gob_til_one #11{}%
+\def\xint_gob_til_zeros_iii #1000{}%
+\def\xint_gob_til_zeros_iv #10000{}%
+\def\xint_gob_til_eightzeroes #100000000{}%
+\def\xint_gob_til_exclam #1!{}% catcode 12 exclam
+\def\xint_gob_til_dot #1.{}%
+\def\xint_gob_til_G #1G{}%
+\def\xint_gob_til_minus #1-{}%
+\def\xint_gob_til_relax #1\relax {}%
+\def\xint_UDzerominusfork #10-#2#3\krof {#2}%
+\def\xint_UDzerofork #10#2#3\krof {#2}%
+\def\xint_UDsignfork #1-#2#3\krof {#2}%
+\def\xint_UDwfork #1\W#2#3\krof {#2}%
+\def\xint_UDXINTWfork #1\XINT_W#2#3\krof {#2}%
+\def\xint_UDzerosfork #100#2#3\krof {#2}%
+\def\xint_UDonezerofork #110#2#3\krof {#2}%
+\def\xint_UDsignsfork #1--#2#3\krof {#2}%
\let\xint_relax\relax
\def\xint_brelax {\xint_relax }%
\long\def\xint_gob_til_xint_relax #1\xint_relax {}%
@@ -180,16 +240,9 @@
\long\def\xint_bye #1\xint_bye {}%
\long\def\xint_dothis #1#2\xint_orthat #3{\fi #1}% v1.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
-\chardef\xint_c_ 0
-\chardef\xint_c_i 1
-\chardef\xint_c_ii 2
-\chardef\xint_c_iii 3
-\chardef\xint_c_iv 4
-\chardef\xint_c_v 5
-\chardef\xint_c_vi 6
-\chardef\xint_c_vii 7
-\chardef\xint_c_viii 8
\def\xintodef #1{\expandafter\def\expandafter#1\expandafter }%
\def\xintoodef #1{\expandafter\expandafter\expandafter\def
\expandafter\expandafter\expandafter#1%
diff --git a/Master/texmf-dist/tex/generic/xint/xintseries.sty b/Master/texmf-dist/tex/generic/xint/xintseries.sty
index 1bec170ddc4..40cfb759761 100644
--- a/Master/texmf-dist/tex/generic/xint/xintseries.sty
+++ b/Master/texmf-dist/tex/generic/xint/xintseries.sty
@@ -21,7 +21,7 @@
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%% ---------------------------------------------------------------
-%% The xint bundle v1.1c 2015/09/12
+%% The xint bundle v1.2 2015/10/10
%% Copyright (C) 2013-2015 by Jean-Francois Burnol
%% xintseries: Expandable partial sums with xint package
%% ---------------------------------------------------------------
@@ -70,7 +70,7 @@
\XINTsetupcatcodes% defined in xintkernel.sty
\XINT_providespackage
\ProvidesPackage{xintseries}%
- [2015/09/12 v1.1c Expandable partial sums with xint package (jfB)]%
+ [2015/10/10 v1.2 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 345777e41d8..94b8839bea3 100644
--- a/Master/texmf-dist/tex/generic/xint/xinttools.sty
+++ b/Master/texmf-dist/tex/generic/xint/xinttools.sty
@@ -21,7 +21,7 @@
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%% ---------------------------------------------------------------
-%% The xint bundle v1.1c 2015/09/12
+%% The xint bundle v1.2 2015/10/10
%% Copyright (C) 2013-2015 by Jean-Francois Burnol
%% xinttools: Expandable and non-expandable utilities
%% ---------------------------------------------------------------
@@ -70,7 +70,7 @@
\XINTsetupcatcodes% defined in xintkernel.sty
\XINT_providespackage
\ProvidesPackage{xinttools}%
- [2015/09/12 v1.1c Expandable and non-expandable utilities (jfB)]%
+ [2015/10/10 v1.2 Expandable and non-expandable utilities (jfB)]%
\newtoks\XINT_toks
\xint_firstofone{\let\XINT_sptoken= } %<- space here!
\def\xintgodef {\global\xintodef }%