summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/xint/xintfrac.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2013-05-08 22:13:20 +0000
committerKarl Berry <karl@freefriends.org>2013-05-08 22:13:20 +0000
commit577a323e68bf1ee8b7c0290a16160992978bbd42 (patch)
treed06c68d5398f9c9d9096fb363898adb2efa3524c /Master/texmf-dist/tex/generic/xint/xintfrac.sty
parent441fd17da36fd7b4b30c65a07abaa9a589dc9c01 (diff)
xint (8may13)
git-svn-id: svn://tug.org/texlive/trunk@30337 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/xint/xintfrac.sty')
-rw-r--r--Master/texmf-dist/tex/generic/xint/xintfrac.sty54
1 files changed, 21 insertions, 33 deletions
diff --git a/Master/texmf-dist/tex/generic/xint/xintfrac.sty b/Master/texmf-dist/tex/generic/xint/xintfrac.sty
index 9f974caa565..73ea010430a 100644
--- a/Master/texmf-dist/tex/generic/xint/xintfrac.sty
+++ b/Master/texmf-dist/tex/generic/xint/xintfrac.sty
@@ -22,7 +22,7 @@
%% in the same archive or directory.)
%%
%%----------------------------------------------------------------
-%% The xint bundle (version 1.05a of May 2nd, 2013)
+%% The xint bundle (version 1.06 of May 7th, 2013)
%% xintfrac: Expandable operations on fractions
%% Copyright (C) 2013 by Jean-Francois Burnol
%%----------------------------------------------------------------
@@ -117,6 +117,7 @@
\catcode94=\the\catcode94 % ^
\catcode93=\the\catcode93 % ]
\catcode91=\the\catcode91 % [
+ \catcode96=\the\catcode96 % `
\catcode47=\the\catcode47 % /
\catcode41=\the\catcode41 % )
\catcode40=\the\catcode40 % (
@@ -164,7 +165,7 @@
\fi
\expandafter\x\csname ver@xintfrac.sty\endcsname
\ProvidesPackage{xintfrac}%
- [2013/05/02 v1.05a Expandable operations on fractions (jfB)]%
+ [2013/05/07 v1.06 Expandable operations on fractions (jfB)]%
\def\xintLen {\romannumeral0\xintlen }%
\def\xintlen #1%
{%
@@ -207,7 +208,7 @@
\def\XINT@inFrac {\romannumeral0\XINT@infrac }%
\def\XINT@infrac #1%
{%
- \expandafter\expandafter\expandafter\XINT@infrac@ #1[\W]\Z\T
+ \expandafter\XINT@infrac@ \romannumeral-`0#1[\W]\Z\T
}%
\def\XINT@infrac@ #1[#2#3]#4\Z
{%
@@ -230,7 +231,7 @@
{%
\xint@UDwfork
#2\dummy \XINT@infrac@BCa
- \W\dummy {\expandafter\expandafter\expandafter\XINT@infrac@BCb #2}%
+ \W\dummy {\expandafter\XINT@infrac@BCb \romannumeral-`0#2}%
\xint@UDkrof
#3\Z #1\Z
}%
@@ -241,7 +242,7 @@
{%
\xint@UDwfork
#2\dummy \XINT@frac@A
- \W\dummy {\expandafter\expandafter\expandafter\XINT@frac@B #2}%
+ \W\dummy {\expandafter\XINT@frac@B \romannumeral-`0#2}%
\xint@UDkrof
#3.\W\Z #1.\W\Z
}%
@@ -465,7 +466,7 @@
\def\XINT@@frac@C #1#2#3#4#5%
{%
\ifcase\XINT@isOne {#5}
- \or \xint@afterfi {\expandafter\xint@firstoftwo@andstop\xint@gobble@two }%
+ \or \xint@afterfi {\expandafter\xint@firstoftwo@andstop\xint@gobble@ii }%
\fi
\space
\frac {#4}{#5}%
@@ -606,7 +607,7 @@
#2\Z {#3}%
}%
\def\XINT@irr@denomisone #1\Z #2{ #1}%
-\def\XINT@irr@negative #1\Z #2{\XINT@irr@D #1\Z #2\Z \XINT@opp}%
+\def\XINT@irr@negative #1\Z #2{\XINT@irr@D #1\Z #2\Z \xint@minus@andstop}%
\def\XINT@irr@nonneg #1\Z #2{\XINT@irr@D #1\Z #2\Z \space}%
\def\XINT@irr@D #1#2\Z #3#4\Z
{%
@@ -656,7 +657,7 @@
\def\xintnum #1{\expandafter\XINT@intcheck\romannumeral0\xintirr {#1}/\W\Z }%
\def\XINT@intcheck #1/#2#3\Z
{%
- \xint@w #2\xint@gobble@two\W\xintError:NotAnInteger
+ \xint@w #2\xint@gobble@ii\W\xintError:NotAnInteger
\space #1%
}%
\def\xintJrr {\romannumeral0\xintjrr }%
@@ -678,7 +679,7 @@
#2\Z {#3}%
}%
\def\XINT@jrr@denomisone #1\Z #2{ #1}%
-\def\XINT@jrr@negative #1\Z #2{\XINT@jrr@D #1\Z #2\Z \XINT@opp}%
+\def\XINT@jrr@negative #1\Z #2{\XINT@jrr@D #1\Z #2\Z \xint@minus@andstop }%
\def\XINT@jrr@nonneg #1\Z #2{\XINT@jrr@D #1\Z #2\Z \space}%
\def\XINT@jrr@D #1#2\Z #3#4\Z
{%
@@ -725,10 +726,7 @@
\def\xintiTrunc {\romannumeral0\xintitrunc }%
\def\xinttrunc #1%
{%
- \expandafter\expandafter\expandafter
- \XINT@trunc
- \expandafter\expandafter\expandafter
- {#1}%
+ \expandafter\XINT@trunc\expandafter {\the\numexpr #1}%
}%
\def\XINT@trunc #1#2%
{%
@@ -738,10 +736,7 @@
}%
\def\xintitrunc #1%
{%
- \expandafter\expandafter\expandafter
- \XINT@itrunc
- \expandafter\expandafter\expandafter
- {#1}%
+ \expandafter\XINT@itrunc\expandafter {\the\numexpr #1}%
}%
\def\XINT@itrunc #1#2%
{%
@@ -811,7 +806,7 @@
\ifnum #1 > 0
\xint@afterfi {\XINT@trunc@Ha {#2}}%
\else
- \xint@afterfi {\XINT@trunc@Hb {-#1}}%
+ \xint@afterfi {\XINT@trunc@Hb {-#1}}% -0,--1,--2, ....
\fi
}%
\def\XINT@trunc@Ha
@@ -825,16 +820,13 @@
\def\XINT@trunc@Hb #1#2#3%
{%
\expandafter #3\expandafter0\expandafter.%
- \romannumeral0\XINT@dsx@zeroloop {#1}\Z {}#2%
+ \romannumeral0\XINT@dsx@zeroloop {#1}\Z {}#2% #1=-0 possible!
}%
\def\xintRound {\romannumeral0\xintround }%
\def\xintiRound {\romannumeral0\xintiround }%
\def\xintround #1%
{%
- \expandafter\expandafter\expandafter
- \XINT@round
- \expandafter\expandafter\expandafter
- {#1}%
+ \expandafter\XINT@round\expandafter {\the\numexpr #1}%
}%
\def\XINT@round
{%
@@ -842,10 +834,7 @@
}%
\def\xintiround #1%
{%
- \expandafter\expandafter\expandafter
- \XINT@iround
- \expandafter\expandafter\expandafter
- {#1}%
+ \expandafter\XINT@iround\expandafter {\the\numexpr #1}%
}%
\def\XINT@iround
{%
@@ -961,11 +950,11 @@
\def\xintSum {\romannumeral0\xintsum }%
\def\xintsum #1{\xintsumexpr #1\relax }%
\def\xintSumExpr {\romannumeral0\xintsumexpr }%
-\def\xintsumexpr {\expandafter\expandafter\expandafter\XINT@fsumexpr }%
+\def\xintsumexpr {\expandafter\XINT@fsumexpr\romannumeral-`0}%
\def\XINT@fsumexpr {\XINT@fsum@loop@a {0[0]}}%
\def\XINT@fsum@loop@a #1#2%
{%
- \expandafter\expandafter\expandafter\XINT@fsum@loop@b #2\Z {#1}%
+ \expandafter\XINT@fsum@loop@b \romannumeral-`0#2\Z {#1}%
}%
\def\XINT@fsum@loop@b #1%
{%
@@ -1009,8 +998,7 @@
}%
\def\xint@fpow #1#2%
{%
- \expandafter\expandafter\expandafter
- \XINT@fpow@fork #2\Z #1%
+ \expandafter\XINT@fpow@fork\the\numexpr #2\relax\Z #1%
}%
\def\XINT@fpow@fork #1#2\Z
{%
@@ -1047,11 +1035,11 @@
\def\xintPrd {\romannumeral0\xintprd }%
\def\xintprd #1{\xintproductexpr #1\relax }%
\def\xintProductExpr {\romannumeral0\xintproductexpr }%
-\def\xintproductexpr{\expandafter\expandafter\expandafter\XINT@fproductexpr }%
+\def\xintproductexpr {\expandafter\XINT@fproductexpr \romannumeral-`0}%
\def\XINT@fproductexpr {\XINT@fprod@loop@a {1[0]}}%
\def\XINT@fprod@loop@a #1#2%
{%
- \expandafter\expandafter\expandafter\XINT@fprod@loop@b #2\Z {#1}%
+ \expandafter\XINT@fprod@loop@b \romannumeral-`0#2\Z {#1}%
}%
\def\XINT@fprod@loop@b #1%
{%