summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/xint/xintgcd.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/generic/xint/xintgcd.sty')
-rw-r--r--Master/texmf-dist/tex/generic/xint/xintgcd.sty113
1 files changed, 44 insertions, 69 deletions
diff --git a/Master/texmf-dist/tex/generic/xint/xintgcd.sty b/Master/texmf-dist/tex/generic/xint/xintgcd.sty
index 15f5e156046..ec42410dc1c 100644
--- a/Master/texmf-dist/tex/generic/xint/xintgcd.sty
+++ b/Master/texmf-dist/tex/generic/xint/xintgcd.sty
@@ -20,11 +20,11 @@
%% original source files, as listed above, are part of the
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
-%%----------------------------------------------------------------
-%% The xint bundle (version 1.09n of April 1st, 2014)
-%% xintgcd: Euclidean algorithm with xint package
+%% ---------------------------------------------------------------
+%% The xint bundle v1.1 (2014/10/28)
%% Copyright (C) 2013-2014 by Jean-Francois Burnol
-%%----------------------------------------------------------------
+%% xintgcd: Euclidean algorithm with xint package
+%% ---------------------------------------------------------------
\begingroup\catcode61\catcode48\catcode32=10\relax%
\catcode13=5 % ^^M
\endlinechar=13 %
@@ -36,10 +36,9 @@
\catcode45=12 % -
\catcode46=12 % .
\catcode58=12 % :
- \def\space { }%
\let\z\endgroup
\expandafter\let\expandafter\x\csname ver@xintgcd.sty\endcsname
- \expandafter\let\expandafter\w\csname ver@xint.sty\endcsname
+ \expandafter\let\expandafter\w\csname ver@xintcore.sty\endcsname
\expandafter
\ifx\csname PackageInfo\endcsname\relax
\def\y#1#2{\immediate\write-1{Package #1 Info: #2.}}%
@@ -52,56 +51,26 @@
\aftergroup\endinput
\else
\ifx\x\relax % plain-TeX, first loading of xintgcd.sty
- \ifx\w\relax % but xint.sty not yet loaded.
- \y{xintgcd}{now issuing \string\input\space xint.sty}%
- \def\z{\endgroup\input xint.sty\relax}%
+ \ifx\w\relax % but xintcore.sty not yet loaded.
+ \def\z{\endgroup\input xintcore.sty\relax}%
\fi
\else
\def\empty {}%
\ifx\x\empty % LaTeX, first loading,
% variable is initialized, but \ProvidesPackage not yet seen
- \ifx\w\relax % xint.sty not yet loaded.
- \y{xintgcd}{now issuing \string\RequirePackage{xint}}%
- \def\z{\endgroup\RequirePackage{xint}}%
+ \ifx\w\relax % xintcore.sty not yet loaded.
+ \def\z{\endgroup\RequirePackage{xintcore}}%
\fi
\else
- \y{xintgcd}{I was already loaded, aborting input}%
- \aftergroup\endinput
+ \aftergroup\endinput % xintgcd already loaded.
\fi
\fi
\fi
\z%
-\begingroup\catcode61\catcode48\catcode32=10\relax%
- \catcode13=5 % ^^M
- \endlinechar=13 %
- \catcode123=1 % {
- \catcode125=2 % }
- \catcode64=11 % @
- \catcode35=6 % #
- \catcode44=12 % ,
- \catcode45=12 % -
- \catcode46=12 % .
- \catcode58=12 % :
- \ifdefined\PackageInfo
- \def\y#1#2{\PackageInfo{#1}{#2}}%
- \else
- \def\y#1#2{\immediate\write-1{Package #1 Info: #2.}}%
- \fi
- \def\empty {}%
- \expandafter\let\expandafter\w\csname ver@xint.sty\endcsname
- \ifx\w\relax % Plain TeX, user gave a file name at the prompt
- \y{xintgcd}{Loading of package xint failed, aborting input}%
- \aftergroup\endinput
- \fi
- \ifx\w\empty % LaTeX, user gave a file name at the prompt
- \y{xintgcd}{Loading of package xint failed, aborting input}%
- \aftergroup\endinput
- \fi
-\endgroup%
-\XINTsetupcatcodes%
+\XINTsetupcatcodes% defined in xintkernel.sty
\XINT_providespackage
\ProvidesPackage{xintgcd}%
- [2014/04/01 v1.09n Euclide algorithm with xint package (jfB)]%
+ [2014/10/28 v1.1 Euclide algorithm with xint package (jfB)]%
\def\xintGCD {\romannumeral0\xintgcd }%
\def\xintgcd #1%
{%
@@ -135,13 +104,6 @@
\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\xintLCM {\romannumeral0\xintlcm}%
\def\xintlcm #1%
{%
@@ -164,13 +126,6 @@
\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}{\xintiiQuo{#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\xintBezout {\romannumeral0\xintbezout }%
\def\xintbezout #1%
{%
@@ -421,7 +376,29 @@
{%
\space {#1}{#3}{0}{1}{#2}{#4}{1}{0}%
}%
-\def\xintTypesetEuclideAlgorithm #1#2%
+\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\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\xintTypesetEuclideAlgorithm {%
+ \unless\ifdefined\xintAssignArray
+ \errmessage
+ {xintgcd: package xinttools is required for \string\xintTypesetEuclideAlgorithm}%
+ \expandafter\xint_gobble_iii
+ \fi
+ \XINT_TypesetEuclideAlgorithm
+}%
+\def\XINT_TypesetEuclideAlgorithm #1#2%
{% l'algo remplace #1 et #2 par |#1| et |#2|
\par
\begingroup
@@ -440,7 +417,15 @@
\repeat
\endgroup
}%
-\def\xintTypesetBezoutAlgorithm #1#2%
+\def\xintTypesetBezoutAlgorithm {%
+ \unless\ifdefined\xintAssignArray
+ \errmessage
+ {xintgcd: package xinttools is required for \string\xintTypesetBezoutAlgorithm}%
+ \expandafter\xint_gobble_iii
+ \fi
+ \XINT_TypesetBezoutAlgorithm
+}%
+\def\XINT_TypesetBezoutAlgorithm #1#2%
{%
\par
\begingroup
@@ -476,16 +461,6 @@
\par
\endgroup
}%
-\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_of:_e
- \else\expandafter\XINT_gcdof:_d\fi #1}%
-\def\XINT_gcdof:_d #1,{\expandafter\XINT_gcdof:_b\romannumeral0\xintgcd {#1}}%
-\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_of:_e
- \else\expandafter\XINT_lcmof:_d\fi #1}%
-\def\XINT_lcmof:_d #1,{\expandafter\XINT_lcmof:_a\romannumeral0\xintlcm {#1}}%
\XINT_restorecatcodes_endinput%
\endinput
%%