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.sty644
1 files changed, 354 insertions, 290 deletions
diff --git a/Master/texmf-dist/tex/generic/xint/xint.sty b/Master/texmf-dist/tex/generic/xint/xint.sty
index 96aa0c6fcad..d51548b4f59 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 (version 1.09h of November 28, 2013)
+%% The xint bundle (version 1.09i of December 18, 2013)
%% xint: Expandable operations on long numbers
%% Copyright (C) 2013 by Jean-Francois Burnol
%%----------------------------------------------------------------
@@ -103,10 +103,13 @@
\XINTsetupcatcodes%
\XINT_providespackage
\ProvidesPackage{xint}%
- [2013/11/28 v1.09h Expandable operations on long numbers (jfB)]%
+ [2013/12/18 v1.09i Expandable operations on long numbers (jfB)]%
\long\def\xint_firstofthree #1#2#3{#1}%
\long\def\xint_secondofthree #1#2#3{#2}%
\long\def\xint_thirdofthree #1#2#3{#3}%
+\long\def\xint_firstofthree_afterstop #1#2#3{ #1}% 1.09i
+\long\def\xint_secondofthree_afterstop #1#2#3{ #2}%
+\long\def\xint_thirdofthree_afterstop #1#2#3{ #3}%
\def\xint_gob_til_zero #10{}%
\def\xint_gob_til_zeros_iii #1000{}%
\def\xint_gob_til_zeros_iv #10000{}%
@@ -114,15 +117,16 @@
\def\xint_gob_til_G #1G{}%
\def\xint_gob_til_minus #1-{}%
\def\xint_gob_til_relax #1\relax {}%
-\def\xint_exchangetwo_keepbraces_andstop #1#2{ {#2}{#1}}%
-\def\xint_UDzerofork #10\dummy #2#3\krof {#2}%
-\def\xint_UDsignfork #1-\dummy #2#3\krof {#2}%
-\def\xint_UDwfork #1\W\dummy #2#3\krof {#2}%
-\def\xint_UDzerosfork #100\dummy #2#3\krof {#2}%
-\def\xint_UDonezerofork #110\dummy #2#3\krof {#2}%
-\def\xint_UDzerominusfork #10-\dummy #2#3\krof {#2}%
-\def\xint_UDsignsfork #1--\dummy #2#3\krof {#2}%
-\chardef\xint_c_i 1 % 0 and 8 in xinttools
+\def\xint_exchangetwo_keepbraces #1#2{{#2}{#1}}%
+\def\xint_exchangetwo_keepbraces_afterstop #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_UDzerominusfork #10-#2#3\krof {#2}%
+\def\xint_UDsignsfork #1--#2#3\krof {#2}%
+\chardef\xint_c_i 1
\chardef\xint_c_ii 2
\chardef\xint_c_iii 3
\chardef\xint_c_iv 4
@@ -142,8 +146,8 @@
\def\XINT_rev_fork #1%
{%
\xint_UDsignfork
- #1\dummy {\expandafter\xint_minus_andstop\romannumeral0\XINT_rord_main {}}%
- -\dummy {\XINT_rord_main {}#1}%
+ #1{\expandafter\xint_minus_afterstop\romannumeral0\XINT_rord_main {}}%
+ -{\XINT_rord_main {}#1}%
\krof
}%
\def\xintLen {\romannumeral0\xintlen }%
@@ -163,8 +167,8 @@
{%
\expandafter\XINT_length_loop
\xint_UDsignfork
- #1\dummy {{0}}%
- -\dummy {{0}#1}%
+ #1{{0}}%
+ -{{0}#1}%
\krof
}%
\def\XINT_RQ #1#2#3#4#5#6#7#8#9%
@@ -252,9 +256,9 @@
\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_cleanupzeros_andstop #1#2#3#4%
+\edef\xint_cleanupzeros_andstop #1#2#3#4%
{%
- \expandafter\space\the\numexpr #1#2#3#4\relax
+ \noexpand\expandafter\space\noexpand\the\numexpr #1#2#3#4\relax
}%
\def\xint_cleanupzeros_nospace #1#2#3#4%
{%
@@ -283,9 +287,9 @@
{%
\xint_cuz_end_b #2%
}%
-\def\xint_cuz_end_b #1#2#3#4#5\Z
+\edef\xint_cuz_end_b #1#2#3#4#5\Z
{%
- \expandafter\space\the\numexpr #1#2#3#4\relax
+ \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%
@@ -298,8 +302,8 @@
}%
\def\XINT_cuz_stop #1\W #2\Z{ #1}%
\def\xint_cuz_backtoloop 0\XINT_cuz_stop 0{\XINT_cuz_loop }%
-\def\xintIsOne {\romannumeral0\xintisone }%
-\def\xintisone #1{\expandafter\XINT_isone \romannumeral0\xintnum{#1}\W\Z }%
+\def\xintIsOne {\romannumeral0\xintisone }%
+\def\xintisone #1{\expandafter\XINT_isone\romannumeral0\xintnum{#1}\W\Z }%
\def\XINT_isOne #1{\romannumeral0\XINT_isone #1\W\Z }%
\def\XINT_isone #1#2%
{%
@@ -330,9 +334,9 @@
\xint_gob_til_xint_relax #8\XINT_num_end\xint_relax
\XINT_num_NumEight #1#2#3#4#5#6#7#8%
}%
-\def\XINT_num_end\xint_relax\XINT_num_NumEight #1\xint_relax #2\Z
+\edef\XINT_num_end\xint_relax\XINT_num_NumEight #1\xint_relax #2\Z
{%
- \expandafter\space\the\numexpr #1+0\relax
+ \noexpand\expandafter\space\noexpand\the\numexpr #1+0\relax
}%
\def\XINT_num_NumEight #1#2#3#4#5#6#7#8%
{%
@@ -361,13 +365,28 @@
{%
\expandafter\XINT_sgn \romannumeral0\xintnum{#1}\Z%
}%
-\def\XINT_Sgn #1{\romannumeral0\XINT_sgn #1\Z }%
\def\XINT_sgn #1#2\Z
{%
\xint_UDzerominusfork
- #1-\dummy { 0}%
- 0#1\dummy { -1}%
- 0-\dummy { 1}%
+ #1-{ 0}%
+ 0#1{ -1}%
+ 0-{ 1}%
+ \krof
+}%
+\def\XINT_Sgn #1#2\Z
+{%
+ \xint_UDzerominusfork
+ #1-{0}%
+ 0#1{-1}%
+ 0-{1}%
+ \krof
+}%
+\def\XINT__Sgn #1#2\Z
+{%
+ \xint_UDzerominusfork
+ #1-\z@
+ 0#1\m@ne
+ 0-\@ne
\krof
}%
\def\xintBool #1{\romannumeral-`0%
@@ -376,80 +395,98 @@
\def\xintSgnFork {\romannumeral0\xintsgnfork }%
\def\xintsgnfork #1%
{%
- \ifcase #1 \xint_afterfi{\expandafter\space\xint_secondofthree}%
- \or\xint_afterfi{\expandafter\space\xint_thirdofthree}%
- \else\xint_afterfi{\expandafter\space\xint_firstofthree}%
+ \ifcase #1 \expandafter\xint_secondofthree_afterstop
+ \or\expandafter\xint_thirdofthree_afterstop
+ \else\expandafter\xint_firstofthree_afterstop
+ \fi
+}%
+\def\XINT__SgnFork #1%
+{%
+ \ifcase #1\expandafter\xint_secondofthree
+ \or\expandafter\xint_thirdofthree
+ \else\expandafter\xint_firstofthree
\fi
}%
\def\xintifSgn {\romannumeral0\xintifsgn }%
\def\xintifsgn #1%
{%
\ifcase \romannumeral0\xintsgn{#1}
- \xint_afterfi{\expandafter\space\xint_secondofthree}%
- \or\xint_afterfi{\expandafter\space\xint_thirdofthree}%
- \else\xint_afterfi{\expandafter\space\xint_firstofthree}%
+ \expandafter\xint_secondofthree_afterstop
+ \or\expandafter\xint_thirdofthree_afterstop
+ \else\expandafter\xint_firstofthree_afterstop
\fi
}%
\def\xintifZero {\romannumeral0\xintifzero }%
\def\xintifzero #1%
{%
- \if\xintSgn{\xintAbs{#1}}0%
- \xint_afterfi{\expandafter\space\xint_firstoftwo}%
+ \if0\xintSgn{#1}%
+ \expandafter\xint_firstoftwo_afterstop
\else
- \xint_afterfi{\expandafter\space\xint_secondoftwo}%
+ \expandafter\xint_secondoftwo_afterstop
\fi
}%
\def\xintifNotZero {\romannumeral0\xintifnotzero }%
\def\xintifnotzero #1%
{%
- \if\xintSgn{\xintAbs{#1}}1%
- \xint_afterfi{\expandafter\space\xint_firstoftwo}%
+ \if0\xintSgn{#1}%
+ \expandafter\xint_secondoftwo_afterstop
\else
- \xint_afterfi{\expandafter\space\xint_secondoftwo}%
+ \expandafter\xint_firstoftwo_afterstop
\fi
}%
+\def\xintifOne {\romannumeral0\xintifone }%
+\def\xintifone #1%
+{%
+ \if1\xintIsOne{#1}%
+ \expandafter\xint_firstoftwo_afterstop
+ \else
+ \expandafter\xint_secondoftwo_afterstop
+ \fi
+}%
+\let\xintifTrueAelseB\xintifNotZero
+\let\xintifFalseAelseB\xintifZero
\let\xintifTrue\xintifNotZero
\let\xintifTrueFalse\xintifNotZero
\def\xintifCmp {\romannumeral0\xintifcmp }%
\def\xintifcmp #1#2%
{%
- \ifcase \xintCmp {#1}{#2}
- \xint_afterfi{\expandafter\space\xint_secondofthree}%
- \or\xint_afterfi{\expandafter\space\xint_thirdofthree}%
- \else\xint_afterfi{\expandafter\space\xint_firstofthree}%
+ \ifcase\xintCmp {#1}{#2}
+ \expandafter\xint_secondofthree_afterstop
+ \or\expandafter\xint_thirdofthree_afterstop
+ \else\expandafter\xint_firstofthree_afterstop
\fi
}%
\def\xintifEq {\romannumeral0\xintifeq }%
\def\xintifeq #1#2%
{%
- \if\xintCmp{#1}{#2}0%
- \xint_afterfi{\expandafter\space\xint_firstoftwo}%
- \else\xint_afterfi{\expandafter\space\xint_secondoftwo}%
+ \if0\xintCmp{#1}{#2}%
+ \expandafter\xint_firstoftwo_afterstop
+ \else\expandafter\xint_secondoftwo_afterstop
\fi
}%
\def\xintifGt {\romannumeral0\xintifgt }%
\def\xintifgt #1#2%
{%
- \if\xintCmp{#1}{#2}1%
- \xint_afterfi{\expandafter\space\xint_firstoftwo}%
- \else\xint_afterfi{\expandafter\space\xint_secondoftwo}%
+ \if1\xintCmp{#1}{#2}%
+ \expandafter\xint_firstoftwo_afterstop
+ \else\expandafter\xint_secondoftwo_afterstop
\fi
}%
\def\xintifLt {\romannumeral0\xintiflt }%
\def\xintiflt #1#2%
{%
- \xintSgnFork{\xintCmp{#1}{#2}}%
- {\expandafter\space\xint_firstoftwo}%
- {\expandafter\space\xint_secondoftwo}%
- {\expandafter\space\xint_secondoftwo}%
+ \ifnum\xintCmp{#1}{#2}<\xint_c_
+ \expandafter\xint_firstoftwo_afterstop
+ \else \expandafter\xint_secondoftwo_afterstop
+ \fi
}%
\def\xintifOdd {\romannumeral0\xintifodd }%
\def\xintifodd #1%
{%
\if\xintOdd{#1}1%
- \xint_afterfi{\expandafter\space\xint_firstoftwo}%
+ \expandafter\xint_firstoftwo_afterstop
\else
- \xint_afterfi{\expandafter\space\xint_secondoftwo}%
+ \expandafter\xint_secondoftwo_afterstop
\fi
}%
\def\xintiiOpp {\romannumeral0\xintiiopp }%
@@ -467,9 +504,9 @@
\def\XINT_opp #1%
{%
\xint_UDzerominusfork
- #1-\dummy { 0}% zero
- 0#1\dummy { }% negative
- 0-\dummy { -#1}% positive
+ #1-{ 0}% zero
+ 0#1{ }% negative
+ 0-{ -#1}% positive
\krof
}%
\def\xintiiAbs {\romannumeral0\xintiiabs }%
@@ -487,8 +524,8 @@
\def\XINT_abs #1%
{%
\xint_UDsignfork
- #1\dummy { }%
- -\dummy { #1}%
+ #1{ }%
+ -{ #1}%
\krof
}%
\def\XINT_add_A #1#2#3#4#5#6%
@@ -680,8 +717,8 @@
\XINT_addm_end #1#3%
}%
\def\xint_addm_cz\W\XINT_addm_CD #1#2#3{\XINT_addm_end #1#3}%
-\def\XINT_addm_end #1#2#3#4#5%
- {\expandafter\space\the\numexpr #1#2#3#4#5\relax}%
+\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
@@ -837,14 +874,14 @@
\def\XINT_add_fork #1#2\Z #3#4\Z
{%
\xint_UDzerofork
- #1\dummy \XINT_add_secondiszero
- #3\dummy \XINT_add_firstiszero
- 0\dummy
+ #1\XINT_add_secondiszero
+ #3\XINT_add_firstiszero
+ 0
{\xint_UDsignsfork
- #1#3\dummy \XINT_add_minusminus % #1 = #3 = -
- #1-\dummy \XINT_add_minusplus % #1 = -
- #3-\dummy \XINT_add_plusminus % #3 = -
- --\dummy \XINT_add_plusplus
+ #1#3\XINT_add_minusminus % #1 = #3 = -
+ #1-\XINT_add_minusplus % #1 = -
+ #3-\XINT_add_plusminus % #3 = -
+ --\XINT_add_plusplus
\krof }%
\krof
{#2}{#4}#1#3%
@@ -853,7 +890,7 @@
\def\XINT_add_firstiszero #1#2#3#4{ #3#1}%
\def\XINT_add_minusminus #1#2#3#4%
{%
- \expandafter\xint_minus_andstop%
+ \expandafter\xint_minus_afterstop%
\romannumeral0\XINT_add_pre {#2}{#1}%
}%
\def\XINT_add_minusplus #1#2#3#4%
@@ -904,13 +941,13 @@
\def\XINT_sub_fork #1#2\Z #3#4\Z
{%
\xint_UDsignsfork
- #1#3\dummy \XINT_sub_minusminus
- #1-\dummy \XINT_sub_minusplus % attention, #3=0 possible
- #3-\dummy \XINT_sub_plusminus % attention, #1=0 possible
- --\dummy {\xint_UDzerofork
- #1\dummy \XINT_sub_secondiszero
- #3\dummy \XINT_sub_firstiszero
- 0\dummy \XINT_sub_plusplus
+ #1#3\XINT_sub_minusminus
+ #1-\XINT_sub_minusplus % attention, #3=0 possible
+ #3-\XINT_sub_plusminus % attention, #1=0 possible
+ --{\xint_UDzerofork
+ #1\XINT_sub_secondiszero
+ #3\XINT_sub_firstiszero
+ 0\XINT_sub_plusplus
\krof }%
\krof
{#2}{#4}#1#3%
@@ -932,7 +969,7 @@
\def\xint_sub_mp0\XINT_add_pre #1#2{ #2}%
\def\XINT_sub_plusminus #1#2#3#4%
{%
- \xint_gob_til_zero #3\xint_sub_pm0\expandafter\xint_minus_andstop%
+ \xint_gob_til_zero #3\xint_sub_pm0\expandafter\xint_minus_afterstop%
\romannumeral0\XINT_add_pre {#2}{#3#1}%
}%
\def\xint_sub_pm #1\XINT_add_pre #2#3{ -#2}%
@@ -972,8 +1009,8 @@
\W\XINT_sub_onestep #1#2#3#4#5#6#7%
{%
\xint_UDzerofork
- #1\dummy \XINT_sub_C % une retenue
- 0\dummy \XINT_sub_D % pas de retenue
+ #1\XINT_sub_C % une retenue
+ 0\XINT_sub_D % pas de retenue
\krof
{#7}#2#3#4#5%
}%
@@ -1057,13 +1094,13 @@
\def\xint_sub_F\W\XINT_sub_Eonestep #1#2#3#4%
{%
\xint_UDonezerofork
- #4#1\dummy {\XINT_sub_Fdec 0}% soustraire 1. Et faire signe -
- #1#4\dummy {\XINT_sub_Finc 1}% additionner 1. Et faire signe -
- 10\dummy \XINT_sub_DD % terminer. Mais avec signe -
+ #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}%
}%
-\def\XINT_sub_DD {\expandafter\xint_minus_andstop\romannumeral0\XINT_sub_D }%
+\def\XINT_sub_DD {\expandafter\xint_minus_afterstop\romannumeral0\XINT_sub_D }%
\def\XINT_sub_Fdec #1#2#3#4#5#6%
{%
\xint_gob_til_W #3\xint_sub_Fdec_finish\W
@@ -1079,7 +1116,7 @@
}%
\def\xint_sub_Fdec_finish\W\XINT_sub_Fdec_onestep #1#2%
{%
- \expandafter\xint_minus_andstop\romannumeral0\XINT_cuz
+ \expandafter\xint_minus_afterstop\romannumeral0\XINT_cuz
}%
\def\XINT_sub_Finc #1#2#3#4#5#6%
{%
@@ -1097,16 +1134,16 @@
\def\xint_sub_Finc_finish\W\XINT_sub_Finc_onestep #1#2#3%
{%
\xint_UDzerofork
- #1\dummy {\expandafter\xint_minus_andstop\xint_cleanupzeros_nospace}%
- 0\dummy { -1}%
+ #1{\expandafter\xint_minus_afterstop\xint_cleanupzeros_nospace}%
+ 0{ -1}%
\krof
#3%
}%
\def\xint_sub_ez\W\XINT_sub_Eenter #1%
{%
\xint_UDzerofork
- #1\dummy \XINT_sub_K % il y a une retenue
- 0\dummy \XINT_sub_L % pas de retenue
+ #1\XINT_sub_K % il y a une retenue
+ 0\XINT_sub_L % pas de retenue
\krof
}%
\def\XINT_sub_L #1\W\X\Y\Z {\XINT_cuz_loop #1\W\W\W\W\W\W\W\Z }%
@@ -1136,7 +1173,7 @@
}%
\def\xint_sub_KK_finish\W\XINT_sub_KK_onestep #1#2#3%
{%
- \expandafter\xint_minus_andstop
+ \expandafter\xint_minus_afterstop
\romannumeral0\XINT_cuz_loop #3\W\W\W\W\W\W\W\Z
}%
\def\xintCmp {\romannumeral0\xintcmp }%
@@ -1152,14 +1189,14 @@
\def\XINT_cmp_fork #1#2\Z #3#4\Z
{%
\xint_UDsignsfork
- #1#3\dummy \XINT_cmp_minusminus
- #1-\dummy \XINT_cmp_minusplus
- #3-\dummy \XINT_cmp_plusminus
- --\dummy {\xint_UDzerosfork
- #1#3\dummy \XINT_cmp_zerozero
- #10\dummy \XINT_cmp_zeroplus
- #30\dummy \XINT_cmp_pluszero
- 00\dummy \XINT_cmp_plusplus
+ #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 }%
\krof
{#2}{#4}#1#3%
@@ -1217,8 +1254,8 @@
\def\xint_cmp_ez\W\XINT_cmp_Eenter #1%
{%
\xint_UDzerofork
- #1\dummy \XINT_cmp_K % il y a une retenue
- 0\dummy \XINT_cmp_L % pas de retenue
+ #1\XINT_cmp_K % il y a une retenue
+ 0\XINT_cmp_L % pas de retenue
\krof
}%
\def\XINT_cmp_K #1\Z { -1}%
@@ -1252,45 +1289,48 @@
\def\xintLt {\romannumeral0\xintlt }%
\def\xintlt #1#2{\xintiflt{#1}{#2}{1}{0}}%
\def\xintIsZero {\romannumeral0\xintiszero }%
-\def\xintiszero #1{\xintifsgn {#1}{0}{1}{0}}%
+\def\xintiszero #1{\if0\xintSgn{#1}\xint_afterfi{ 1}\else\xint_afterfi{ 0}\fi}%
\def\xintIsNotZero {\romannumeral0\xintisnotzero }%
-\def\xintisnotzero #1{\xintifsgn {#1}{1}{0}{1}}%
+\def\xintisnotzero
+ #1{\if0\xintSgn{#1}\xint_afterfi{ 0}\else\xint_afterfi{ 1}\fi}%
\let\xintIsTrue\xintIsNotZero
\let\xintNot\xintIsZero
+\let\xintIsFalse\xintIsZero
\def\xintIsTrue:csv #1{\expandafter\XINT_istrue:_a\romannumeral-`0#1,,^}%
\def\XINT_istrue:_a {\XINT_istrue:_b {}}%
\def\XINT_istrue:_b #1#2,%
{\expandafter\XINT_istrue:_c\romannumeral-`0#2,{#1}}%
-\def\XINT_istrue:_c #1{\if #1,\expandafter\XINT_istrue:_f
+\def\XINT_istrue:_c #1{\if #1,\expandafter\XINT_:_f
\else\expandafter\XINT_istrue:_d\fi #1}%
\def\XINT_istrue:_d #1,%
{\expandafter\XINT_istrue:_e\romannumeral0\xintisnotzero {#1},}%
\def\XINT_istrue:_e #1,#2{\XINT_istrue:_b {#2,#1}}%
-\def\XINT_istrue:_f ,#1#2^{\xint_gobble_i #1}%
+\def\XINT_:_f ,#1#2^{\xint_gobble_i #1}%
\def\xintAND {\romannumeral0\xintand }%
-\def\xintand #1#2{\xintifzero {#1}{0}{\xintifzero {#2}{0}{1}}}%
+\def\xintand #1#2{\if0\xintSgn{#1}\expandafter\xint_firstoftwo
+ \else\expandafter\xint_secondoftwo\fi
+ { 0}{\xintisnotzero{#2}}}%
\def\xintOR {\romannumeral0\xintor }%
-\def\xintor #1#2{\xintifzero {#1}{\xintifzero {#2}{0}{1}}{1}}%
+\def\xintor #1#2{\if0\xintSgn{#1}\expandafter\xint_firstoftwo
+ \else\expandafter\xint_secondoftwo\fi
+ {\xintisnotzero{#2}}{ 1}}%
\def\xintXOR {\romannumeral0\xintxor }%
-\def\xintxor #1#2{\ifcase \numexpr\xintIsZero{#1}+\xintIsZero{#2}\relax
- \xint_afterfi{ 0}%
- \or\xint_afterfi{ 1}%
- \else\xint_afterfi { 0}%
- \fi }%
+\def\xintxor #1#2{\if\xintIsZero{#1}\xintIsZero{#2}%
+ \xint_afterfi{ 0}\else\xint_afterfi{ 1}\fi }%
\def\xintANDof {\romannumeral0\xintandof }%
\def\xintandof #1{\expandafter\XINT_andof_a\romannumeral-`0#1\relax }%
\def\XINT_andof_a #1{\expandafter\XINT_andof_b\romannumeral-`0#1\Z }%
\def\XINT_andof_b #1%
{\xint_gob_til_relax #1\XINT_andof_e\relax\XINT_andof_c #1}%
\def\XINT_andof_c #1\Z
- {\xintifZero{#1}{\XINT_andof_no}{\XINT_andof_a}}%
+ {\xintifTrueAelseB {#1}{\XINT_andof_a}{\XINT_andof_no}}%
\def\XINT_andof_no #1\relax { 0}%
\def\XINT_andof_e #1\Z { 1}%
\def\xintANDof:csv #1{\expandafter\XINT_andof:_a\romannumeral-`0#1,,^}%
\def\XINT_andof:_a {\expandafter\XINT_andof:_b\romannumeral-`0}%
\def\XINT_andof:_b #1{\if #1,\expandafter\XINT_andof:_e
\else\expandafter\XINT_andof:_c\fi #1}%
-\def\XINT_andof:_c #1,{\xintifZero{#1}{\XINT_andof:_no}{\XINT_andof:_a}}%
+\def\XINT_andof:_c #1,{\xintifTrueAelseB {#1}{\XINT_andof:_a}{\XINT_andof:_no}}%
\def\XINT_andof:_no #1^{0}%
\def\XINT_andof:_e #1^{1}%
\def\xintORof {\romannumeral0\xintorof }%
@@ -1299,14 +1339,14 @@
\def\XINT_orof_b #1%
{\xint_gob_til_relax #1\XINT_orof_e\relax\XINT_orof_c #1}%
\def\XINT_orof_c #1\Z
- {\xintifZero{#1}{\XINT_orof_a}{\XINT_orof_yes}}%
+ {\xintifTrueAelseB {#1}{\XINT_orof_yes}{\XINT_orof_a}}%
\def\XINT_orof_yes #1\relax { 1}%
\def\XINT_orof_e #1\Z { 0}%
\def\xintORof:csv #1{\expandafter\XINT_orof:_a\romannumeral-`0#1,,^}%
\def\XINT_orof:_a {\expandafter\XINT_orof:_b\romannumeral-`0}%
\def\XINT_orof:_b #1{\if #1,\expandafter\XINT_orof:_e
\else\expandafter\XINT_orof:_c\fi #1}%
-\def\XINT_orof:_c #1,{\xintifZero{#1}{\XINT_orof:_a}{\XINT_orof:_yes}}%
+\def\XINT_orof:_c #1,{\xintifTrueAelseB{#1}{\XINT_orof:_yes}{\XINT_orof:_a}}%
\def\XINT_orof:_yes #1^{1}%
\def\XINT_orof:_e #1^{0}%
\def\xintXORof {\romannumeral0\xintxorof }%
@@ -1316,26 +1356,22 @@
\def\XINT_xorof_b #1%
{\xint_gob_til_relax #1\XINT_xorof_e\relax\XINT_xorof_c #1}%
\def\XINT_xorof_c #1\Z #2%
- {\xintifZero {#1}{\XINT_xorof_a #2}{\ifcase #2
- \xint_afterfi{\XINT_xorof_a 1}%
- \else
- \xint_afterfi{\XINT_xorof_a 0}%
- \fi }%
+ {\xintifTrueAelseB {#1}{\if #20\xint_afterfi{\XINT_xorof_a 1}%
+ \else\xint_afterfi{\XINT_xorof_a 0}\fi}%
+ {\XINT_xorof_a #2}%
}%
\def\XINT_xorof_e #1\Z #2{ #2}%
\def\xintXORof:csv #1{\expandafter\XINT_xorof:_a\expandafter
0\romannumeral-`0#1,,^}%
\def\XINT_xorof:_a #1#2,{\expandafter\XINT_xorof:_b\romannumeral-`0#2,#1}%
-\def\XINT_xorof:_b #1{\if #1,\expandafter\XINT_xorof:_e
+\def\XINT_xorof:_b #1{\if #1,\expandafter\XINT_:_e
\else\expandafter\XINT_xorof:_c\fi #1}%
\def\XINT_xorof:_c #1,#2%
- {\xintifZero {#1}{\XINT_xorof:_a #2}{\ifcase #2
- \xint_afterfi{\XINT_xorof:_a 1}%
- \else
- \xint_afterfi{\XINT_xorof:_a 0}%
- \fi }%
+ {\xintifTrueAelseB {#1}{\if #20\xint_afterfi{\XINT_xorof:_a 1}%
+ \else\xint_afterfi{\XINT_xorof:_a 0}\fi}%
+ {\XINT_xorof:_a #2}%
}%
-\def\XINT_xorof:_e ,#1#2^{#1}% allows empty list
+\def\XINT_:_e ,#1#2^{#1}% allows empty list
\def\xintGeq {\romannumeral0\xintgeq }%
\def\xintgeq #1%
{%
@@ -1349,13 +1385,13 @@
\def\XINT_geq_fork #1#2\Z #3#4\Z
{%
\xint_UDzerofork
- #1\dummy \XINT_geq_secondiszero % |#1#2|=0
- #3\dummy \XINT_geq_firstiszero % |#1#2|>0
- 0\dummy {\xint_UDsignsfork
- #1#3\dummy \XINT_geq_minusminus
- #1-\dummy \XINT_geq_minusplus
- #3-\dummy \XINT_geq_plusminus
- --\dummy \XINT_geq_plusplus
+ #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 }%
\krof
{#2}{#4}#1#3%
@@ -1406,8 +1442,8 @@
\def\xint_geq_ez\W\XINT_geq_Eenter #1%
{%
\xint_UDzerofork
- #1\dummy { 0} % il y a une retenue
- 0\dummy { 1} % pas de retenue
+ #1{ 0} % il y a une retenue
+ 0{ 1} % pas de retenue
\krof
}%
\def\xintiMax {\romannumeral0\xintimax }%
@@ -1425,37 +1461,37 @@
\def\XINT_max_fork #1#2\Z #3#4\Z
{%
\xint_UDsignsfork
- #1#3\dummy \XINT_max_minusminus % A < 0, B < 0
- #1-\dummy \XINT_max_minusplus % B < 0, A >= 0
- #3-\dummy \XINT_max_plusminus % A < 0, B >= 0
- --\dummy {\xint_UDzerosfork
- #1#3\dummy \XINT_max_zerozero % A = B = 0
- #10\dummy \XINT_max_zeroplus % B = 0, A > 0
- #30\dummy \XINT_max_pluszero % A = 0, B > 0
- 00\dummy \XINT_max_plusplus % A, B > 0
+ #1#3\XINT_max_minusminus % A < 0, B < 0
+ #1-\XINT_max_minusplus % B < 0, A >= 0
+ #3-\XINT_max_plusminus % A < 0, B >= 0
+ --{\xint_UDzerosfork
+ #1#3\XINT_max_zerozero % A = B = 0
+ #10\XINT_max_zeroplus % B = 0, A > 0
+ #30\XINT_max_pluszero % A = 0, B > 0
+ 00\XINT_max_plusplus % A, B > 0
\krof }%
\krof
{#2}{#4}#1#3%
}%
-\def\XINT_max_zerozero #1#2#3#4{\xint_firstoftwo_andstop }%
-\def\XINT_max_zeroplus #1#2#3#4{\xint_firstoftwo_andstop }%
-\def\XINT_max_pluszero #1#2#3#4{\xint_secondoftwo_andstop }%
-\def\XINT_max_minusplus #1#2#3#4{\xint_firstoftwo_andstop }%
-\def\XINT_max_plusminus #1#2#3#4{\xint_secondoftwo_andstop }%
+\def\XINT_max_zerozero #1#2#3#4{\xint_firstoftwo_afterstop }%
+\def\XINT_max_zeroplus #1#2#3#4{\xint_firstoftwo_afterstop }%
+\def\XINT_max_pluszero #1#2#3#4{\xint_secondoftwo_afterstop }%
+\def\XINT_max_minusplus #1#2#3#4{\xint_firstoftwo_afterstop }%
+\def\XINT_max_plusminus #1#2#3#4{\xint_secondoftwo_afterstop }%
\def\XINT_max_plusplus #1#2#3#4%
{%
\ifodd\XINT_Geq {#4#2}{#3#1}
- \expandafter\xint_firstoftwo_andstop
+ \expandafter\xint_firstoftwo_afterstop
\else
- \expandafter\xint_secondoftwo_andstop
+ \expandafter\xint_secondoftwo_afterstop
\fi
}%
\def\XINT_max_minusminus #1#2#3#4%
{%
\ifodd\XINT_Geq {#1}{#2}
- \expandafter\xint_firstoftwo_andstop
+ \expandafter\xint_firstoftwo_afterstop
\else
- \expandafter\xint_secondoftwo_andstop
+ \expandafter\xint_secondoftwo_afterstop
\fi
}%
\def\xintiMaxof {\romannumeral0\xintimaxof }%
@@ -1469,6 +1505,12 @@
{\expandafter\XINT_imaxof_b\romannumeral0\xintimax {#1}}%
\def\XINT_imaxof_e #1\Z #2\Z { #2}%
\let\xintMaxof\xintiMaxof \let\xintmaxof\xintimaxof
+\def\xintiMaxof:csv #1{\expandafter\XINT_imaxof:_b\romannumeral-`0#1,,}%
+\def\XINT_imaxof:_b #1,#2,{\expandafter\XINT_imaxof:_c\romannumeral-`0#2,{#1},}%
+\def\XINT_imaxof:_c #1{\if #1,\expandafter\XINT_of:_e
+ \else\expandafter\XINT_imaxof:_d\fi #1}%
+\def\XINT_imaxof:_d #1,{\expandafter\XINT_imaxof:_b\romannumeral0\xintimax {#1}}%
+\def\XINT_of:_e ,#1,{#1}%
\def\xintiMin {\romannumeral0\xintimin }%
\def\xintimin #1%
{%
@@ -1484,37 +1526,37 @@
\def\XINT_min_fork #1#2\Z #3#4\Z
{%
\xint_UDsignsfork
- #1#3\dummy \XINT_min_minusminus % A < 0, B < 0
- #1-\dummy \XINT_min_minusplus % B < 0, A >= 0
- #3-\dummy \XINT_min_plusminus % A < 0, B >= 0
- --\dummy {\xint_UDzerosfork
- #1#3\dummy \XINT_min_zerozero % A = B = 0
- #10\dummy \XINT_min_zeroplus % B = 0, A > 0
- #30\dummy \XINT_min_pluszero % A = 0, B > 0
- 00\dummy \XINT_min_plusplus % A, B > 0
+ #1#3\XINT_min_minusminus % A < 0, B < 0
+ #1-\XINT_min_minusplus % B < 0, A >= 0
+ #3-\XINT_min_plusminus % A < 0, B >= 0
+ --{\xint_UDzerosfork
+ #1#3\XINT_min_zerozero % A = B = 0
+ #10\XINT_min_zeroplus % B = 0, A > 0
+ #30\XINT_min_pluszero % A = 0, B > 0
+ 00\XINT_min_plusplus % A, B > 0
\krof }%
\krof
{#2}{#4}#1#3%
}%
-\def\XINT_min_zerozero #1#2#3#4{\xint_firstoftwo_andstop }%
-\def\XINT_min_zeroplus #1#2#3#4{\xint_secondoftwo_andstop }%
-\def\XINT_min_pluszero #1#2#3#4{\xint_firstoftwo_andstop }%
-\def\XINT_min_minusplus #1#2#3#4{\xint_secondoftwo_andstop }%
-\def\XINT_min_plusminus #1#2#3#4{\xint_firstoftwo_andstop }%
+\def\XINT_min_zerozero #1#2#3#4{\xint_firstoftwo_afterstop }%
+\def\XINT_min_zeroplus #1#2#3#4{\xint_secondoftwo_afterstop }%
+\def\XINT_min_pluszero #1#2#3#4{\xint_firstoftwo_afterstop }%
+\def\XINT_min_minusplus #1#2#3#4{\xint_secondoftwo_afterstop }%
+\def\XINT_min_plusminus #1#2#3#4{\xint_firstoftwo_afterstop }%
\def\XINT_min_plusplus #1#2#3#4%
{%
\ifodd\XINT_Geq {#4#2}{#3#1}
- \expandafter\xint_secondoftwo_andstop
+ \expandafter\xint_secondoftwo_afterstop
\else
- \expandafter\xint_firstoftwo_andstop
+ \expandafter\xint_firstoftwo_afterstop
\fi
}%
\def\XINT_min_minusminus #1#2#3#4%
{%
\ifodd\XINT_Geq {#1}{#2}
- \expandafter\xint_secondoftwo_andstop
+ \expandafter\xint_secondoftwo_afterstop
\else
- \expandafter\xint_firstoftwo_andstop
+ \expandafter\xint_firstoftwo_afterstop
\fi
}%
\def\xintiMinof {\romannumeral0\xintiminof }%
@@ -1528,6 +1570,11 @@
{\expandafter\XINT_iminof_b\romannumeral0\xintimin {#1}}%
\def\XINT_iminof_e #1\Z #2\Z { #2}%
\let\xintMinof\xintiMinof \let\xintminof\xintiminof
+\def\xintiMinof:csv #1{\expandafter\XINT_iminof:_b\romannumeral-`0#1,,}%
+\def\XINT_iminof:_b #1,#2,{\expandafter\XINT_iminof:_c\romannumeral-`0#2,{#1},}%
+\def\XINT_iminof:_c #1{\if #1,\expandafter\XINT_of:_e
+ \else\expandafter\XINT_iminof:_d\fi #1}%
+\def\XINT_iminof:_d #1,{\expandafter\XINT_iminof:_b\romannumeral0\xintimin {#1}}%
\def\xintiiSum {\romannumeral0\xintiisum }%
\def\xintiisum #1{\xintiisumexpr #1\relax }%
\def\xintiiSumExpr {\romannumeral0\xintiisumexpr }%
@@ -1544,8 +1591,8 @@
\xint_gob_til_relax #1\XINT_sum_finished\relax
\xint_gob_til_zero #1\XINT_sum_skipzeroinput0%
\xint_UDsignfork
- #1\dummy \XINT_sum_N
- -\dummy {\XINT_sum_P #1}%
+ #1\XINT_sum_N
+ -{\XINT_sum_P #1}%
\krof
}%
\def\XINT_sum_finished #1\Z #2#3%
@@ -1570,6 +1617,13 @@
\W\X\Y\Z #3\W\X\Y\Z }{#2}%
}%
\def\XINT_sum_NN #1#2{\XINT_sum_loop {#2}{#1}}%
+\def\xintiiSum:csv #1{\expandafter\XINT_iisum:_a\romannumeral-`0#1,,^}%
+\def\XINT_iisum:_a {\XINT_iisum:_b {0}}%
+\def\XINT_iisum:_b #1#2,{\expandafter\XINT_iisum:_c\romannumeral-`0#2,{#1}}%
+\def\XINT_iisum:_c #1{\if #1,\expandafter\XINT_:_e
+ \else\expandafter\XINT_iisum:_d\fi #1}%
+\def\XINT_iisum:_d #1,#2{\expandafter\XINT_iisum:_b\expandafter
+ {\romannumeral0\xintiiadd {#2}{#1}}}%
\def\xintiiMul {\romannumeral0\xintiimul }%
\def\xintiimul #1%
{%
@@ -1593,14 +1647,13 @@
\def\XINT_mul_fork #1#2\Z #3#4\Z
{%
\xint_UDzerofork
- #1\dummy \XINT_mul_zero
- #3\dummy \XINT_mul_zero
- 0\dummy
- {\xint_UDsignsfork
- #1#3\dummy \XINT_mul_minusminus % #1 = #3 = -
- #1-\dummy {\XINT_mul_minusplus #3}% % #1 = -
- #3-\dummy {\XINT_mul_plusminus #1}% % #3 = -
- --\dummy {\XINT_mul_plusplus #1#3}%
+ #1\XINT_mul_zero
+ #3\XINT_mul_zero
+ 0{\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 }%
\krof
{#2}{#4}%
@@ -1614,14 +1667,14 @@
}%
\def\XINT_mul_minusplus #1#2#3%
{%
- \expandafter\xint_minus_andstop\romannumeral0\expandafter
+ \expandafter\xint_minus_afterstop\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_andstop\romannumeral0\expandafter
+ \expandafter\xint_minus_afterstop\romannumeral0\expandafter
\XINT_mul_choice_a
\expandafter{\romannumeral0\xintlength {#3}}%
{\romannumeral0\xintlength {#1#2}}{#1#2}{#3}%
@@ -1789,9 +1842,9 @@
{%
\XINT_mul_M_end #1#4%
}%
-\def\XINT_mul_M_end #1#2#3#4#5#6#7#8%
+\edef\XINT_mul_M_end #1#2#3#4#5#6#7#8%
{%
- \expandafter\space\the\numexpr #1#2#3#4#5#6#7#8\relax
+ \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%
{%
@@ -1989,6 +2042,13 @@
\expandafter\XINT_prod_loop_a\romannumeral0\XINT_mul_fork
}%
\def\XINT_prod_finished #1\Z #2\Z \Z { #2}%
+\def\xintiiPrd:csv #1{\expandafter\XINT_iiprd:_a\romannumeral-`0#1,,^}%
+\def\XINT_iiprd:_a {\XINT_iiprd:_b {1}}%
+\def\XINT_iiprd:_b #1#2,{\expandafter\XINT_iiprd:_c\romannumeral-`0#2,{#1}}%
+\def\XINT_iiprd:_c #1{\if #1,\expandafter\XINT_:_e
+ \else\expandafter\XINT_iiprd:_d\fi #1}%
+\def\XINT_iiprd:_d #1,#2{\expandafter\XINT_iiprd:_b\expandafter
+ {\romannumeral0\xintiimul {#2}{#1}}}%
\def\xintiFac {\romannumeral0\xintifac }%
\def\xintifac #1%
{%
@@ -1997,7 +2057,7 @@
\let\xintFac\xintiFac \let\xintfac\xintifac
\def\XINT_fac_fork #1%
{%
- \ifcase\XINT_Sgn {#1}
+ \ifcase\XINT__Sgn #1\Z
\xint_afterfi{\expandafter\space\expandafter 1\xint_gobble_i }%
\or
\expandafter\XINT_fac_checklength
@@ -2086,8 +2146,8 @@
\def\xint_pow #1#2\Z
{%
\xint_UDsignfork
- #1\dummy \XINT_pow_Aneg
- -\dummy \XINT_pow_Anonneg
+ #1\XINT_pow_Aneg
+ -\XINT_pow_Anonneg
\krof
#1{#2}%
}%
@@ -2124,7 +2184,7 @@
\def\XINT_pow_AisOne #1#2{ 1}%
\def\XINT_pow_AisZero #1#2%
{%
- \ifcase\XINT_Sgn {#1}
+ \ifcase\XINT__Sgn #1\Z
\xint_afterfi { 1}%
\or
\xint_afterfi { 0}%
@@ -2134,7 +2194,7 @@
}%
\def\XINT_pow_AatleastTwo #1%
{%
- \ifcase\XINT_Sgn {#1}
+ \ifcase\XINT__Sgn #1\Z
\expandafter\XINT_pow_BisZero
\or
\expandafter\XINT_pow_checkBsize
@@ -2143,7 +2203,7 @@
\fi
{#1}%
}%
-\def\XINT_pow_BisNegative #1#2{\xintError:FractionRoundedToZero\space 0}%
+\edef\XINT_pow_BisNegative #1#2{\noexpand\xintError:FractionRoundedToZero\space 0}%
\def\XINT_pow_BisZero #1#2{ 1}%
\def\XINT_pow_checkBsize #1#2%
{%
@@ -2158,8 +2218,8 @@
\xint_bye\xint_bye\xint_bye\xint_bye
\xint_relax
}%
-\def\XINT_pow_BtooBig #1\xint_relax #2\xint_relax
- {\xintError:ExponentTooBig\space 0}%
+\edef\XINT_pow_BtooBig #1\xint_relax #2\xint_relax
+ {\noexpand\xintError:ExponentTooBig\space 0}%
\def\XINT_pow_loop #1#2%
{%
\ifnum #1 = 1
@@ -2221,15 +2281,15 @@
}%
\def\xintiiQuo {\romannumeral0\xintiiquo }%
\def\xintiiRem {\romannumeral0\xintiirem }%
-\def\xintiiquo {\expandafter\xint_firstoftwo_andstop
+\def\xintiiquo {\expandafter\xint_firstoftwo_afterstop
\romannumeral0\xintiidivision }%
-\def\xintiirem {\expandafter\xint_secondoftwo_andstop
+\def\xintiirem {\expandafter\xint_secondoftwo_afterstop
\romannumeral0\xintiidivision }%
\def\xintQuo {\romannumeral0\xintquo }%
\def\xintRem {\romannumeral0\xintrem }%
-\def\xintquo {\expandafter\xint_firstoftwo_andstop
+\def\xintquo {\expandafter\xint_firstoftwo_afterstop
\romannumeral0\xintdivision }%
-\def\xintrem {\expandafter\xint_secondoftwo_andstop
+\def\xintrem {\expandafter\xint_secondoftwo_afterstop
\romannumeral0\xintdivision }%
\def\xintiidivision #1%
{%
@@ -2252,18 +2312,17 @@
\def\XINT_div_fork #1#2\Z #3#4\Z
{%
\xint_UDzerofork
- #1\dummy \XINT_div_BisZero
- #3\dummy \XINT_div_AisZero
- 0\dummy
- {\xint_UDsignfork
- #1\dummy \XINT_div_BisNegative % B < 0
- #3\dummy \XINT_div_AisNegative % A < 0, B > 0
- -\dummy \XINT_div_plusplus % B > 0, A > 0
+ #1\XINT_div_BisZero
+ #3\XINT_div_AisZero
+ 0{\xint_UDsignfork
+ #1\XINT_div_BisNegative % B < 0
+ #3\XINT_div_AisNegative % A < 0, B > 0
+ -\XINT_div_plusplus % B > 0, A > 0
\krof }%
\krof
{#2}{#4}#1#3% #1#2=B, #3#4=A
}%
-\def\XINT_div_BisZero #1#2#3#4{\xintError:DivisionByZero\space {0}{0}}%
+\edef\XINT_div_BisZero #1#2#3#4{\noexpand\xintError:DivisionByZero\space {0}{0}}%
\def\XINT_div_AisZero #1#2#3#4{ {0}{0}}%
\def\XINT_div_plusplus #1#2#3#4%
{%
@@ -2274,9 +2333,10 @@
\expandafter\XINT_div_BisNegative_post
\romannumeral0\XINT_div_fork #1\Z #4#2\Z
}%
-\def\XINT_div_BisNegative_post #1%
+\edef\XINT_div_BisNegative_post #1%
{%
- \expandafter\space\expandafter {\romannumeral0\XINT_opp #1}%
+ \noexpand\expandafter\space\noexpand\expandafter
+ {\noexpand\romannumeral0\noexpand\XINT_opp #1}%
}%
\def\XINT_div_AisNegative #1#2#3#4%
{%
@@ -2285,16 +2345,17 @@
}%
\def\XINT_div_AisNegative_post #1#2%
{%
- \ifcase\XINT_Sgn {#2}
+ \if0\XINT_Sgn #2\Z
\expandafter \XINT_div_AisNegative_zerorem
- \or
+ \else
\expandafter \XINT_div_AisNegative_posrem
\fi
{#1}{#2}%
}%
-\def\XINT_div_AisNegative_zerorem #1#2#3%
+\edef\XINT_div_AisNegative_zerorem #1#2#3%
{%
- \expandafter\space\expandafter {\romannumeral0\XINT_opp #1}{0}%
+ \noexpand\expandafter\space\noexpand\expandafter
+ {\noexpand\romannumeral0\noexpand\XINT_opp #1}{0}%
}%
\def\XINT_div_AisNegative_posrem #1%
{%
@@ -2303,7 +2364,7 @@
}%
\def\XINT_div_AisNegative_posrem_b #1#2#3%
{%
- \expandafter \xint_exchangetwo_keepbraces_andstop \expandafter
+ \expandafter \xint_exchangetwo_keepbraces_afterstop \expandafter
{\romannumeral0\XINT_sub {#3}{#2}}{#1}%
}%
\def\XINT_div_prepare #1%
@@ -2409,18 +2470,19 @@
}%
\def\XINT_div_finished_b #1#2#3#4#5%
{%
- \ifcase \XINT_Sgn {#1}
+ \if0\XINT_Sgn #1\Z
\xint_afterfi {\XINT_div_finished_c {0}}%
- \or
+ \else
\xint_afterfi {\expandafter\XINT_div_finished_c\expandafter
{\romannumeral0\XINT_dsh_checksignx #5\Z {#1}}%
}%
\fi
{#2}%
}%
-\def\XINT_div_finished_c #1#2%
+\edef\XINT_div_finished_c #1#2%
{%
- \expandafter\space\expandafter {\romannumeral0\XINT_rev_andcuz {#2}}{#1}%
+ \noexpand\expandafter\space\noexpand\expandafter
+ {\noexpand\romannumeral0\noexpand\XINT_rev_andcuz {#2}}{#1}%
}%
\def\XINT_div_final_a #1%
{%
@@ -2470,33 +2532,35 @@
{\romannumeral0\XINT_mul_M {#1}#5\Z\Z\Z\Z }}%
{#1}{#2}{#3}{#4}{#5}%
}%
-\def\XINT_div_final_dc #1#2%
+\def\XINT_div_final_dc #1#2% 1.09i re-styles the conditional here
{%
- \ifnum\XINT_Sgn{#1}<\xint_c_
- \xint_afterfi
- {\expandafter\XINT_div_final_dP\the\numexpr #2-\xint_c_i\relax}%
- \else \xint_afterfi {\XINT_div_final_e {#1}#2}%
+ \ifnum\XINT__Sgn #1\Z<\xint_c_
+ \expandafter\xint_firstoftwo
+ \else\expandafter\xint_secondoftwo
\fi
+ {\expandafter\XINT_div_final_dP\the\numexpr #2-\xint_c_i\relax}%
+ {\XINT_div_final_e {#1}#2}%
}%
\def\XINT_div_final_e #1#2#3#4#5#6% A final, q, trash, Q, L, B
{%
\XINT_div_final_f {#1}%
{\romannumeral0\XINT_add_A 0{}#2000\W\X\Y\Z #4\W\X\Y\Z }%
}%
-\def\XINT_div_final_f #1#2#3% R,Q \`a d\'evelopper,c
+\def\XINT_div_final_f #1#2#3% R,Q \`a d\'evelopper,c. re-styled in 1.09i
{%
- \ifcase \XINT_Sgn {#1}
- \xint_afterfi {\XINT_div_final_end {0}}%
- \or
- \xint_afterfi {\expandafter\XINT_div_final_end\expandafter
+ \if0\XINT_Sgn #1\Z
+ \expandafter\xint_firstoftwo
+ \else\expandafter\xint_secondoftwo
+ \fi
+ {\XINT_div_final_end {0}}%
+ {\expandafter\XINT_div_final_end\expandafter
{\romannumeral0\XINT_dsh_checksignx #3\Z {#1}}%
}%
- \fi
{#2}%
}%
-\def\XINT_div_final_end #1#2%
+\edef\XINT_div_final_end #1#2%
{%
- \expandafter\space\expandafter {#2}{#1}%
+ \noexpand\expandafter\space\noexpand\expandafter {#2}{#1}%
}%
\def\XINT_div_body_a #1%
{%
@@ -2533,8 +2597,8 @@
\def\XINT_div_body_gg #1#2#3#4#5#6%
{%
\xint_UDzerofork
- #2\dummy \XINT_div_body_gk
- 0\dummy {\XINT_div_body_ggk #2}%
+ #2\XINT_div_body_gk
+ 0{\XINT_div_body_ggk #2}%
\krof
{#3#4#5#6}%
}%
@@ -2672,8 +2736,8 @@
\def\xint_div_sub_bz\W\XINT_div_sub_onestep #1#2#3#4#5#6#7%
{%
\xint_UDzerofork
- #1\dummy \XINT_div_sub_C %
- 0\dummy \XINT_div_sub_D % pas de retenue
+ #1\XINT_div_sub_C %
+ 0\XINT_div_sub_D % pas de retenue
\krof
{#7}#2#3#4#5%
}%
@@ -2732,9 +2796,9 @@
\def\XINT_fdg #1#2#3\Z
{%
\xint_UDzerominusfork
- #1-\dummy { 0}% zero
- 0#1\dummy { #2}% negative
- 0-\dummy { #1}% positive
+ #1-{ 0}% zero
+ 0#1{ #2}% negative
+ 0-{ #1}% positive
\krof
}%
\def\xintiiLDg {\romannumeral0\xintiildg }%
@@ -2846,15 +2910,15 @@
\def\XINT_dshr_checkxpositive #1%
{%
\xint_UDzerominusfork
- 0#1\dummy \XINT_dshr_xzeroorneg
- #1-\dummy \XINT_dshr_xzeroorneg
- 0-\dummy \XINT_dshr_xpositive
+ 0#1\XINT_dshr_xzeroorneg
+ #1-\XINT_dshr_xzeroorneg
+ 0-\XINT_dshr_xpositive
\krof #1%
}%
\def\XINT_dshr_xzeroorneg #1\Z #2{ 0}%
\def\XINT_dshr_xpositive #1\Z
{%
- \expandafter\xint_secondoftwo_andstop\romannumeral0\xintdsx {#1}%
+ \expandafter\xint_secondoftwo_afterstop\romannumeral0\xintdsx {#1}%
}%
\def\xintDSH {\romannumeral0\xintdsh }%
\def\xintdsh #1#2%
@@ -2868,15 +2932,15 @@
\def\XINT_dsh_checksignx #1%
{%
\xint_UDzerominusfork
- #1-\dummy \XINT_dsh_xiszero
- 0#1\dummy \XINT_dsx_xisNeg_checkA % on passe direct dans DSx
- 0-\dummy {\XINT_dsh_xisPos #1}%
+ #1-\XINT_dsh_xiszero
+ 0#1\XINT_dsx_xisNeg_checkA % on passe direct dans DSx
+ 0-{\XINT_dsh_xisPos #1}%
\krof
}%
\def\XINT_dsh_xiszero #1\Z #2{ #2}%
\def\XINT_dsh_xisPos #1\Z #2%
{%
- \expandafter\xint_firstoftwo_andstop
+ \expandafter\xint_firstoftwo_afterstop
\romannumeral0\XINT_dsx_checksignA #2\Z {#1}% via DSx
}%
\def\xintDSx {\romannumeral0\xintdsx }%
@@ -2893,9 +2957,9 @@
\def\XINT_dsx_checksignx #1%
{%
\xint_UDzerominusfork
- #1-\dummy \XINT_dsx_xisZero
- 0#1\dummy \XINT_dsx_xisNeg_checkA
- 0-\dummy {\XINT_dsx_xisPos #1}%
+ #1-\XINT_dsx_xisZero
+ 0#1\XINT_dsx_xisNeg_checkA
+ 0-{\XINT_dsx_xisPos #1}%
\krof
}%
\def\XINT_dsx_xisZero #1\Z #2{ {#2}{0}}% attention comme x > 0
@@ -2942,9 +3006,9 @@
\def\XINT_dsx_checksignA #1%
{%
\xint_UDzerominusfork
- #1-\dummy \XINT_dsx_AisZero
- 0#1\dummy \XINT_dsx_AisNeg
- 0-\dummy {\XINT_dsx_AisPos #1}%
+ #1-\XINT_dsx_AisZero
+ 0#1\XINT_dsx_AisNeg
+ 0-{\XINT_dsx_AisPos #1}%
\krof
}%
\def\XINT_dsx_AisZero #1\Z #2{ {0}{0}}%
@@ -2984,20 +3048,20 @@
\expandafter {\romannumeral0\XINT_num {#2}}%
{\romannumeral0\XINT_num {#1}}%
}%
-\def\XINT_dsx_end #1#2%
+\edef\XINT_dsx_end #1#2%
{%
- \expandafter\space\expandafter{#2}{#1}%
+ \noexpand\expandafter\space\noexpand\expandafter{#2}{#1}%
}%
\def\xintDecSplitL {\romannumeral0\xintdecsplitl }%
\def\xintDecSplitR {\romannumeral0\xintdecsplitr }%
\def\xintdecsplitl
{%
- \expandafter\xint_firstoftwo_andstop
+ \expandafter\xint_firstoftwo_afterstop
\romannumeral0\xintdecsplit
}%
\def\xintdecsplitr
{%
- \expandafter\xint_secondoftwo_andstop
+ \expandafter\xint_secondoftwo_afterstop
\romannumeral0\xintdecsplit
}%
\def\xintDecSplit {\romannumeral0\xintdecsplit }%
@@ -3021,7 +3085,7 @@
}%
\def\XINT_split_bigx #1\Z #2%
{%
- \ifcase\XINT_Sgn {#1}
+ \ifcase\XINT__Sgn #1\Z
\or \xint_afterfi { {}{#2}}% positive big x
\else
\xint_afterfi { {#2}{}}% negative big x
@@ -3030,9 +3094,9 @@
\def\XINT_split_xfork #1%
{%
\xint_UDzerominusfork
- #1-\dummy \XINT_split_zerosplit
- 0#1\dummy \XINT_split_fromleft
- 0-\dummy {\XINT_split_fromright #1}%
+ #1-\XINT_split_zerosplit
+ 0#1\XINT_split_fromleft
+ 0-{\XINT_split_fromright #1}%
\krof
}%
\def\XINT_split_zerosplit #1\Z #2{ {#2}{}}%
@@ -3118,9 +3182,10 @@
{%
\csname XINT_split_fromright_endsplit_\romannumeral #1\endcsname
}%
-\def\XINT_split_fromright_endsplit_ #1#2\W #3\Z #4%
+\edef\XINT_split_fromright_endsplit_ #1#2\W #3\Z #4%
{%
- \expandafter\space\expandafter {\romannumeral0\xintreverseorder {#2}}{#1}%
+ \noexpand\expandafter\space\noexpand\expandafter
+ {\noexpand\romannumeral0\noexpand\xintreverseorder {#2}}{#1}%
}%
\def\XINT_split_fromright_endsplit_i #1#2%
{\XINT_split_fromright_checkiftoofar #2{#2#1}}%
@@ -3152,14 +3217,14 @@
\def\XINT_dbl #1%
{%
\xint_UDzerominusfork
- #1-\dummy \XINT_dbl_zero
- 0#1\dummy \XINT_dbl_neg
- 0-\dummy {\XINT_dbl_pos #1}%
+ #1-\XINT_dbl_zero
+ 0#1\XINT_dbl_neg
+ 0-{\XINT_dbl_pos #1}%
\krof
}%
\def\XINT_dbl_zero #1\Z \W\W\W\W\W\W\W { 0}%
\def\XINT_dbl_neg
- {\expandafter\xint_minus_andstop\romannumeral0\XINT_dbl_pos }%
+ {\expandafter\xint_minus_afterstop\romannumeral0\XINT_dbl_pos }%
\def\XINT_dbl_pos
{%
\expandafter\XINT_dbl_a \expandafter{\expandafter}\expandafter 0%
@@ -3179,9 +3244,9 @@
{%
\expandafter\XINT_dbl_end_b #2#4%
}%
-\def\XINT_dbl_end_b #1#2#3#4#5#6#7#8%
+\edef\XINT_dbl_end_b #1#2#3#4#5#6#7#8%
{%
- \expandafter\space\the\numexpr #1#2#3#4#5#6#7#8\relax
+ \noexpand\expandafter\space\noexpand\the\numexpr #1#2#3#4#5#6#7#8\relax
}%
\def\xintHalf {\romannumeral0\xinthalf }%
\def\xinthalf #1%
@@ -3192,9 +3257,9 @@
\def\XINT_half #1%
{%
\xint_UDzerominusfork
- #1-\dummy \XINT_half_zero
- 0#1\dummy \XINT_half_neg
- 0-\dummy {\XINT_half_pos #1}%
+ #1-\XINT_half_zero
+ 0#1\XINT_half_neg
+ 0-{\XINT_half_pos #1}%
\krof
}%
\def\XINT_half_zero #1\Z \W\W\W\W\W\W\W { 0}%
@@ -3206,11 +3271,11 @@
\expandafter\XINT_half_b
\the\numexpr \xint_c_x^viii+\xint_c_v*#7#6#5#4#3#2#1\relax #8%
}%
-\def\XINT_half_dont\W\expandafter\XINT_half_b
+\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
{%
- \expandafter\space
- \the\numexpr (#1#2#3#4#5#6#7+\xint_c_i)/\xint_c_ii-\xint_c_i \relax
+ \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%
{%
@@ -3230,9 +3295,9 @@
{%
\xint_gob_til_zero #1\XINT_half_end_b 0\space #1#3%
}%
-\def\XINT_half_end_b 0\space 0#1#2#3#4#5#6#7%
+\edef\XINT_half_end_b 0\space 0#1#2#3#4#5#6#7%
{%
- \expandafter\space\the\numexpr #1#2#3#4#5#6#7\relax
+ \noexpand\expandafter\space\noexpand\the\numexpr #1#2#3#4#5#6#7\relax
}%
\def\xintDec {\romannumeral0\xintdec }%
\def\xintdec #1%
@@ -3243,14 +3308,14 @@
\def\XINT_dec #1%
{%
\xint_UDzerominusfork
- #1-\dummy \XINT_dec_zero
- 0#1\dummy \XINT_dec_neg
- 0-\dummy {\XINT_dec_pos #1}%
+ #1-\XINT_dec_zero
+ 0#1\XINT_dec_neg
+ 0-{\XINT_dec_pos #1}%
\krof
}%
\def\XINT_dec_zero #1\W\W\W\W\W\W\W\W { -1}%
\def\XINT_dec_neg
- {\expandafter\xint_minus_andstop\romannumeral0\XINT_inc_pos }%
+ {\expandafter\xint_minus_afterstop\romannumeral0\XINT_inc_pos }%
\def\XINT_dec_pos
{%
\expandafter\XINT_dec_a \expandafter{\expandafter}%
@@ -3278,8 +3343,8 @@
\xint_relax
#1%
}%
-\def\XINT_dec_cleanup #1#2#3#4#5#6#7#8%
-{\expandafter\space\the\numexpr #1#2#3#4#5#6#7#8\relax }%
+\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\xintInc {\romannumeral0\xintinc }%
\def\xintinc #1%
{%
@@ -3289,9 +3354,9 @@
\def\XINT_inc #1%
{%
\xint_UDzerominusfork
- #1-\dummy \XINT_inc_zero
- 0#1\dummy \XINT_inc_neg
- 0-\dummy {\XINT_inc_pos #1}%
+ #1-\XINT_inc_zero
+ 0#1\XINT_inc_neg
+ 0-{\XINT_inc_pos #1}%
\krof
}%
\def\XINT_inc_zero #1\W\W\W\W\W\W\W\W { 1}%
@@ -3327,13 +3392,13 @@
\def\XINT_sqrt_checkin #1%
{%
\xint_UDzerominusfork
- #1-\dummy \XINT_sqrt_iszero
- 0#1\dummy \XINT_sqrt_isneg
- 0-\dummy {\XINT_sqrt #1}%
+ #1-\XINT_sqrt_iszero
+ 0#1\XINT_sqrt_isneg
+ 0-{\XINT_sqrt #1}%
\krof
}%
\def\XINT_sqrt_iszero #1\Z { 1.}% 1.09e was wrong from inception in 1.08 :-((
-\def\XINT_sqrt_isneg #1\Z {\xintError:RootOfNegative\space 1.}%
+\edef\XINT_sqrt_isneg #1\Z {\noexpand\xintError:RootOfNegative\space 1.}%
\def\XINT_sqrt #1\Z
{%
\expandafter\XINT_sqrt_start\expandafter
@@ -3496,9 +3561,9 @@
}%
\def\XINT_sqrt_big_j #1%
{%
- \ifcase\XINT_Sgn {#1}
- \expandafter \XINT_sqrt_big_end
- \or \expandafter \XINT_sqrt_big_k
+ \if0\XINT_Sgn #1\Z
+ \expandafter \XINT_sqrt_big_end
+ \else \expandafter \XINT_sqrt_big_k
\fi {#1}%
}%
\def\XINT_sqrt_big_k #1#2#3%
@@ -3513,7 +3578,6 @@
{#2}{#1}%
}%
\def\XINT_sqrt_big_end #1#2#3#4{ {#3}{#2}}%
-\let\XINT_tmpa\relax \let\XINT_tmpb\relax \let\XINT_tmpc\relax
\XINT_restorecatcodes_endinput%
\endinput
%%