diff options
author | Karl Berry <karl@freefriends.org> | 2013-09-24 22:26:51 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-09-24 22:26:51 +0000 |
commit | d9dac37ce48e9caf9f59e903857484b52bec72cb (patch) | |
tree | 18c82bb521e2ac15cd9bf1e3e2602ea2bd568373 /Master/texmf-dist/tex/generic/xint/xintgcd.sty | |
parent | 60832b1a02dcf82922ff377c63d5fd5a57c201ad (diff) |
xint (24sep13)
git-svn-id: svn://tug.org/texlive/trunk@31744 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/xint/xintgcd.sty')
-rw-r--r-- | Master/texmf-dist/tex/generic/xint/xintgcd.sty | 68 |
1 files changed, 58 insertions, 10 deletions
diff --git a/Master/texmf-dist/tex/generic/xint/xintgcd.sty b/Master/texmf-dist/tex/generic/xint/xintgcd.sty index 467e62a9925..c7ff8245b84 100644 --- a/Master/texmf-dist/tex/generic/xint/xintgcd.sty +++ b/Master/texmf-dist/tex/generic/xint/xintgcd.sty @@ -22,7 +22,7 @@ %% in the same archive or directory.) %% %%---------------------------------------------------------------- -%% The xint bundle (version 1.08b of June 14, 2013) +%% The xint bundle (version 1.09a of September 22, 2013) %% xintgcd: Euclidean algorithm with xint package %% Copyright (C) 2013 by Jean-Francois Burnol %%---------------------------------------------------------------- @@ -165,7 +165,7 @@ \fi \expandafter\x\csname ver@xintgcd.sty\endcsname \ProvidesPackage{xintgcd}% - [2013/06/14 v1.08b Euclide algorithm with xint package (jfB)]% + [2013/09/24 v1.09a Euclide algorithm with xint package (jfB)]% \def\xintGCD {\romannumeral0\xintgcd }% \def\xintgcd #1% {% @@ -199,14 +199,62 @@ \romannumeral0\XINT_div_prepare {#1}{#2}\Z {#1}% }% +\def\xintGCDof {\romannumeral0\xintgcdof }% +\def\xintgcdof #1{\expandafter\XINT_gcdof_a\romannumeral-`0#1\relax }% +\def\XINT_gcdof_a #1{\expandafter\XINT_gcdof_b\romannumeral-`0#1\Z }% +\def\XINT_gcdof_b #1\Z #2{\expandafter\XINT_gcdof_c\romannumeral-`0#2\Z {#1}\Z}% +\def\XINT_gcdof_c #1{\xint_gob_til_relax #1\XINT_gcdof_e\relax\XINT_gcdof_d #1}% +\def\XINT_gcdof_d #1\Z {\expandafter\XINT_gcdof_b\romannumeral0\xintgcd {#1}}% +\def\XINT_gcdof_e #1\Z #2\Z { #2}% +\def\xintGCDof:csv #1{\expandafter\XINT_gcdof:_b\romannumeral-`0#1,,}% +\def\XINT_gcdof:_b #1,#2,{\expandafter\XINT_gcdof:_c\romannumeral-`0#2,{#1},}% +\def\XINT_gcdof:_c #1{\if #1,\expandafter\XINT_gcdof:_e + \else\expandafter\XINT_gcdof:_d\fi #1}% +\def\XINT_gcdof:_d #1,{\expandafter\XINT_gcdof:_b\romannumeral0\xintgcd {#1}}% +\def\XINT_gcdof:_e ,#1,{#1}% +\def\xintLCM {\romannumeral0\xintlcm}% +\def\xintlcm #1% +{% + \expandafter\XINT_lcm\expandafter{\romannumeral0\xintiabs {#1}}% +}% +\def\XINT_lcm #1#2% +{% + \expandafter\XINT_lcm_fork\romannumeral0\xintiabs {#2}\Z #1\Z +}% +\def\XINT_lcm_fork #1#2\Z #3#4\Z +{% + \xint_UDzerofork + #1\dummy \XINT_lcm_BisZero + #3\dummy \XINT_lcm_AisZero + 0\dummy \expandafter + \krof + \XINT_lcm_notzero\expandafter{\romannumeral0\XINT_gcd_loop {#1#2}{#3#4}}% + {#1#2}{#3#4}% +}% +\def\XINT_lcm_AisZero #1#2#3#4#5{ 0}% +\def\XINT_lcm_BisZero #1#2#3#4#5{ 0}% +\def\XINT_lcm_notzero #1#2#3{\xintiimul {#2}{\xintQuo{#3}{#1}}}% +\def\xintLCMof {\romannumeral0\xintlcmof }% +\def\xintlcmof #1{\expandafter\XINT_lcmof_a\romannumeral-`0#1\relax }% +\def\XINT_lcmof_a #1{\expandafter\XINT_lcmof_b\romannumeral-`0#1\Z }% +\def\XINT_lcmof_b #1\Z #2{\expandafter\XINT_lcmof_c\romannumeral-`0#2\Z {#1}\Z}% +\def\XINT_lcmof_c #1{\xint_gob_til_relax #1\XINT_lcmof_e\relax\XINT_lcmof_d #1}% +\def\XINT_lcmof_d #1\Z {\expandafter\XINT_lcmof_b\romannumeral0\xintlcm {#1}}% +\def\XINT_lcmof_e #1\Z #2\Z { #2}% +\def\xintLCMof:csv #1{\expandafter\XINT_lcmof:_a\romannumeral-`0#1,,}% +\def\XINT_lcmof:_a #1,#2,{\expandafter\XINT_lcmof:_c\romannumeral-`0#2,{#1},}% +\def\XINT_lcmof:_c #1{\if#1,\expandafter\XINT_lcmof:_e + \else\expandafter\XINT_lcmof:_d\fi #1}% +\def\XINT_lcmof:_d #1,{\expandafter\XINT_lcmof:_a\romannumeral0\xintlcm {#1}}% +\def\XINT_lcmof:_e ,#1,{#1}% \def\xintBezout {\romannumeral0\xintbezout }% \def\xintbezout #1% {% - \expandafter\xint_bezout\expandafter {\romannumeral-`0#1}% + \expandafter\xint_bezout\expandafter {\romannumeral0\xintnum{#1}}% }% \def\xint_bezout #1#2% {% - \expandafter\XINT_bezout_fork \romannumeral-`0#2\Z #1\Z + \expandafter\XINT_bezout_fork \romannumeral0\xintnum{#2}\Z #1\Z }% \def\XINT_bezout_fork #1#2\Z #3#4\Z {% @@ -251,7 +299,7 @@ \def\XINT_bezout_mm_post #1#2% {% \expandafter\XINT_bezout_mm_postb\expandafter - {\romannumeral0\xintiopp{#2}}{\romannumeral0\xintiopp{#1}}% + {\romannumeral0\xintiiopp{#2}}{\romannumeral0\xintiiopp{#1}}% }% \def\XINT_bezout_mm_postb #1#2% {% @@ -269,7 +317,7 @@ \def\XINT_bezout_mp_post #1#2% {% \expandafter\XINT_bezout_mp_postb\expandafter - {\romannumeral0\xintiopp {#2}}{#1}% + {\romannumeral0\xintiiopp {#2}}{#1}% }% \def\XINT_bezout_mp_postb #1#2#3#4#5% {% @@ -307,8 +355,8 @@ \def\XINT_bezout_loop_b #1#2#3#4#5#6#7#8% {% \expandafter \XINT_bezout_loop_c \expandafter - {\romannumeral0\xintiadd{\XINT_Mul{#5}{#2}}{#7}}% - {\romannumeral0\xintiadd{\XINT_Mul{#6}{#2}}{#8}}% + {\romannumeral0\xintiiadd{\XINT_Mul{#5}{#2}}{#7}}% + {\romannumeral0\xintiiadd{\XINT_Mul{#6}{#2}}{#8}}% {#1}{#3}{#4}{#5}{#6}% }% \def\XINT_bezout_loop_c #1#2% @@ -421,8 +469,8 @@ \def\XINT_bezalg_b #1#2#3#4#5#6#7#8% {% \expandafter\XINT_bezalg_c\expandafter - {\romannumeral0\xintiadd {\xintiMul {#6}{#2}}{#8}}% - {\romannumeral0\xintiadd {\xintiMul {#5}{#2}}{#7}}% + {\romannumeral0\xintiiadd {\xintiiMul {#6}{#2}}{#8}}% + {\romannumeral0\xintiiadd {\xintiiMul {#5}{#2}}{#7}}% {#1}{#2}{#3}{#4}{#5}{#6}% }% \def\XINT_bezalg_c #1#2#3#4#5#6% |