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.sty493
1 files changed, 255 insertions, 238 deletions
diff --git a/Master/texmf-dist/tex/generic/xint/xint.sty b/Master/texmf-dist/tex/generic/xint/xint.sty
index dca6c247cfb..26e616d946e 100644
--- a/Master/texmf-dist/tex/generic/xint/xint.sty
+++ b/Master/texmf-dist/tex/generic/xint/xint.sty
@@ -22,7 +22,7 @@
%% in the same archive or directory.)
%%
%%----------------------------------------------------------------
-%% The xint bundle (version 1.09e of October 29, 2013)
+%% The xint bundle (version 1.09f of November 4, 2013)
%% xint: Expandable operations on long numbers
%% Copyright (C) 2013 by Jean-Francois Burnol
%%----------------------------------------------------------------
@@ -152,7 +152,7 @@
\fi
\XINT_providespackage
\ProvidesPackage {xint}%
- [2013/10/29 v1.09e Expandable operations on long numbers (jfB)]%
+ [2013/11/04 v1.09f Expandable operations on long numbers (jfB)]%
\def\xint_gobble_ {}%
\def\xint_gobble_i #1{}%
\def\xint_gobble_ii #1#2{}%
@@ -162,7 +162,7 @@
\def\xint_gobble_vi #1#2#3#4#5#6{}%
\def\xint_gobble_vii #1#2#3#4#5#6#7{}%
\def\xint_gobble_viii #1#2#3#4#5#6#7#8{}%
-\def\xint_firstofone #1{#1}%
+\long\def\xint_firstofone #1{#1}% becomes long in 1.09f, 2013/11/01
\xint_firstofone{\let\XINT_sptoken= } % 1.09d, 2013/10/22
\long\def\xint_firstoftwo #1#2{#1}% made long in 1.09e, 2013/10/28
\long\def\xint_secondoftwo #1#2{#2}%
@@ -173,7 +173,7 @@
\def\xint_secondofthree #1#2#3{#2}%
\def\xint_thirdofthree #1#2#3{#3}%
\def\xint_minus_andstop { -}%
-\def\xint_bye #1\xint_bye {}%
+\long\def\xint_bye #1\xint_bye {}% becomes long in 1.09f
\def\xint_gob_til_R #1\R {}%
\def\xint_gob_til_W #1\W {}%
\def\xint_gob_til_Z #1\Z {}%
@@ -186,7 +186,7 @@
\let\xint_relax\relax
\def\xint_brelax {\xint_relax }%
\def\xint_gob_til_relax #1\relax {}%
-\def\xint_gob_til_xint_relax #1\xint_relax {}%
+\long\def\xint_gob_til_xint_relax #1\xint_relax {}% becomes long in 1.09f
\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}%
@@ -282,14 +282,13 @@
\space
\csname xint_gobble_\romannumeral #1\endcsname
}%
-\def\xintiLen {\romannumeral0\xintilen }%
-\def\xintilen #1%
+\def\xintLen {\romannumeral0\xintlen }%
+\def\xintlen #1%
{%
\expandafter\XINT_length_fork
\romannumeral0\xintnum{#1}\xint_relax\xint_relax\xint_relax\xint_relax
\xint_relax\xint_relax\xint_relax\xint_relax\xint_bye
}%
-\let\xintLen\xintiLen \let\xintlen\xintilen
\def\XINT_Len #1%
{%
\romannumeral0\XINT_length_fork
@@ -335,16 +334,70 @@
\W\XINT_length_finish_c 1\Z
}%
\def\XINT_length_finish_c #1#2\Z #3{\expandafter\space\the\numexpr #3-#1\relax}%
+\def\xintZapFirstSpaces {\romannumeral0\xintzapfirstspaces }%
+\edef\xintzapfirstspaces #1%
+ {\noexpand\XINT_zapbsp_a \space #1\space\space\noexpand\xint_bye\xint_relax }%
+\xint_firstofone {\def\XINT_zapbsp_a #1 } %<- space token here
+{%
+ \XINT_zapbsp_again? #1\xint_bye\XINT_zapbsp_b {#1}%
+}%
+\def\XINT_zapbsp_again? #1{\xint_bye #1\XINT_zapbsp_again }%
+\edef\XINT_zapbsp_again\XINT_zapbsp_b #1{\noexpand\XINT_zapbsp_a\space }%
+\def\XINT_zapbsp_b #1#2\xint_relax
+ {\XINT_zapbsp_end? #2\XINT_zapbsp_e\empty #2{#1}}%
+\def\XINT_zapbsp_end? #1{\xint_bye #1\XINT_zapbsp_end }%
+\def\XINT_zapbsp_end\XINT_zapbsp_e\empty #1\xint_bye #2{#2#1}%
+\xint_firstofone{\def\XINT_zapbsp_e #1 } \xint_bye
+ {\expandafter\XINT_zapbsp_f \expandafter{#1}}%
+\edef\XINT_zapbsp_f #1#2{#2\space\space #1}%
+\def\xintZapLastSpaces {\romannumeral0\xintzaplastspaces }%
+\edef\xintzaplastspaces #1{\noexpand\XINT_zapesp_a {\space}\noexpand\empty
+ #1\space\space\noexpand\xint_bye \xint_relax}%
+\xint_firstofone {\def\XINT_zapesp_a #1#2 } %<- second space here
+ {\expandafter\XINT_zapesp_b\expandafter{#2}{#1}}%
+\def\XINT_zapesp_b #1#2#3\xint_relax
+ {\XINT_zapesp_end? #3\XINT_zapesp_e {#2#1}\empty #3\xint_relax }%
+\def\XINT_zapesp_end? #1{\xint_bye #1\XINT_zapesp_end }%
+\def\XINT_zapesp_end\XINT_zapesp_e #1#2\xint_relax {#1}%
+\edef\XINT_zapesp_e #1{\noexpand \XINT_zapesp_a {#1\space\space}}%
+\def\xintZapSpaces {\romannumeral0\xintzapspaces }%
+\edef\xintzapspaces #1%
+ {\noexpand\XINT_zapsp_a \space #1\space\space\noexpand\xint_bye\xint_relax}%
+\xint_firstofone {\def\XINT_zapsp_a #1 } %<- space token here
+{%
+ \XINT_zapsp_again? #1\xint_bye\XINT_zapesp_b {#1}{}%
+}%
+\def\XINT_zapsp_again? #1{\xint_bye #1\XINT_zapsp_again }%
+\edef\XINT_zapsp_again\XINT_zapesp_b #1#2{\noexpand\XINT_zapsp_a\space }%
+\def\xintZapSpacesB {\romannumeral0\xintzapspacesb }%
+\def\xintzapspacesb #1{\XINT_zapspb_one? #1\xint_relax\xint_relax
+ \xint_bye\xintzapspaces {#1}}%
+\def\XINT_zapspb_one? #1#2%
+ {\xint_gob_til_xint_relax #1\XINT_zapspb_onlyspaces\xint_relax
+ \xint_gob_til_xint_relax #2\XINT_zapspb_bracedorone\xint_relax
+ \xint_bye {#1}}%
+\def\XINT_zapspb_onlyspaces\xint_relax
+ \xint_gob_til_xint_relax\xint_relax\XINT_zapspb_bracedorone\xint_relax
+ \xint_bye #1\xint_bye\xintzapspaces #2{ }%
+\def\XINT_zapspb_bracedorone\xint_relax
+ \xint_bye #1\xint_relax\xint_bye\xintzapspaces #2{ #1}%
\def\xintCSVtoList {\romannumeral0\xintcsvtolist }%
+\def\xintcsvtolist #1{\expandafter\xintApply\expandafter\xintzapspacesb
+ \expandafter{\romannumeral0\xintcsvtolistnonstripped{#1}}}%
\def\xintCSVtoListNoExpand {\romannumeral0\xintcsvtolistnoexpand }%
-\def\xintcsvtolist #1%
+\def\xintcsvtolistnoexpand #1{\expandafter\xintApply\expandafter\xintzapspacesb
+ \expandafter{\romannumeral0\xintcsvtolistnonstrippednoexpand{#1}}}%
+\def\xintCSVtoListNonStripped {\romannumeral0\xintcsvtolistnonstripped }%
+\def\xintCSVtoListNonStrippedNoExpand
+ {\romannumeral0\xintcsvtolistnonstrippednoexpand }%
+\def\xintcsvtolistnonstripped #1%
{%
\expandafter\XINT_csvtol_loop_a\expandafter
{\expandafter}\romannumeral-`0#1%
,\xint_bye,\xint_bye,\xint_bye,\xint_bye
,\xint_bye,\xint_bye,\xint_bye,\xint_bye,\Z
}%
-\def\xintcsvtolistnoexpand #1%
+\def\xintcsvtolistnonstrippednoexpand #1%
{%
\XINT_csvtol_loop_a
{}#1,\xint_bye,\xint_bye,\xint_bye,\xint_bye
@@ -519,7 +572,7 @@
}%
\def\XINT_seq #1#2%
{%
- \ifcase\xintiSgn{\the\numexpr #2-#1\relax}
+ \ifcase\xintiiSgn{\the\numexpr #2-#1\relax}
\expandafter\xint_firstoftwo_andstop
\or
\expandafter\XINT_seq_p
@@ -556,7 +609,7 @@
}%
\def\XINT_seqo #1#2%
{%
- \ifcase\xintiSgn{\the\numexpr #2-#1\relax}
+ \ifcase\xintiiSgn{\the\numexpr #2-#1\relax}
\expandafter\XINT_seqo_a
\or
\expandafter\XINT_seqo_pa
@@ -619,9 +672,9 @@
\def\XINT_seqo_nd #1#2#3#4{\XINT_seqo_nb {#1}{#2}{#3}{#4{#1}}}%
\def\XINT_xflet #1%
{%
- \def\XINT_xflet_macro {#1}\XINT_xflet_get
+ \def\XINT_xflet_macro {#1}\XINT_xflet_zapsp
}%
-\def\XINT_xflet_get
+\def\XINT_xflet_zapsp
{%
\expandafter\futurelet\expandafter\XINT_token
\expandafter\XINT_xflet_sp?\romannumeral-`0%
@@ -629,11 +682,11 @@
\def\XINT_xflet_sp?
{%
\ifx\XINT_token\XINT_sptoken
- \expandafter\XINT_xflet_get
- \else\expandafter\XINT_xflet_getB
+ \expandafter\XINT_xflet_zapsp
+ \else\expandafter\XINT_xflet_zapspB
\fi
}%
-\def\XINT_xflet_getB
+\def\XINT_xflet_zapspB
{%
\expandafter\futurelet\expandafter\XINT_tokenB
\expandafter\XINT_xflet_spB?\romannumeral-`0%
@@ -641,7 +694,7 @@
\def\XINT_xflet_spB?
{%
\ifx\XINT_tokenB\XINT_sptoken
- \expandafter\XINT_xflet_getB
+ \expandafter\XINT_xflet_zapspB
\else\expandafter\XINT_xflet_eq?
\fi
}%
@@ -649,19 +702,19 @@
{%
\ifx\XINT_token\XINT_tokenB
\expandafter\XINT_xflet_macro
- \else\expandafter\XINT_xflet_get
+ \else\expandafter\XINT_xflet_zapsp
\fi
}%
-\catcode`z 3%
+\catcode`Z 3%
\def\xintApplyInline #1#2%
{%
\long\expandafter\def\expandafter\XINT_inline_macro
\expandafter ##\expandafter 1\expandafter {#1{##1}}%
- \XINT_xflet\XINT_inline_b #2z% this z has catcode 3
+ \XINT_xflet\XINT_inline_b #2Z% this Z has catcode 3
}%
\def\XINT_inline_b
{%
- \ifx\XINT_token z\expandafter\xint_gobble_i
+ \ifx\XINT_token Z\expandafter\xint_gobble_i
\else\expandafter\XINT_inline_d
\fi
}%
@@ -671,7 +724,7 @@
}%
\def\XINT_inline_e
{%
- \ifx\XINT_token z\expandafter\XINT_inline_w
+ \ifx\XINT_token Z\expandafter\XINT_inline_w
\else\expandafter\XINT_inline_f
\fi
}%
@@ -688,36 +741,59 @@
{%
\expandafter\XINT_inline_macro\XINT_item
}%
-\long\def\xintBreakFor #1z{}%
-\long\def\xintBreakForAndDo #1#2z{#1}%
+\def\XINT_tmpa #1#2{\ifnum #2<#1 \xint_afterfi {{#########2}}\fi}%
+\def\XINT_tmpb #1#2{\ifnum #1<#2 \xint_afterfi {{#########2}}\fi}%
+\def\XINT_tmpc #1%
+{%
+ \expandafter\edef \csname XINT_for_left#1\endcsname
+ {\xintApplyUnbraced {\XINT_tmpa #1}{123456789}}%
+ \expandafter\edef \csname XINT_for_right#1\endcsname
+ {\xintApplyUnbraced {\XINT_tmpb #1}{123456789}}%
+}%
+\xintApplyInline \XINT_tmpc {123456789}%
+\long\def\xintBreakFor #1Z{}%
+\long\def\xintBreakForAndDo #1#2Z{#1}%
+\def\xintFor {\let\xintifForFirst\xint_firstoftwo
+ \futurelet\XINT_token\XINT_for_ifstar }%
+\def\XINT_for_ifstar {\ifx\XINT_token*\expandafter\XINT_forx
+ \else\expandafter\XINT_for \fi }%
\catcode`U 3 % with numexpr
-\catcode`V 3 % with xintfrac.sty (xint.sty not enough, uses \xintIrr)
+\catcode`V 3 % with xintfrac.sty (xint.sty not enough)
\catcode`D 3 % with dimexpr
-\catcode`j 3
-\def\xintFor {\futurelet\XINT_token\XINT_for_ifstar }%
-\def\XINT_for_ifstar {\let\xintifForFirst\xint_firstoftwo
- \ifx\XINT_token*\expandafter\XINT_forx
- \else\expandafter\XINT_for \fi }%
-\long\def\XINT_for #1#2in#3#4#5%
+\def\XINT_flet_zapsp
{%
- \XINT_toks {\csname XINT_for_d\romannumeral#2\endcsname {#5}}%
- \expandafter\futurelet\expandafter\XINT_token
- \expandafter\XINT_for_forever? #3,z% this z has catcode 3
+ \futurelet\XINT_token\XINT_flet_sp?
}%
-\long\def\XINT_forx *#1#2in#3#4#5%
+\def\XINT_flet_sp?
{%
- \XINT_toks {\csname XINT_forx_d\romannumeral#2\endcsname {#5}}%
- \XINT_xflet\XINT_forx_forever? #3jz% j and z have catcode 3
+ \ifx\XINT_token\XINT_sptoken
+ \xint_afterfi{\expandafter\XINT_flet_zapsp\romannumeral0}%
+ \else\expandafter\XINT_flet_macro
+ \fi
}%
-\def\XINT_to_forever #1\XINT_toks {\fi \XINT_forever }%
-\def\XINT_for_forever?
+\long\def\XINT_for #1#2in#3#4#5%
+{%
+ \count 255 #2\relax
+ \expandafter\XINT_toks\expandafter
+ {\expandafter\XINT_for_d\the\count 255{#5}}%
+ \def\XINT_flet_macro {\expandafter\XINT_for_forever?\space}%
+ \expandafter\XINT_flet_zapsp #3Z%
+}%
+\def\XINT_for_forever? #1Z%
{%
\ifx\XINT_token U\XINT_to_forever\fi
\ifx\XINT_token V\XINT_to_forever\fi
\ifx\XINT_token D\XINT_to_forever\fi
- \the\XINT_toks
+ \expandafter\the\expandafter\XINT_toks\romannumeral0\xintcsvtolist {#1}Z%
+}%
+\def\XINT_to_forever\fi #1\xintcsvtolist #2{\fi \XINT_forever #2}%
+\long\def\XINT_forx *#1#2in#3#4#5%
+{%
+ \count 255 #2\relax
+ \expandafter\XINT_toks\expandafter
+ {\expandafter\XINT_forx_d\the\count 255{#5}}%
+ \XINT_xflet\XINT_forx_forever? #3Z%
}%
-\def\XINT_to_forxever #1\XINT_forx_empty? {\fi \XINT_forever }%
\def\XINT_forx_forever?
{%
\ifx\XINT_token U\XINT_to_forxever\fi
@@ -725,80 +801,43 @@
\ifx\XINT_token D\XINT_to_forxever\fi
\XINT_forx_empty?
}%
+\def\XINT_to_forxever\fi #1\XINT_forx_empty? {\fi \XINT_forever }%
+\catcode`U 11
+\catcode`D 11
+\catcode`V 11
\def\XINT_forx_empty?
{%
- \ifx\XINT_token j\expandafter\xint_gobble_iv\fi
+ \ifx\XINT_token Z\expandafter\xintBreakFor\fi
\the\XINT_toks
}%
-\long\def\XINT_for_di #1#2,%
-{%
- \long\def\XINT_y ##1##2##3##4{#1}%
- \long\def\XINT_x {\XINT_y {#2}{####2}{####3}{####4}}%
- \XINT_toks {\XINT_x\let\xintifForFirst\xint_secondoftwo\XINT_for_di {#1}}%
- \futurelet\XINT_token\XINT_for_last?
-}%
-\long\def\XINT_for_dii #1#2,%
-{%
- \long\def\XINT_y ##1##2##3##4{#1}%
- \long\def\XINT_x {\XINT_y {####1}{#2}{####3}{####4}}%
- \XINT_toks {\XINT_x\let\xintifForFirst\xint_secondoftwo\XINT_for_dii {#1}}%
- \futurelet\XINT_token\XINT_for_last?
-}%
-\long\def\XINT_for_diii #1#2,%
+\long\def\XINT_for_d #1#2#3%
{%
- \long\def\XINT_y ##1##2##3##4{#1}%
- \long\def\XINT_x {\XINT_y {####1}{####2}{#2}{####4}}%
- \XINT_toks {\XINT_x\let\xintifForFirst\xint_secondoftwo\XINT_for_diii {#1}}%
+ \long\def\XINT_y ##1##2##3##4##5##6##7##8##9{#2}%
+ \XINT_toks {{#3}}%
+ \long\edef\XINT_x {\noexpand\XINT_y \csname XINT_for_left#1\endcsname
+ \the\XINT_toks \csname XINT_for_right#1\endcsname }%
+ \XINT_toks {\XINT_x\let\xintifForFirst\xint_secondoftwo\XINT_for_d #1{#2}}%
\futurelet\XINT_token\XINT_for_last?
}%
-\long\def\XINT_for_div #1#2,%
+\long\def\XINT_forx_d #1#2#3%
{%
- \long\def\XINT_y ##1##2##3##4{#1}%
- \long\def\XINT_x {\XINT_y {####1}{####2}{####3}{#2}}%
- \XINT_toks {\XINT_x\let\xintifForFirst\xint_secondoftwo\XINT_for_div {#1}}%
- \futurelet\XINT_token\XINT_for_last?
+ \long\def\XINT_y ##1##2##3##4##5##6##7##8##9{#2}%
+ \XINT_toks {{#3}}%
+ \long\edef\XINT_x {\noexpand\XINT_y \csname XINT_for_left#1\endcsname
+ \the\XINT_toks \csname XINT_for_right#1\endcsname }%
+ \XINT_toks {\XINT_x\let\xintifForFirst\xint_secondoftwo\XINT_forx_d #1{#2}}%
+ \XINT_xflet\XINT_for_last?
}%
\def\XINT_for_last?
{%
- \ifx\XINT_token z\xint_afterfi{\let\xintifForLast\xint_firstoftwo
- \expandafter\XINT_x\xint_gobble_vi}\fi
- \let\xintifForLast\xint_secondoftwo\the\XINT_toks
-}%
-\long\def\XINT_forx_di #1#2%
-{%
- \long\def\XINT_y ##1##2##3##4{#1}%
- \long\def\XINT_x {\XINT_y {#2}{####2}{####3}{####4}}%
- \XINT_toks {\XINT_x\let\xintifForFirst\xint_secondoftwo\XINT_forx_di {#1}}%
- \XINT_xflet\XINT_forx_last?
-}%
-\long\def\XINT_forx_dii #1#2%
-{%
- \long\def\XINT_y ##1##2##3##4{#1}%
- \long\def\XINT_x {\XINT_y {####1}{#2}{####3}{####4}}%
- \XINT_toks {\XINT_x\let\xintifForFirst\xint_secondoftwo\XINT_forx_dii {#1}}%
- \XINT_xflet\XINT_forx_last?
-}%
-\long\def\XINT_forx_diii #1#2%
-{%
- \long\def\XINT_y ##1##2##3##4{#1}%
- \long\def\XINT_x {\XINT_y {####1}{####2}{#2}{####4}}%
- \XINT_toks {\XINT_x\let\xintifForFirst\xint_secondoftwo\XINT_forx_diii {#1}}%
- \XINT_xflet\XINT_forx_last?
-}%
-\long\def\XINT_forx_div #1#2%
-{%
- \long\def\XINT_y ##1##2##3##4{#1}%
- \long\def\XINT_x {\XINT_y {####1}{####2}{####3}{#2}}%
- \XINT_toks {\XINT_x\let\xintifForFirst\xint_secondoftwo\XINT_forx_div {#1}}%
- \XINT_xflet\XINT_forx_last?
-}%
-\def\XINT_forx_last?
-{%
- \ifx\XINT_token j\xint_afterfi{\let\xintifForLast\xint_firstoftwo
- \expandafter\XINT_x\xint_gobble_vii}\fi
- \let\xintifForLast\xint_secondoftwo\the\XINT_toks
+ \let\xintifForLast\xint_secondoftwo
+ \ifx\XINT_token Z\let\xintifForLast\xint_firstoftwo
+ \xint_afterfi{\xintBreakForAndDo\XINT_x}\fi
+ \the\XINT_toks
}%
-\catcode`j 11
+\catcode`U 3
+\catcode`D 3
+\catcode`V 3
\let\xintegers U%
\let\xintintegers U%
\let\xintdimensions D%
@@ -821,23 +860,24 @@
{\expandafter{\expandafter\dimexpr\number\dimexpr #1\expandafter\relax
\expandafter s\expandafter p\expandafter\relax\expandafter}%
\expandafter{\number\dimexpr #2}}%
-\catcode`z 11
+\catcode`Z 11
\def\XINT_?expr_Va #1#2%
{%
\expandafter\XINT_?expr_Vb\expandafter
- {\romannumeral-`0\xintrawwithzeros{#2}}%
- {\romannumeral-`0\xintrawwithzeros{#1}}%
+ {\romannumeral-`0\xintrawwithzeros{\xintZapSpacesB{#2}}}%
+ {\romannumeral-`0\xintrawwithzeros{\xintZapSpacesB{#1}}}%
}%
-\catcode`z 3
+\catcode`Z 3
\def\XINT_?expr_Vb #1#2{\expandafter\XINT_?expr_Vc #2.#1.}%
\def\XINT_?expr_Vc #1/#2.#3/#4.%
{%
- \xintifEq {#2}{#4}
- {\XINT_?expr_Vf {#3}{#1}{#2}}
- {\expandafter\XINT_?expr_Vd\expandafter
- {\romannumeral0\xintimul {#2}{#4}}%
- {\romannumeral0\xintimul {#1}{#4}}%
- {\romannumeral0\xintimul {#2}{#3}}}%
+ \xintifEq {#2}{#4}%
+ {\XINT_?expr_Vf {#3}{#1}{#2}}%
+ {\expandafter\XINT_?expr_Vd\expandafter
+ {\romannumeral0\xintiimul {#2}{#4}}%
+ {\romannumeral0\xintiimul {#1}{#4}}%
+ {\romannumeral0\xintiimul {#2}{#3}}%
+ }%
}%
\def\XINT_?expr_Vd #1#2#3{\expandafter\XINT_?expr_Ve\expandafter {#2}{#3}{#1}}%
\def\XINT_?expr_Ve #1#2{\expandafter\XINT_?expr_Vf\expandafter {#2}{#1}}%
@@ -853,119 +893,89 @@
\def\XINT_?expr_Vx #1#2%
{%
\expandafter\XINT_?expr_Vy\expandafter
- {\romannumeral0\xintiadd {#1}{#2}}{#2}%
+ {\romannumeral0\xintiiadd {#1}{#2}}{#2}%
}%
\def\XINT_?expr_Vy #1#2#3#4%
{%
- \expandafter{\romannumeral0\xintiadd {#3}{#1}/#4}{{#1}{#2}{#3}{#4}}%
+ \expandafter{\romannumeral0\xintiiadd {#3}{#1}/#4}{{#1}{#2}{#3}{#4}}%
}%
\def\XINT_forever_a #1#2#3#4%
{%
\ifx #4[\expandafter\XINT_forever_opt_a
\else\expandafter\XINT_forever_b
- \fi #1#2#3%
+ \fi #1#2#3#4%
}%
-\def\XINT_forever_b #1#2#3#4z{\expandafter\XINT_forever_c\the\XINT_toks #2#3}%
-\long\def\XINT_forever_c #1\romannumeral #2#3#4#5#6%
-{%
- \csname XINT_forever_d\romannumeral#2\expandafter\endcsname #5#6{#4}z%
-}%
-\def\XINT_forever_opt_a #1#2#3#4+#5]#6z%
+\def\XINT_forever_b #1#2#3Z{\expandafter\XINT_forever_c\the\XINT_toks #2#3}%
+\long\def\XINT_forever_c #1#2#3#4#5%
+ {\expandafter\XINT_forever_d\expandafter #2#4#5{#3}Z}%
+\def\XINT_forever_opt_a #1#2#3[#4+#5]#6Z%
{%
\expandafter\expandafter\expandafter
\XINT_forever_opt_c\expandafter\the\expandafter\XINT_toks
\romannumeral-`0#1{#4}{#5}#3%
}%
-\long\def\XINT_forever_opt_c #1\romannumeral #2#3#4#5#6#7%
-{%
- \csname XINT_forever_d\romannumeral#2\endcsname {#5}{#6}#7{#4}z%
-}%
-\long\def\XINT_forever_di #1#2#3#4%
-{%
- \long\def\XINT_y ##1##2##3##4{#4}%
- \XINT_y {#1}{##2}{##3}{##4}%
- \let\xintifForFirst\xint_secondoftwo
- \expandafter\XINT_forever_di\romannumeral-`0#3{#1}{#2}#3{#4}%
-}%
-\long\def\XINT_forever_dii #1#2#3#4%
+\long\def\XINT_forever_opt_c #1#2#3#4#5#6{\XINT_forever_d #2{#4}{#5}#6{#3}Z}%
+\long\def\XINT_forever_d #1#2#3#4#5%
{%
- \long\def\XINT_y ##1##2##3##4{#4}%
- \XINT_y {##1}{#1}{##3}{##4}%
+ \long\def\XINT_y ##1##2##3##4##5##6##7##8##9{#5}%
+ \XINT_toks {{#2}}%
+ \long\edef\XINT_x {\noexpand\XINT_y \csname XINT_for_left#1\endcsname
+ \the\XINT_toks \csname XINT_for_right#1\endcsname }%
+ \XINT_x
\let\xintifForFirst\xint_secondoftwo
- \expandafter\XINT_forever_dii\romannumeral-`0#3{#1}{#2}#3{#4}%
+ \expandafter\XINT_forever_d\expandafter #1\romannumeral-`0#4{#2}{#3}#4{#5}%
}%
-\long\def\XINT_forever_diii #1#2#3#4%
-{%
- \long\def\XINT_y ##1##2##3##4{#4}%
- \XINT_y {##1}{##2}{#1}{##4}%
- \let\xintifForFirst\xint_secondoftwo
- \expandafter\XINT_forever_diii\romannumeral-`0#3{#1}{#2}#3{#4}%
-}%
-\long\def\XINT_forever_div #1#2#3#4%
-{%
- \long\def\XINT_y ##1##2##3##4{#4}%
- \XINT_y {##1}{##2}{##3}{#1}%
- \let\xintifForFirst\xint_secondoftwo
- \expandafter\XINT_forever_div\romannumeral-`0#3{#1}{#2}#3{#4}%
-}%
-\long\def\xintForpair #1#2#3#4in#5#6#7%
+\catcode`j 3
+\long\def\xintForpair #1#2#3in#4#5#6%
{%
- \XINT_toks \expandafter{\csname XINT_forii_d\romannumeral#2\endcsname {#7}}%
- \expandafter\the\expandafter\XINT_toks #5,z% THIS z HAS CATCODE 3
+ \let\xintifForFirst\xint_firstoftwo
+ \XINT_toks {\XINT_forpair_d #2{#6}}%
+ \expandafter\the\expandafter\XINT_toks #4jZ%
}%
-\long\def\XINT_forii_di #1(#2,#3),%
+\long\def\XINT_forpair_d #1#2#3(#4)#5%
{%
- \long\def\XINT_y ##1##2##3##4{#1}%
- \def\XINT_x {\XINT_y {#2}{#3}{####3}{####4}}%
- \XINT_toks {\XINT_x\XINT_forii_di {#1}}%
- \futurelet\XINT_token\XINT_for_last?
-}%
-\long\def\XINT_forii_dii #1(#2,#3),%
-{%
- \long\def\XINT_y ##1##2##3##4{#1}%
- \def\XINT_x {\XINT_y {####1}{#2}{#3}{####4}}%
- \XINT_toks {\XINT_x \XINT_forii_dii {#1}}%
- \futurelet\XINT_token\XINT_for_last?
-}%
-\long\def\XINT_forii_diii #1(#2,#3),%
-{%
- \long\def\XINT_y ##1##2##3##4{#1}%
- \long\def\XINT_x {\XINT_y {####1}{####2}{#2}{#3}}%
- \XINT_toks {\XINT_x \XINT_forii_diii {#1}}%
- \futurelet\XINT_token\XINT_for_last?
+ \long\def\XINT_y ##1##2##3##4##5##6##7##8##9{#2}%
+ \XINT_toks \expandafter{\romannumeral0\xintcsvtolist{ #4}}%
+ \long\edef\XINT_x {\noexpand\XINT_y \csname XINT_for_left#1\endcsname
+ \the\XINT_toks \csname XINT_for_right\the\numexpr#1+1\endcsname}%
+ \let\xintifForLast\xint_secondoftwo
+ \ifx #5j\let\xintifForLast\xint_firstoftwo\expandafter\xintBreakForAndDo\fi
+ \XINT_x\let\xintifForFirst\xint_secondoftwo\XINT_forpair_d #1{#2}%
}%
\long\def\xintForthree #1#2#3in#4#5#6%
{%
- \XINT_toks \expandafter{\csname XINT_foriii_d\romannumeral#2\endcsname {#6}}%
- \expandafter\the\expandafter\XINT_toks #4,z%
+ \let\xintifForFirst\xint_firstoftwo
+ \XINT_toks {\XINT_forthree_d #2{#6}}%
+ \expandafter\the\expandafter\XINT_toks #4jZ%
}%
-\long\def\XINT_foriii_di #1(#2,#3,#4),%
+\long\def\XINT_forthree_d #1#2#3(#4)#5%
{%
- \long\def\XINT_y ##1##2##3##4{#1}%
- \long\def\XINT_x {\XINT_y {#2}{#3}{#4}{####4}}%
- \XINT_toks {\XINT_x\XINT_foriii_di {#1}}%
- \futurelet\XINT_token\XINT_for_last?
-}%
-\long\def\XINT_foriii_dii #1(#2,#3,#4),%
-{%
- \long\def\XINT_y ##1##2##3##4{#1}%
- \long\def\XINT_x {\XINT_y {####1}{#2}{#3}{#4}}%
- \XINT_toks {\XINT_x \XINT_foriii_dii {#1}}%
- \futurelet\XINT_token\XINT_for_last?
+ \long\def\XINT_y ##1##2##3##4##5##6##7##8##9{#2}%
+ \XINT_toks \expandafter{\romannumeral0\xintcsvtolist{ #4}}%
+ \long\edef\XINT_x {\noexpand\XINT_y \csname XINT_for_left#1\endcsname
+ \the\XINT_toks \csname XINT_for_right\the\numexpr#1+2\endcsname}%
+ \let\xintifForLast\xint_secondoftwo
+ \ifx #5j\let\xintifForLast\xint_firstoftwo\expandafter\xintBreakForAndDo\fi
+ \XINT_x\let\xintifForFirst\xint_secondoftwo\XINT_forthree_d #1{#2}%
}%
\long\def\xintForfour #1#2#3in#4#5#6%
{%
- \XINT_toks {\XINT_foriv_di {#6}}%
- \expandafter\the\expandafter\XINT_toks #4,z%
+ \let\xintifForFirst\xint_firstoftwo
+ \XINT_toks {\XINT_forfour_d #2{#6}}%
+ \expandafter\the\expandafter\XINT_toks #4jZ%
}%
-\long\def\XINT_foriv_di #1(#2,#3,#4,#5),%
+\long\def\XINT_forfour_d #1#2#3(#4)#5%
{%
- \long\def\XINT_y ##1##2##3##4{#1}%
- \long\def\XINT_x {\XINT_y {#2}{#3}{#4}{#5}}%
- \XINT_toks {\XINT_x\XINT_foriv_di {#1}}%
- \futurelet\XINT_token\XINT_for_last?
+ \long\def\XINT_y ##1##2##3##4##5##6##7##8##9{#2}%
+ \XINT_toks \expandafter{\romannumeral0\xintcsvtolist{ #4}}%
+ \long\edef\XINT_x {\noexpand\XINT_y \csname XINT_for_left#1\endcsname
+ \the\XINT_toks \csname XINT_for_right\the\numexpr#1+3\endcsname}%
+ \let\xintifForLast\xint_secondoftwo
+ \ifx #5j\let\xintifForLast\xint_firstoftwo\expandafter\xintBreakForAndDo\fi
+ \XINT_x\let\xintifForFirst\xint_secondoftwo\XINT_forfour_d #1{#2}%
}%
-\catcode`z 11
+\catcode`Z 11
+\catcode`j 11
\def\xintAssign #1\to
{%
\expandafter\XINT_assign_a\romannumeral-`0#1{}\to
@@ -1251,8 +1261,8 @@
\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}%
-\def\xintiSgn {\romannumeral0\xintisgn }%
-\def\xintisgn #1%
+\def\xintiiSgn {\romannumeral0\xintiisgn }%
+\def\xintiisgn #1%
{%
\expandafter\XINT_sgn \romannumeral-`0#1\Z%
}%
@@ -2039,12 +2049,11 @@
\expandafter\xint_minus_andstop
\romannumeral0\XINT_cuz_loop #3\W\W\W\W\W\W\W\Z
}%
-\def\xintiCmp {\romannumeral0\xinticmp }%
-\def\xinticmp #1%
+\def\xintCmp {\romannumeral0\xintcmp }%
+\def\xintcmp #1%
{%
\expandafter\xint_cmp\expandafter{\romannumeral0\xintnum{#1}}%
}%
-\let\xintCmp\xintiCmp \let\xintcmp\xinticmp
\def\xint_cmp #1#2%
{%
\expandafter\XINT_cmp_fork \romannumeral0\xintnum{#2}\Z #1\Z
@@ -2237,12 +2246,11 @@
\fi }%
}%
\def\XINT_xorof:_e ,#1#2^{#1}% allows empty list
-\def\xintiGeq {\romannumeral0\xintigeq }%
-\def\xintigeq #1%
+\def\xintGeq {\romannumeral0\xintgeq }%
+\def\xintgeq #1%
{%
\expandafter\xint_geq\expandafter {\romannumeral0\xintnum{#1}}%
}%
-\let\xintGeq\xintiGeq \let\xintgeq\xintigeq
\def\xint_geq #1#2%
{%
\expandafter\XINT_geq_fork \romannumeral0\xintnum{#2}\Z #1\Z
@@ -2978,6 +2986,11 @@
{%
\XINT_mul_M
}%
+\def\xintiiPow {\romannumeral0\xintiipow }%
+\def\xintiipow #1%
+{%
+ \expandafter\xint_pow\romannumeral-`0#1\Z%
+}%
\def\xintiPow {\romannumeral0\xintipow }%
\def\xintipow #1%
{%
@@ -3120,20 +3133,31 @@
\expandafter\xint_cleanupzeros_andstop
\romannumeral0\XINT_rev {#2}%
}%
-\def\xintiQuo {\romannumeral0\xintiquo }%
-\def\xintiRem {\romannumeral0\xintirem }%
-\def\xintiquo {\expandafter\xint_firstoftwo_andstop
- \romannumeral0\xintidivision }%
-\def\xintirem {\expandafter\xint_secondoftwo_andstop
- \romannumeral0\xintidivision }%
-\let\xintQuo\xintiQuo \let\xintquo\xintiquo
-\let\xintRem\xintiRem \let\xintrem\xintirem
-\def\xintiDivision {\romannumeral0\xintidivision }%
-\def\xintidivision #1%
+\def\xintiiQuo {\romannumeral0\xintiiquo }%
+\def\xintiiRem {\romannumeral0\xintiirem }%
+\def\xintiiquo {\expandafter\xint_firstoftwo_andstop
+ \romannumeral0\xintiidivision }%
+\def\xintiirem {\expandafter\xint_secondoftwo_andstop
+ \romannumeral0\xintiidivision }%
+\def\xintQuo {\romannumeral0\xintquo }%
+\def\xintRem {\romannumeral0\xintrem }%
+\def\xintquo {\expandafter\xint_firstoftwo_andstop
+ \romannumeral0\xintdivision }%
+\def\xintrem {\expandafter\xint_secondoftwo_andstop
+ \romannumeral0\xintdivision }%
+\def\xintiidivision #1%
+{%
+ \expandafter\xint_iidivision\expandafter {\romannumeral-`0#1}%
+}%
+\def\xint_iidivision #1#2%
+{%
+ \expandafter\XINT_div_fork \romannumeral-`0#2\Z #1\Z
+}%
+\def\xintDivision {\romannumeral0\xintdivision }%
+\def\xintdivision #1%
{%
\expandafter\xint_division\expandafter {\romannumeral0\xintnum{#1}}%
}%
-\let\xintDivision\xintiDivision \let\xintdivision\xintidivision
\def\xint_division #1#2%
{%
\expandafter\XINT_div_fork \romannumeral0\xintnum{#2}\Z #1\Z
@@ -3608,8 +3632,8 @@
}%
\def\xint_div_sub_cz\W\XINT_div_sub_AC_onestep #1#2{ #2}%
\def\xint_div_sub_az\W\XINT_div_sub_B #1#2#3#4\Z { #3}%
-\def\xintiFDg {\romannumeral0\xintifdg }%
-\def\xintifdg #1%
+\def\xintiiFDg {\romannumeral0\xintiifdg }%
+\def\xintiifdg #1%
{%
\expandafter\XINT_fdg \romannumeral-`0#1\W\Z
}%
@@ -3627,8 +3651,8 @@
0-\dummy { #1}% positive
\krof
}%
-\def\xintiLDg {\romannumeral0\xintildg }%
-\def\xintildg #1%
+\def\xintiiLDg {\romannumeral0\xintiildg }%
+\def\xintiildg #1%
{%
\expandafter\XINT_ldg\expandafter {\romannumeral-`0#1}%
}%
@@ -3643,19 +3667,19 @@
\expandafter\XINT_ldg_\romannumeral0\XINT_rev {#1}\Z
}%
\def\XINT_ldg_ #1#2\Z{ #1}%
-\def\xintiMON {\romannumeral0\xintimon }%
-\def\xintimon #1%
+\def\xintiiMON {\romannumeral0\xintiimon }%
+\def\xintiimon #1%
{%
- \ifodd\xintiLDg {#1}
+ \ifodd\xintiiLDg {#1}
\xint_afterfi{ -1}%
\else
\xint_afterfi{ 1}%
\fi
}%
-\def\xintiMMON {\romannumeral0\xintimmon }%
-\def\xintimmon #1%
+\def\xintiiMMON {\romannumeral0\xintiimmon }%
+\def\xintiimmon #1%
{%
- \ifodd\xintiLDg {#1}
+ \ifodd\xintiiLDg {#1}
\xint_afterfi{ 1}%
\else
\xint_afterfi{ -1}%
@@ -3679,18 +3703,10 @@
\xint_afterfi{ -1}%
\fi
}%
-\def\xintiOdd {\romannumeral0\xintiodd }%
-\def\xintiodd #1%
+\def\xintiiOdd {\romannumeral0\xintiiodd }%
+\def\xintiiodd #1%
{%
- \ifodd\xintiLDg{#1}
- \xint_afterfi{ 1}%
- \else
- \xint_afterfi{ 0}%
- \fi
-}%
-\def\XINT_Odd #1%
-{\romannumeral0%
- \ifodd\XINT_LDg{#1}
+ \ifodd\xintiiLDg{#1}
\xint_afterfi{ 1}%
\else
\xint_afterfi{ 0}%
@@ -3902,7 +3918,7 @@
\def\xintdecsplit #1#2%
{%
\expandafter \xint_split \expandafter
- {\romannumeral0\xintiabs {#2}}{#1}% fait expansion de A
+ {\romannumeral0\xintiiabs {#2}}{#1}% fait expansion de A
}%
\def\xint_split #1#2%
{%
@@ -4389,7 +4405,7 @@
\def\XINT_sqrt_big_g #1#2%
{%
\expandafter\XINT_sqrt_big_j
- \romannumeral0\xintidivision{#1}
+ \romannumeral0\xintiidivision{#1}
{\romannumeral0\XINT_dbl_pos #2\R\R\R\R\R\R\R\Z \W\W\W\W\W\W\W }{#2}%
}%
\def\XINT_sqrt_big_j #1%
@@ -4411,6 +4427,7 @@
{#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
%%