summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/xint/xint.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/generic/xint/xint.sty')
-rw-r--r--Master/texmf-dist/tex/generic/xint/xint.sty566
1 files changed, 285 insertions, 281 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
%%