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.sty31
1 files changed, 19 insertions, 12 deletions
diff --git a/Master/texmf-dist/tex/generic/xint/xintfrac.sty b/Master/texmf-dist/tex/generic/xint/xintfrac.sty
index b8e08f1936f..d6e79408cc9 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.4 2020/01/31
+%% The xint bundle 1.4a 2020/02/19
%% 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/01/31 v1.4 Expandable operations on fractions (JFB)]%
+ [2020/02/19 v1.4a Expandable operations on fractions (JFB)]%
\def\XINT_cntSgnFork #1%
{%
\ifcase #1\expandafter\xint_secondofthree
@@ -977,21 +977,28 @@
{\expandafter#4\romannumeral`&&@\expandafter\xint_firstoftwo
\romannumeral0\XINT_div_prepare {#3}{#2}.#1}%
\def\XINT_trunc_sp_F #1#2.#3{#3#2.#1}%
-\def\XINT_itrunc_G #1#2.#3#4.{\if#10\xint_dothis{ 0}\fi\xint_orthat{#3#1}#2}%
-\def\XINT_trunc_G #1.#2#3.%
+\def\XINT_itrunc_G #1#2.#3#4.%
{%
+ \if#10\xint_dothis{ 0}\fi
+ \xint_orthat{#3#1}#2%
+}%
+\def\XINT_trunc_G #1.#2#3#4.%
+{%
+ \xint_gob_til_minus#3\XINT_trunc_Hc-%
\expandafter\XINT_trunc_H
- \the\numexpr\romannumeral0\xintlength {#1}-#3.#3.{#1}#2%
+ \the\numexpr\romannumeral0\xintlength {#1}-#3#4.#3#4.{#1}#2%
}%
+\def\XINT_trunc_Hc-\expandafter\XINT_trunc_H
+ \the\numexpr\romannumeral0\xintlength #1.-#2.#3#4{#4#3e#2}%
\def\XINT_trunc_H #1.#2.%
{%
- \ifnum #1 > \xint_c_
- \xint_afterfi {\XINT_trunc_Ha {#2}}%
- \else
- \xint_afterfi {\XINT_trunc_Hb {-#1}}% -0,--1,--2, ....
- \fi
+ \ifnum #1 > \xint_c_ \xint_dothis{\XINT_trunc_Ha {#2}}\fi
+ \xint_orthat {\XINT_trunc_Hb {-#1}}% -0,--1,--2, ....
+}%
+\def\XINT_trunc_Ha%
+{%
+ \expandafter\XINT_trunc_Haa\romannumeral0\xintdecsplit
}%
-\def\XINT_trunc_Ha{\expandafter\XINT_trunc_Haa\romannumeral0\xintdecsplit}%
\def\XINT_trunc_Haa #1#2#3{#3#1.#2}%
\def\XINT_trunc_Hb #1#2#3%
{%
@@ -1579,7 +1586,7 @@
\def\XINT_divmod_divbyzero #1#2[#3]#4.%
{%
\XINT_signalcondition{DivisionByZero}{Division by #2[#3] of #1#4}{}%
- {{0}{0/1[0]}}% ^^c3^^a0 revoir...
+ {{0}{0/1[0]}}% à revoir...
}%
\def\XINT_divmod_aiszero #1.{{0}{0/1[0]}}%
\def\XINT_divmod_bneg #1% f // -g = (-f) // g, f % -g = - ((-f) % g)