diff options
author | Karl Berry <karl@freefriends.org> | 2015-10-20 21:19:41 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2015-10-20 21:19:41 +0000 |
commit | c0fd6688c3703e0e3835fea389bccdf0fc0e6902 (patch) | |
tree | cf3c9c4ab195d5cab18184a06fa70fe7c4f8073c /Master/texmf-dist/tex/generic/xint/xint.sty | |
parent | cf6885a752177d109d39e62098ee48cb8745580a (diff) |
xint (20oct15)
git-svn-id: svn://tug.org/texlive/trunk@38680 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 | 86 |
1 files changed, 53 insertions, 33 deletions
diff --git a/Master/texmf-dist/tex/generic/xint/xint.sty b/Master/texmf-dist/tex/generic/xint/xint.sty index b06c32ff687..757e72728b6 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.2 2015/10/10 +%% The xint bundle v1.2a 2015/10/19 %% Copyright (C) 2013-2015 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}% - [2015/10/10 v1.2 Expandable operations on big integers (jfB)]% + [2015/10/19 v1.2a 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}% @@ -90,7 +90,7 @@ \fi }% \def\xintiiIsOne {\romannumeral0\xintiiisone }% -\def\xintiiisone #1{\expandafter\XINT_isone\romannumeral-`0#1\W\Z }% +\def\xintiiisone #1{\expandafter\XINT_isone\romannumeral`&&@#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 }% @@ -127,9 +127,9 @@ -{0.#1}% \krof }% -\def\xintBool #1{\romannumeral-`0% +\def\xintBool #1{\romannumeral`&&@% \csname if#1\endcsname\expandafter1\else\expandafter0\fi }% -\def\xintToggle #1{\romannumeral-`0\iftoggle{#1}{1}{0}}% +\def\xintToggle #1{\romannumeral`&&@\iftoggle{#1}{1}{0}}% \def\xintifSgn {\romannumeral0\xintifsgn }% \def\xintifsgn #1% {% @@ -293,10 +293,10 @@ \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\xintiicmp #1{\expandafter\XINT_iicmp\romannumeral`&&@#1\Z }% \def\XINT_iicmp #1#2\Z #3% {% - \expandafter\XINT_cmp_nfork\expandafter #1\romannumeral-`0#3\Z #2\Z + \expandafter\XINT_cmp_nfork\expandafter #1\romannumeral`&&@#3\Z #2\Z }% \let\XINT_Cmp \xintiiCmp \def\XINT_icmp #1#2\Z #3% @@ -496,8 +496,8 @@ \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\xintandof #1{\expandafter\XINT_andof_a\romannumeral`&&@#1\relax }% +\def\XINT_andof_a #1{\expandafter\XINT_andof_b\romannumeral`&&@#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 @@ -505,8 +505,8 @@ \def\XINT_andof_no #1\relax { 0}% \def\XINT_andof_e #1\Z { 1}% \def\xintORof {\romannumeral0\xintorof }% -\def\xintorof #1{\expandafter\XINT_orof_a\romannumeral-`0#1\relax }% -\def\XINT_orof_a #1{\expandafter\XINT_orof_b\romannumeral-`0#1\Z }% +\def\xintorof #1{\expandafter\XINT_orof_a\romannumeral`&&@#1\relax }% +\def\XINT_orof_a #1{\expandafter\XINT_orof_b\romannumeral`&&@#1\Z }% \def\XINT_orof_b #1% {\xint_gob_til_relax #1\XINT_orof_e\relax\XINT_orof_c #1}% \def\XINT_orof_c #1\Z @@ -515,8 +515,8 @@ \def\XINT_orof_e #1\Z { 0}% \def\xintXORof {\romannumeral0\xintxorof }% \def\xintxorof #1{\expandafter\XINT_xorof_a\expandafter - 0\romannumeral-`0#1\relax }% -\def\XINT_xorof_a #1#2{\expandafter\XINT_xorof_b\romannumeral-`0#2\Z #1}% + 0\romannumeral`&&@#1\relax }% +\def\XINT_xorof_a #1#2{\expandafter\XINT_xorof_b\romannumeral`&&@#2\Z #1}% \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% @@ -528,10 +528,10 @@ \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\xintiigeq #1{\expandafter\XINT_iigeq\romannumeral`&&@#1\Z }% \def\XINT_iigeq #1#2\Z #3% {% - \expandafter\XINT_geq_fork\expandafter #1\romannumeral-`0#3\Z #2\Z + \expandafter\XINT_geq_fork\expandafter #1\romannumeral`&&@#3\Z #2\Z }% \let\XINT_geq_pre \xintiigeq % TEMPORAIRE \let\XINT_Geq \xintGeq % TEMPORAIRE ATTENTION FAIT xintNum @@ -685,11 +685,11 @@ \def\xintiiMax {\romannumeral0\xintiimax }% \def\xintiimax #1% {% - \expandafter\xint_iimax\expandafter {\romannumeral-`0#1}% + \expandafter\xint_iimax\expandafter {\romannumeral`&&@#1}% }% \def\xint_iimax #1#2% {% - \expandafter\XINT_max_pre\expandafter {\romannumeral-`0#2}{#1}% + \expandafter\XINT_max_pre\expandafter {\romannumeral`&&@#2}{#1}% }% \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}}% @@ -730,15 +730,25 @@ \fi }% \def\xintiMaxof {\romannumeral0\xintimaxof }% -\def\xintimaxof #1{\expandafter\XINT_imaxof_a\romannumeral-`0#1\relax }% +\def\xintimaxof #1{\expandafter\XINT_imaxof_a\romannumeral`&&@#1\relax }% \def\XINT_imaxof_a #1{\expandafter\XINT_imaxof_b\romannumeral0\xintnum{#1}\Z }% \def\XINT_imaxof_b #1\Z #2% - {\expandafter\XINT_imaxof_c\romannumeral-`0#2\Z {#1}\Z}% + {\expandafter\XINT_imaxof_c\romannumeral`&&@#2\Z {#1}\Z}% \def\XINT_imaxof_c #1% {\xint_gob_til_relax #1\XINT_imaxof_e\relax\XINT_imaxof_d #1}% \def\XINT_imaxof_d #1\Z {\expandafter\XINT_imaxof_b\romannumeral0\xintimax {#1}}% \def\XINT_imaxof_e #1\Z #2\Z { #2}% +\def\xintiiMaxof {\romannumeral0\xintiimaxof }% +\def\xintiimaxof #1{\expandafter\XINT_iimaxof_a\romannumeral`&&@#1\relax }% +\def\XINT_iimaxof_a #1{\expandafter\XINT_iimaxof_b\romannumeral`&&@#1\Z }% +\def\XINT_iimaxof_b #1\Z #2% + {\expandafter\XINT_iimaxof_c\romannumeral`&&@#2\Z {#1}\Z}% +\def\XINT_iimaxof_c #1% + {\xint_gob_til_relax #1\XINT_iimaxof_e\relax\XINT_iimaxof_d #1}% +\def\XINT_iimaxof_d #1\Z + {\expandafter\XINT_iimaxof_b\romannumeral0\xintiimax {#1}}% +\def\XINT_iimaxof_e #1\Z #2\Z { #2}% \def\xintiMin {\romannumeral0\xintimin }% \def\xintimin #1% {% @@ -751,11 +761,11 @@ \def\xintiiMin {\romannumeral0\xintiimin }% \def\xintiimin #1% {% - \expandafter\xint_iimin\expandafter {\romannumeral-`0#1}% + \expandafter\xint_iimin\expandafter {\romannumeral`&&@#1}% }% \def\xint_iimin #1#2% {% - \expandafter\XINT_min_pre\expandafter {\romannumeral-`0#2}{#1}% + \expandafter\XINT_min_pre\expandafter {\romannumeral`&&@#2}{#1}% }% \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}}% @@ -796,22 +806,32 @@ \fi }% \def\xintiMinof {\romannumeral0\xintiminof }% -\def\xintiminof #1{\expandafter\XINT_iminof_a\romannumeral-`0#1\relax }% +\def\xintiminof #1{\expandafter\XINT_iminof_a\romannumeral`&&@#1\relax }% \def\XINT_iminof_a #1{\expandafter\XINT_iminof_b\romannumeral0\xintnum{#1}\Z }% \def\XINT_iminof_b #1\Z #2% - {\expandafter\XINT_iminof_c\romannumeral-`0#2\Z {#1}\Z}% + {\expandafter\XINT_iminof_c\romannumeral`&&@#2\Z {#1}\Z}% \def\XINT_iminof_c #1% {\xint_gob_til_relax #1\XINT_iminof_e\relax\XINT_iminof_d #1}% \def\XINT_iminof_d #1\Z {\expandafter\XINT_iminof_b\romannumeral0\xintimin {#1}}% \def\XINT_iminof_e #1\Z #2\Z { #2}% +\def\xintiiMinof {\romannumeral0\xintiiminof }% +\def\xintiiminof #1{\expandafter\XINT_iiminof_a\romannumeral`&&@#1\relax }% +\def\XINT_iiminof_a #1{\expandafter\XINT_iiminof_b\romannumeral`&&@#1\Z }% +\def\XINT_iiminof_b #1\Z #2% + {\expandafter\XINT_iiminof_c\romannumeral`&&@#2\Z {#1}\Z}% +\def\XINT_iiminof_c #1% + {\xint_gob_til_relax #1\XINT_iiminof_e\relax\XINT_iiminof_d #1}% +\def\XINT_iiminof_d #1\Z + {\expandafter\XINT_iiminof_b\romannumeral0\xintiimin {#1}}% +\def\XINT_iiminof_e #1\Z #2\Z { #2}% \def\xintiiSum {\romannumeral0\xintiisum }% \def\xintiisum #1{\xintiisumexpr #1\relax }% \def\xintiiSumExpr {\romannumeral0\xintiisumexpr }% -\def\xintiisumexpr {\expandafter\XINT_sumexpr\romannumeral-`0}% +\def\xintiisumexpr {\expandafter\XINT_sumexpr\romannumeral`&&@}% \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}% + {\expandafter\XINT_sum_loop_b \romannumeral`&&@#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 @@ -820,10 +840,10 @@ \def\xintiiPrd {\romannumeral0\xintiiprd }% \def\xintiiprd #1{\xintiiprdexpr #1\relax }% \def\xintiiPrdExpr {\romannumeral0\xintiiprdexpr }% -\def\xintiiprdexpr {\expandafter\XINT_prdexpr\romannumeral-`0}% +\def\xintiiprdexpr {\expandafter\XINT_prdexpr\romannumeral`&&@}% \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`&&@#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 @@ -904,7 +924,7 @@ \def\xintDSL {\romannumeral0\xintdsl }% \def\xintdsl #1% {% - \expandafter\XINT_dsl \romannumeral-`0#1\Z + \expandafter\XINT_dsl \romannumeral`&&@#1\Z }% \def\XINT_DSL #1{\romannumeral0\XINT_dsl #1\Z }% \def\XINT_dsl #1% @@ -916,7 +936,7 @@ \def\xintDSR {\romannumeral0\xintdsr }% \def\xintdsr #1% {% - \expandafter\XINT_dsr_a\expandafter {\romannumeral-`0#1}\W\Z + \expandafter\XINT_dsr_a\expandafter {\romannumeral`&&@#1}\W\Z }% \def\XINT_DSR #1{\romannumeral0\XINT_dsr_a {#1}\W\Z }% \def\XINT_dsr_a @@ -953,7 +973,7 @@ \def\xintDSH {\romannumeral0\xintdsh }% \def\xintdsh #1#2% {% - \expandafter\xint_dsh\expandafter {\romannumeral-`0#2}{#1}% + \expandafter\xint_dsh\expandafter {\romannumeral`&&@#2}{#1}% }% \def\xint_dsh #1#2% {% @@ -976,7 +996,7 @@ \def\xintDSx {\romannumeral0\xintdsx }% \def\xintdsx #1#2% {% - \expandafter\xint_dsx\expandafter {\romannumeral-`0#2}{#1}% + \expandafter\xint_dsx\expandafter {\romannumeral`&&@#2}{#1}% }% \def\xint_dsx #1#2% {% @@ -1251,7 +1271,7 @@ \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\xintiisquareroot #1{\expandafter\XINT_sqrt_checkin\romannumeral`&&@#1\Z }% \def\XINT_sqrt_checkin #1% {% \xint_UDzerominusfork @@ -1419,7 +1439,7 @@ \def\XINT_sqrt_big_end #1#2#3#4{ {#3}{#2}}% \def\xintiiE {\romannumeral0\xintiie }% used in \xintMod. \def\xintiie #1#2% - {\expandafter\XINT_iie\the\numexpr #2\expandafter.\expandafter{\romannumeral-`0#1}}% + {\expandafter\XINT_iie\the\numexpr #2\expandafter.\expandafter{\romannumeral`&&@#1}}% \def\XINT_iie #1.#2{\ifnum#1>\xint_c_ \xint_dothis{\xint_dsh {#2}{-#1}}\fi \xint_orthat{ #2}}% \catcode`! 11 |