diff options
author | Karl Berry <karl@freefriends.org> | 2017-08-01 21:38:49 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2017-08-01 21:38:49 +0000 |
commit | 9a9c1b6e2502a6a9c90e739c411de26012b9db2c (patch) | |
tree | b72c9fa43c71360ad6c0d3c8e1b86c2530273492 /Master/texmf-dist/tex/generic/xint/xint.sty | |
parent | 7ba0b2e501e4b5d83a48295804d3570ef3407f8a (diff) |
xint (1aug17)
git-svn-id: svn://tug.org/texlive/trunk@44934 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/xint/xint.sty')
-rw-r--r-- | Master/texmf-dist/tex/generic/xint/xint.sty | 231 |
1 files changed, 57 insertions, 174 deletions
diff --git a/Master/texmf-dist/tex/generic/xint/xint.sty b/Master/texmf-dist/tex/generic/xint/xint.sty index de8669e6acb..4641adb163b 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 1.2l 2017/07/26 +%% The xint bundle 1.2m 2017/07/31 %% Copyright (C) 2013-2017 by Jean-Francois Burnol %% xint: Expandable operations on big integers %% --------------------------------------------------------------- @@ -70,7 +70,7 @@ \XINTsetupcatcodes% defined in xintkernel.sty (loaded by xintcore.sty) \XINT_providespackage \ProvidesPackage{xint}% - [2017/07/26 1.2l Expandable operations on big integers (JFB)]% + [2017/07/31 1.2m 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}% @@ -389,8 +389,6 @@ {% \expandafter\XINT_geq_fork\expandafter #1\romannumeral`&&@#3\xint:#2\xint: }% -\let\XINT_geq_pre \xintiigeq % TEMPORAIRE (oui, mais depuis quand ?) -\let\XINT_Geq \xintGeq % TEMPORAIRE ATTENTION FAIT xintNum (et alors?) \def\XINT_geq #1#2\xint:#3% {% \expandafter\XINT_geq_fork\expandafter #1\romannumeral0\xintnum{#3}\xint:#2\xint: @@ -414,173 +412,63 @@ \def\XINT_geq_secondiszero #1\krof #20#3\xint:#4\xint:{ 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\xint:#4\xint:{\XINT_geq_pp #1#4\xint:#2#3\xint:}% -\def\XINT_geq_pp #1\xint: -{% - \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_i - \R\xint:\xint_c_xii \R\xint:\xint_c_x \R\xint:\xint_c_viii \R\xint:\xint_c_vi - \R\xint:\xint_c_iv \R\xint:\xint_c_ii \R\xint:\xint_c_\W - \X -}% -\def\XINT_geq_pp_a #1\xint:#2\X #3\xint: -{% - \expandafter\XINT_geq_checklengths - \the\numexpr #1\expandafter\xint:% - \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_i - \R\xint:\xint_c_xii \R\xint:\xint_c_x \R\xint:\xint_c_viii \R\xint:\xint_c_vi - \R\xint:\xint_c_iv \R\xint:\xint_c_ii \R\xint:\xint_c_\W - \Z!\Z!\Z!\Z!\Z!\W #2\Z!\Z!\Z!\Z!\Z!\W -}% -\def\XINT_geq_checklengths #1\xint:#2\xint: -{% - \ifnum #1=#2 - \expandafter\xint_firstoftwo - \else - \expandafter\xint_secondoftwo - \fi - \XINT_geq_aa {\XINT_geq_distinctlengths {#1}{#2}}% -}% -\def\XINT_geq_distinctlengths #1#2#3\W #4\W -{% - \ifnum #1>#2 - \expandafter\xint_firstoftwo - \else - \expandafter\xint_secondoftwo - \fi - { 1}{ 0}% -}% -\def\XINT_geq_aa {\expandafter\XINT_geq_w\the\numexpr\XINT_geq_a \xint_c_i }% -\def\XINT_geq_a #1!#2!#3!#4!#5\W #6!#7!#8!#9!% -{% - \XINT_geq_b #1!#6!#2!#7!#3!#8!#4!#9!#5\W -}% -\def\XINT_geq_b #1#2#3!#4!% -{% - \xint_gob_til_Z #2\XINT_geq_bi \Z - \expandafter\XINT_geq_c\the\numexpr#1+1#4-#3-\xint_c_i\xint:% -}% -\def\XINT_geq_c 1#1#2\xint:% -{% - 1#2\expandafter!\the\numexpr\XINT_geq_d #1% -}% -\def\XINT_geq_d #1#2#3!#4!% -{% - \xint_gob_til_Z #2\XINT_geq_di \Z - \expandafter\XINT_geq_e\the\numexpr#1+1#4-#3-\xint_c_i\xint:% -}% -\def\XINT_geq_e 1#1#2\xint:% -{% - 1#2\expandafter!\the\numexpr\XINT_geq_f #1% -}% -\def\XINT_geq_f #1#2#3!#4!% -{% - \xint_gob_til_Z #2\XINT_geq_fi \Z - \expandafter\XINT_geq_g\the\numexpr#1+1#4-#3-\xint_c_i\xint:% -}% -\def\XINT_geq_g 1#1#2\xint:% -{% - 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\xint:% -}% -\def\XINT_geq_i 1#1#2\xint:% -{% - 1#2\expandafter!\the\numexpr\XINT_geq_a #1% -}% -\def\XINT_geq_bi\Z - \expandafter\XINT_geq_c\the\numexpr#1+1#2-#3\xint:#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\xint:#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\xint:#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\xint:#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\XINT_geq_minusminus --{\XINT_geq_plusplus {}{}}% +\def\XINT_geq_plusplus + {\expandafter\XINT_geq_finish\romannumeral0\XINT_cmp_plusplus}% +\def\XINT_geq_finish #1{\if-#1\expandafter\XINT_geq_no + \else\expandafter\XINT_geq_yes\fi}% +\def\XINT_geq_no 1{ 0}% +\def\XINT_geq_yes { 1}% \def\xintiMax {\romannumeral0\xintimax }% \def\xintimax #1% {% - \expandafter\xint_max\expandafter {\romannumeral0\xintnum{#1}}% + \expandafter\xint_max\romannumeral0\xintnum{#1}\xint: }% -\def\xint_max #1#2% +\def\xint_max #1\xint:#2% {% - \expandafter\XINT_max_pre\expandafter {\romannumeral0\xintnum{#2}}{#1}% + \expandafter\XINT_max_fork\romannumeral0\xintnum{#2}\xint:#1\xint: }% \def\xintiiMax {\romannumeral0\xintiimax }% \def\xintiimax #1% {% - \expandafter\xint_iimax\expandafter {\romannumeral`&&@#1}% + \expandafter\xint_iimax \romannumeral`&&@#1\xint: }% -\def\xint_iimax #1#2% +\def\xint_iimax #1\xint:#2% {% - \expandafter\XINT_max_pre\expandafter {\romannumeral`&&@#2}{#1}% + \expandafter\XINT_max_fork\romannumeral`&&@#2\xint:#1\xint: }% -\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 +\def\XINT_max_fork #1#2\xint:#3#4\xint: {% \xint_UDsignsfork #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 + #1-\XINT_max_plusminus % B < 0, A >= 0 + #3-\XINT_max_minusplus % 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 + #10\XINT_max_pluszero % B = 0, A > 0 + #30\XINT_max_zeroplus % 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_thenstop }% -\def\XINT_max_zeroplus #1#2#3#4{\xint_firstoftwo_thenstop }% -\def\XINT_max_pluszero #1#2#3#4{\xint_secondoftwo_thenstop }% -\def\XINT_max_minusplus #1#2#3#4{\xint_firstoftwo_thenstop }% -\def\XINT_max_plusminus #1#2#3#4{\xint_secondoftwo_thenstop }% -\def\XINT_max_plusplus #1#2#3#4% -{% - \ifodd\XINT_Geq {#4#2}{#3#1} + #3#1#2\xint:#4\xint: \expandafter\xint_firstoftwo_thenstop \else \expandafter\xint_secondoftwo_thenstop \fi + {#3#4}{#1#2}% }% -\def\XINT_max_minusminus #1#2#3#4% +\def\XINT_max_zerozero #1\fi{\xint_firstoftwo_thenstop }% +\def\XINT_max_zeroplus #1\fi{\xint_secondoftwo_thenstop }% +\def\XINT_max_pluszero #1\fi{\xint_firstoftwo_thenstop }% +\def\XINT_max_minusplus #1\fi{\xint_secondoftwo_thenstop }% +\def\XINT_max_plusminus #1\fi{\xint_firstoftwo_thenstop }% +\def\XINT_max_plusplus {% - \ifodd\XINT_Geq {#1}{#2} - \expandafter\xint_firstoftwo_thenstop - \else - \expandafter\xint_secondoftwo_thenstop - \fi + \if1\romannumeral0\XINT_geq_plusplus +}% +\def\XINT_max_minusminus --% +{% + \unless\if1\romannumeral0\XINT_geq_plusplus{}{}% }% \def\xintiMaxof {\romannumeral0\xintimaxof }% \def\xintimaxof #1{\expandafter\XINT_imaxof_a\romannumeral`&&@#1\xint:}% @@ -606,58 +494,53 @@ \def\xintiMin {\romannumeral0\xintimin }% \def\xintimin #1% {% - \expandafter\xint_min\expandafter {\romannumeral0\xintnum{#1}}% + \expandafter\xint_min\romannumeral0\xintnum{#1}\xint: }% -\def\xint_min #1#2% +\def\xint_min #1\xint:#2% {% - \expandafter\XINT_min_pre\expandafter {\romannumeral0\xintnum{#2}}{#1}% + \expandafter\XINT_min_fork\romannumeral0\xintnum{#2}\xint:#1\xint: }% \def\xintiiMin {\romannumeral0\xintiimin }% \def\xintiimin #1% {% - \expandafter\xint_iimin\expandafter {\romannumeral`&&@#1}% + \expandafter\xint_iimin \romannumeral`&&@#1\xint: }% -\def\xint_iimin #1#2% +\def\xint_iimin #1\xint:#2% {% - \expandafter\XINT_min_pre\expandafter {\romannumeral`&&@#2}{#1}% + \expandafter\XINT_min_fork\romannumeral`&&@#2\xint:#1\xint: }% -\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 +\def\XINT_min_fork #1#2\xint:#3#4\xint: {% \xint_UDsignsfork #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 + #1-\XINT_min_plusminus % B < 0, A >= 0 + #3-\XINT_min_minusplus % 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 + #10\XINT_min_pluszero % B = 0, A > 0 + #30\XINT_min_zeroplus % 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_thenstop }% -\def\XINT_min_zeroplus #1#2#3#4{\xint_secondoftwo_thenstop }% -\def\XINT_min_pluszero #1#2#3#4{\xint_firstoftwo_thenstop }% -\def\XINT_min_minusplus #1#2#3#4{\xint_secondoftwo_thenstop }% -\def\XINT_min_plusminus #1#2#3#4{\xint_firstoftwo_thenstop }% -\def\XINT_min_plusplus #1#2#3#4% -{% - \ifodd\XINT_Geq {#4#2}{#3#1} + #3#1#2\xint:#4\xint: \expandafter\xint_secondoftwo_thenstop \else \expandafter\xint_firstoftwo_thenstop \fi + {#3#4}{#1#2}% }% -\def\XINT_min_minusminus #1#2#3#4% +\def\XINT_min_zerozero #1\fi{\xint_firstoftwo_thenstop }% +\def\XINT_min_zeroplus #1\fi{\xint_firstoftwo_thenstop }% +\def\XINT_min_pluszero #1\fi{\xint_secondoftwo_thenstop }% +\def\XINT_min_minusplus #1\fi{\xint_firstoftwo_thenstop }% +\def\XINT_min_plusminus #1\fi{\xint_secondoftwo_thenstop }% +\def\XINT_min_plusplus {% - \ifodd\XINT_Geq {#1}{#2} - \expandafter\xint_secondoftwo_thenstop - \else - \expandafter\xint_firstoftwo_thenstop - \fi + \if1\romannumeral0\XINT_geq_plusplus +}% +\def\XINT_min_minusminus --% +{% + \unless\if1\romannumeral0\XINT_geq_plusplus{}{}% }% \def\xintiMinof {\romannumeral0\xintiminof }% \def\xintiminof #1{\expandafter\XINT_iminof_a\romannumeral`&&@#1\xint:}% |