summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/xint/xintfrac.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/generic/xint/xintfrac.sty')
-rw-r--r--Master/texmf-dist/tex/generic/xint/xintfrac.sty59
1 files changed, 43 insertions, 16 deletions
diff --git a/Master/texmf-dist/tex/generic/xint/xintfrac.sty b/Master/texmf-dist/tex/generic/xint/xintfrac.sty
index d6e79408cc9..a9218952fd0 100644
--- a/Master/texmf-dist/tex/generic/xint/xintfrac.sty
+++ b/Master/texmf-dist/tex/generic/xint/xintfrac.sty
@@ -21,7 +21,7 @@
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%% ---------------------------------------------------------------
-%% The xint bundle 1.4a 2020/02/19
+%% The xint bundle 1.4b 2020/02/25
%% Copyright (C) 2013-2020 by Jean-Francois Burnol
%% xintfrac: Expandable operations on fractions
%% ---------------------------------------------------------------
@@ -70,7 +70,7 @@
\XINTsetupcatcodes% defined in xintkernel.sty
\XINT_providespackage
\ProvidesPackage{xintfrac}%
- [2020/02/19 v1.4a Expandable operations on fractions (JFB)]%
+ [2020/02/25 v1.4b Expandable operations on fractions (JFB)]%
\def\XINT_cntSgnFork #1%
{%
\ifcase #1\expandafter\xint_secondofthree
@@ -458,8 +458,9 @@
\def\XINT_spraw #1[#2#3]{\xint_gob_til_W #2\XINT_spraw_a\W\XINT_spraw_p #1[#2#3]}%
\def\XINT_spraw_a\W\XINT_spraw_p #1[\W]{ #1}%
\def\XINT_spraw_p #1[\W]{\xintpraw {#1}}%
-\def\xintFracToSci #1%
- {\expandafter\XINT_FracToSci\romannumeral`&&@#1/\W[\R]}%
+\edef\xintFracToSci #1%
+ {\unexpanded{\expandafter\XINT_FracToSci\romannumeral`&&@}#1\string e%
+ \unexpanded{\Z/\W[\R]}}%
\def\XINT_FracToSci #1/#2#3[#4%
{%
\xint_gob_til_W #2\XINT_FracToSci_no\W
@@ -471,18 +472,39 @@
\xint_gob_til_R #3\XINT_FracToSci_nono\R
\XINT_FracToSci_noyes #2[#3%
}%
-\def\XINT_FracToSci_nono\R\XINT_FracToSci_noyes #1/\W[\R]{#1}%
-\def\XINT_FracToSci_noyes #1#2[#3]/\W[\R]%
+\edef\XINT_tmpa{##1\string e##2}%
+\def\XINT_tmpb{\def\XINT_FracToSci_nono\R\XINT_FracToSci_noyes}%
+\expandafter
+\XINT_tmpb\XINT_tmpa
+{%
+ #1\xint_gob_til_Z #2\XINT_FracToSci_nonono\Z
+ \XINT_FracToSci_nonoyes #2%
+}%
+\edef\XINT_tmpa{##1\string e}%
+ \def\XINT_tmpb{\def\XINT_FracToSci_nonoyes}%
+\expandafter
+\XINT_tmpb\XINT_tmpa\Z/\W[\R]{\xintFracToSciE#1}%
+\def\XINT_FracToSci_nonono\Z\XINT_FracToSci_nonoyes\Z/\W[\R]{}%
+\edef\XINT_tmpa{##1##2[##3]\string e}%
+ \def\XINT_tmpb{\def\XINT_FracToSci_noyes}%
+\expandafter
+\XINT_tmpb\XINT_tmpa\Z/\W[\R]%
{%
#1\xint_gob_til_zero#1\expandafter\iffalse\xint_gobble_ii0\iftrue
#2\ifnum #3=\xint_c_\else\xintFracToSciE#3\fi\fi
}%
-\def\XINT_FracToSci_yesno\R\XINT_FracToSci_yesyes #1#2/#3/\W[\R]%
+\edef\XINT_tmpa{##1##2/##3\string e}%
+ \def\XINT_tmpb{\def\XINT_FracToSci_yesno\R\XINT_FracToSci_yesyes}%
+\expandafter
+\XINT_tmpb\XINT_tmpa\Z/\W[\R]%
{%
#1\xint_gob_til_zero#1\expandafter\iffalse\xint_gobble_ii0\iftrue
#2\if\XINT_isOne{#3}1\else/#3\fi\fi
}%
-\def\XINT_FracToSci_yesyes #1#2/#3[#4]/\W[\R]%
+\edef\XINT_tmpa{##1##2/##3[##4]\string e}%
+ \def\XINT_tmpb{\def\XINT_FracToSci_yesyes}%
+\expandafter
+\XINT_tmpb\XINT_tmpa\Z/\W[\R]%
{%
#1\xint_gob_til_zero#1\expandafter\iffalse\xint_gobble_ii0\iftrue
#2\ifnum #4=\xint_c_\else\xintFracToSciE#4\fi
@@ -2299,21 +2321,26 @@
\ifnum #3<-\xint_c_v \xint_dothis\XINT_pfloat_no\fi
\ifnum #3<\xint_c_ \xint_dothis\XINT_pfloat_N\fi
\ifnum #3>\numexpr #4-\xint_c_i\relax \xint_dothis\XINT_pfloat_Ps\fi
- \xint_orthat\XINT_pfloat_P #1#2e#3;%
+ \xint_orthat\XINT_pfloat_P #1{#2}{#3}%
+}%
+\def\XINT_pfloat_no
+{%
+ \expandafter\XINT_pfloat_no_e\expandafter{\xintPFloatE}%
}%
-\def\XINT_pfloat_no #1#2;{ #1.#2}%
-\def\XINT_pfloat_N #1e-#2;%
+\def\XINT_pfloat_no_e #1#2#3#4{ #2.#3#1#4}%
+\def\xintPFloatE{e}%
+\def\XINT_pfloat_N #1#2#3%
{%
- \csname XINT_pfloat_N_\romannumeral#2\endcsname #1%
+ \csname XINT_pfloat_N_\romannumeral-#3\endcsname #1#2%
}%
\def\XINT_pfloat_N_i { 0.}%
\def\XINT_pfloat_N_ii { 0.0}%
\def\XINT_pfloat_N_iii{ 0.00}%
\def\XINT_pfloat_N_iv { 0.000}%
\def\XINT_pfloat_N_v { 0.0000}%
-\def\XINT_pfloat_P #1e#2;%
+\def\XINT_pfloat_P #1#2#3%
{%
- \csname XINT_pfloat_P_\romannumeral#2\endcsname #1%
+ \csname XINT_pfloat_P_\romannumeral#3\endcsname #1#2%
}%
\def\XINT_pfloat_P_ #1{ #1.}%
\def\XINT_pfloat_P_i #1#2{ #1#2.}%
@@ -2321,9 +2348,9 @@
\def\XINT_pfloat_P_iii#1#2#3#4{ #1#2#3#4.}%
\def\XINT_pfloat_P_iv #1#2#3#4#5{ #1#2#3#4#5.}%
\def\XINT_pfloat_P_v #1#2#3#4#5#6{ #1#2#3#4#5#6.}%
-\def\XINT_pfloat_Ps #1e#2;%
+\def\XINT_pfloat_Ps #1#2#3%
{%
- \csname XINT_pfloat_Ps\romannumeral#2\endcsname #100000;%
+ \csname XINT_pfloat_Ps\romannumeral#3\endcsname #1#200000;%
}%
\def\XINT_pfloat_Psi #1#2#3;{ #1#2.}%
\def\XINT_pfloat_Psii #1#2#3#4;{ #1#2#3.}%