summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/xint/xintfrac.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2014-01-09 23:59:41 +0000
committerKarl Berry <karl@freefriends.org>2014-01-09 23:59:41 +0000
commitaf91cefd8b0ad8fe98e9ef318d337636b3f54a19 (patch)
tree6b68c531657de5b211fa117d8b08836300bc5583 /Master/texmf-dist/tex/generic/xint/xintfrac.sty
parent3e2f1017cfd105d03e88036cae3a040a59d1c3b5 (diff)
xint (9jan14)
git-svn-id: svn://tug.org/texlive/trunk@32618 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.sty775
1 files changed, 513 insertions, 262 deletions
diff --git a/Master/texmf-dist/tex/generic/xint/xintfrac.sty b/Master/texmf-dist/tex/generic/xint/xintfrac.sty
index ebe00b574bc..25d24fd4bcd 100644
--- a/Master/texmf-dist/tex/generic/xint/xintfrac.sty
+++ b/Master/texmf-dist/tex/generic/xint/xintfrac.sty
@@ -21,9 +21,9 @@
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%%----------------------------------------------------------------
-%% The xint bundle (version 1.09i of December 18, 2013)
+%% The xint bundle (version 1.09j of January 9, 2014)
%% xintfrac: Expandable operations on fractions
-%% Copyright (C) 2013 by Jean-Francois Burnol
+%% Copyright (C) 2013-2014 by Jean-Francois Burnol
%%----------------------------------------------------------------
\begingroup\catcode61\catcode48\catcode32=10\relax%
\catcode13=5 % ^^M
@@ -53,8 +53,7 @@
\else
\ifx\x\relax % plain-TeX, first loading of xintfrac.sty
\ifx\w\relax % but xint.sty not yet loaded.
- \y{xintfrac}{Package xint is required}%
- \y{xintfrac}{Will try \string\input\space xint.sty}%
+ \y{xintfrac}{now issuing \string\input\space xint.sty}%
\def\z{\endgroup\input xint.sty\relax}%
\fi
\else
@@ -62,8 +61,7 @@
\ifx\x\empty % LaTeX, first loading,
% variable is initialized, but \ProvidesPackage not yet seen
\ifx\w\relax % xint.sty not yet loaded.
- \y{xintfrac}{Package xint is required}%
- \y{xintfrac}{Will try \string\RequirePackage{xint}}%
+ \y{xintfrac}{now issuing \string\RequirePackage{xint}}%
\def\z{\endgroup\RequirePackage{xint}}%
\fi
\else
@@ -103,11 +101,10 @@
\XINTsetupcatcodes%
\XINT_providespackage
\ProvidesPackage{xintfrac}%
- [2013/12/18 v1.09i Expandable operations on fractions (jfB)]%
+ [2014/01/09 v1.09j Expandable operations on fractions (jfB)]%
\chardef\xint_c_vi 6
\chardef\xint_c_vii 7
\chardef\xint_c_xviii 18
-\mathchardef\xint_c_x^iv 10000
\def\xintLen {\romannumeral0\xintlen }%
\def\xintlen #1%
{%
@@ -149,7 +146,7 @@
}%
\def\XINT_outfrac #1#2#3%
{%
- \ifcase\XINT__Sgn #3\Z
+ \ifcase\XINT_cntSgn #3\Z
\expandafter \XINT_outfrac_divisionbyzero
\or
\expandafter \XINT_outfrac_P
@@ -426,7 +423,7 @@
}%
\def\XINT_rawz #1%
{%
- \ifcase\XINT__Sgn #1\Z
+ \ifcase\XINT_cntSgn #1\Z
\expandafter\XINT_rawz_Ba
\or
\expandafter\XINT_rawz_A
@@ -452,7 +449,7 @@
}%
\def\XINT_numer #1%
{%
- \ifcase\XINT__Sgn #1\Z
+ \ifcase\XINT_cntSgn #1\Z
\expandafter\XINT_numer_B
\or
\expandafter\XINT_numer_A
@@ -470,7 +467,7 @@
}%
\def\XINT_denom #1%
{%
- \ifcase\XINT__Sgn #1\Z
+ \ifcase\XINT_cntSgn #1\Z
\expandafter\XINT_denom_B
\or
\expandafter\XINT_denom_A
@@ -495,7 +492,7 @@
\def\XINT_fracfrac_C 0\XINT_fracfrac_D #1#2#3%
{%
\if1\XINT_isOne {#3}%
- \xint_afterfi {\expandafter\xint_firstoftwo_afterstop\xint_gobble_ii }%
+ \xint_afterfi {\expandafter\xint_firstoftwo_thenstop\xint_gobble_ii }%
\fi
\space
\frac {#2}{#3}%
@@ -529,7 +526,7 @@
}%
\def\XINT_sgnfrac_N
{%
- \expandafter\xint_minus_afterstop\romannumeral0\XINT_sgnfrac_P
+ \expandafter\xint_minus_thenstop\romannumeral0\XINT_sgnfrac_P
}%
\def\xintFwOver {\romannumeral0\xintfwover }%
\def\xintfwover #1%
@@ -577,7 +574,7 @@
}%
\def\XINT_sgnfwover_N
{%
- \expandafter\xint_minus_afterstop\romannumeral0\XINT_sgnfwover_P
+ \expandafter\xint_minus_thenstop\romannumeral0\XINT_sgnfwover_P
}%
\def\xintREZ {\romannumeral0\xintrez }%
\def\xintrez
@@ -597,7 +594,7 @@
\krof
}%
\def\XINT_rez_zero #1\Z #2#3{ 0/1[0]}%
-\def\XINT_rez_neg {\expandafter\xint_minus_afterstop\romannumeral0\XINT_rez_B }%
+\def\XINT_rez_neg {\expandafter\xint_minus_thenstop\romannumeral0\XINT_rez_B }%
\def\XINT_rez_B #1\Z
{%
\expandafter\XINT_rez_C\romannumeral0\XINT_factortens {#1}%
@@ -655,8 +652,8 @@
\expandafter\xint_exchangetwo_keepbraces\expandafter
{\the\numexpr #2+#5}{#1}{#3}{#4}\XINT_float_Q
}%
-\def\XINTinFloatfE {\romannumeral0\XINT_inFloatfE }%
-\def\XINT_inFloatfE [#1]#2%
+\def\XINTinFloatfE {\romannumeral0\XINTinfloatfe }%
+\def\XINTinfloatfe [#1]#2%
{%
\expandafter\XINT_infloatfe_a\expandafter
{\the\numexpr #1\expandafter}\romannumeral0\XINT_infrac {#2}%
@@ -695,7 +692,7 @@
#2\Z {#3}%
}%
\def\XINT_irr_denomisone #1\Z #2{ #1/1}% changed in 1.08
-\def\XINT_irr_negative #1\Z #2{\XINT_irr_D #1\Z #2\Z \xint_minus_afterstop}%
+\def\XINT_irr_negative #1\Z #2{\XINT_irr_D #1\Z #2\Z \xint_minus_thenstop}%
\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
{%
@@ -746,9 +743,9 @@
\def\XINT_ifint #1/#2\Z
{%
\if\XINT_isOne {#2}1%
- \expandafter\xint_firstoftwo_afterstop
+ \expandafter\xint_firstoftwo_thenstop
\else
- \expandafter\xint_secondoftwo_afterstop
+ \expandafter\xint_secondoftwo_thenstop
\fi
}%
\def\xintJrr {\romannumeral0\xintjrr }%
@@ -769,7 +766,7 @@
#2\Z {#3}%
}%
\def\XINT_jrr_denomisone #1\Z #2{ #1/1}% changed in 1.08
-\def\XINT_jrr_negative #1\Z #2{\XINT_jrr_D #1\Z #2\Z \xint_minus_afterstop }%
+\def\XINT_jrr_negative #1\Z #2{\XINT_jrr_D #1\Z #2\Z \xint_minus_thenstop }%
\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
{%
@@ -829,14 +826,14 @@
{%
\expandafter\XINT_rez_AB\romannumeral0\xintiirem{#1}{#2}\Z {0}{#2}%
}%
-\def\XINTinFloatFrac {\romannumeral0\XINT_inFloatFrac }%
-\def\XINT_inFloatFrac [#1]#2%
+\def\XINTinFloatFrac {\romannumeral0\XINTinfloatfrac }%
+\def\XINTinfloatfrac [#1]#2%
{%
\expandafter\XINT_infloatfrac_a\expandafter
{\romannumeral0\xinttfrac{#2}}{#1}%
}%
-\def\XINT_infloatfrac_a #1#2{\XINT_inFloat [#2]{#1}}%
-\def\xintTrunc {\romannumeral0\xinttrunc }%
+\def\XINT_infloatfrac_a #1#2{\XINTinFloat [#2]{#1}}%
+\def\xintTrunc {\romannumeral0\xinttrunc }%
\def\xintiTrunc {\romannumeral0\xintitrunc }%
\def\xinttrunc #1%
{%
@@ -867,10 +864,10 @@
{%
\xint_gob_til_zero #2\XINT_trunc_iszero0\XINT_trunc_B {#1}{#2#3}%
}%
-\def\XINT_trunc_iszero #1#2#3#4#5{ 0\Z 0}%
+\def\XINT_trunc_iszero0\XINT_trunc_B #1#2#3{ 0\Z 0}%
\def\XINT_trunc_B #1%
{%
- \ifcase\XINT__Sgn #1\Z
+ \ifcase\XINT_cntSgn #1\Z
\expandafter\XINT_trunc_D
\or
\expandafter\XINT_trunc_D
@@ -881,43 +878,40 @@
}%
\def\XINT_trunc_C #1#2#3%
{%
- \expandafter \XINT_trunc_E
- \romannumeral0\xint_dsh {#3}{#1}\Z #2\Z
+ \expandafter\XINT_trunc_CE\expandafter
+ {\romannumeral0\XINT_dsx_zeroloop {-#1}{}\Z {#3}}{#2}%
}%
+\def\XINT_trunc_CE #1#2{\XINT_trunc_E #2.{#1}}%
\def\XINT_trunc_D #1#2%
{%
- \expandafter \XINT_trunc_DE \expandafter
- {\romannumeral0\xint_dsh {#2}{-#1}}%
+ \expandafter\XINT_trunc_E
+ \romannumeral0\XINT_dsx_zeroloop {#1}{}\Z {#2}.%
}%
-\def\XINT_trunc_DE #1#2{\XINT_trunc_E #2\Z #1\Z }%
-\def\XINT_trunc_E #1#2\Z #3#4\Z
+\def\XINT_trunc_E #1%
{%
- \xint_UDsignsfork
- #1#3\XINT_trunc_minusminus
- #1-{\XINT_trunc_minusplus #3}%
- #3-{\XINT_trunc_plusminus #1}%
- --{\XINT_trunc_plusplus #3#1}%
+ \xint_UDsignfork
+ #1\XINT_trunc_Fneg
+ -{\XINT_trunc_Fpos #1}%
\krof
- {#4}{#2}%
}%
-\def\XINT_trunc_minusminus #1#2{\xintiiquo {#1}{#2}\Z \space}%
-\def\XINT_trunc_minusplus #1#2#3{\xintiiquo {#1#2}{#3}\Z \xint_minus_afterstop}%
-\def\XINT_trunc_plusminus #1#2#3{\xintiiquo {#2}{#1#3}\Z \xint_minus_afterstop}%
-\def\XINT_trunc_plusplus #1#2#3#4{\xintiiquo {#1#3}{#2#4}\Z \space}%
+\def\XINT_trunc_Fneg #1.#2{\expandafter\xint_firstoftwo_thenstop
+ \romannumeral0\XINT_div_prepare {#2}{#1}\Z \xint_minus_thenstop}%
+\def\XINT_trunc_Fpos #1.#2{\expandafter\xint_firstoftwo_thenstop
+ \romannumeral0\XINT_div_prepare {#2}{#1}\Z \space }%
\def\XINT_itrunc_G #1#2\Z #3#4%
{%
- \xint_gob_til_zero #1\XINT_trunc_zero 0\xint_firstoftwo {#3#1#2}0%
+ \xint_gob_til_zero #1\XINT_trunc_zero 0#3#1#2%
}%
+\def\XINT_trunc_zero 0#1#20{ 0}%
\def\XINT_trunc_G #1\Z #2#3%
{%
\xint_gob_til_zero #2\XINT_trunc_zero 0%
\expandafter\XINT_trunc_H\expandafter
{\the\numexpr\romannumeral0\xintlength {#1}-#3}{#3}{#1}#2%
}%
-\def\XINT_trunc_zero 0#10{ 0}%
\def\XINT_trunc_H #1#2%
{%
- \ifnum #1 > 0
+ \ifnum #1 > \xint_c_
\xint_afterfi {\XINT_trunc_Ha {#2}}%
\else
\xint_afterfi {\XINT_trunc_Hb {-#1}}% -0,--1,--2, ....
@@ -934,7 +928,7 @@
\def\XINT_trunc_Hb #1#2#3%
{%
\expandafter #3\expandafter0\expandafter.%
- \romannumeral0\XINT_dsx_zeroloop {#1}{}\Z {}#2% #1=-0 possible!
+ \romannumeral0\XINT_dsx_zeroloop {#1}{}\Z {}#2% #1=-0 autoris^^e9 !
}%
\def\xintRound {\romannumeral0\xintround }%
\def\xintiRound {\romannumeral0\xintiround }%
@@ -1000,15 +994,246 @@
{%
\XINT_addm_A 0{}1000\W\X\Y\Z #1000\W\X\Y\Z \Z
}%
-\def\xintRound:csv #1{\expandafter\XINT_round:_a\romannumeral-`0#1,,^}%
-\def\XINT_round:_a {\XINT_round:_b {}}%
-\def\XINT_round:_b #1#2,%
- {\expandafter\XINT_round:_c\romannumeral-`0#2,{#1}}%
-\def\XINT_round:_c #1{\if #1,\expandafter\XINT_:_f
- \else\expandafter\XINT_round:_d\fi #1}%
-\def\XINT_round:_d #1,%
- {\expandafter\XINT_round:_e\romannumeral0\xintiround 0{#1},}%
-\def\XINT_round:_e #1,#2{\XINT_round:_b {#2,#1}}%
+\def\xintXTrunc #1#2%
+{%
+ \expandafter\XINT_xtrunc_a\expandafter
+ {\the\numexpr #1\expandafter}\romannumeral0\xintraw {#2}%
+}%
+\def\XINT_xtrunc_a #1%
+{%
+ \expandafter\XINT_xtrunc_b\expandafter
+ {\the\numexpr\ifnum#1<\xint_c_i \xint_c_i-\fi #1}%
+}%
+\def\XINT_xtrunc_b #1%
+{%
+ \expandafter\XINT_xtrunc_c\expandafter
+ {\the\numexpr (#1+\xint_c_ii^v)/\xint_c_ii^vi-\xint_c_i}{#1}%
+}%
+\def\XINT_xtrunc_c #1#2%
+{%
+ \expandafter\XINT_xtrunc_d\expandafter
+ {\the\numexpr #2-\xint_c_ii^vi*#1}{#1}{#2}%
+}%
+\def\XINT_xtrunc_d #1#2#3#4/#5[#6]%
+{%
+ \XINT_xtrunc_e #4.{#6}{#5}{#3}{#2}{#1}%
+}%
+\def\XINT_xtrunc_e #1%
+{%
+ \xint_UDzerominusfork
+ #1-\XINT_xtrunc_zero
+ 0#1\XINT_xtrunc_N
+ 0-{\XINT_xtrunc_P #1}%
+ \krof
+}%
+\def\XINT_xtrunc_zero .#1#2#3#4#5%
+{%
+ 0.\romannumeral0\expandafter\XINT_dsx_zeroloop\expandafter
+ {\the\numexpr #5}{}\Z {}%
+ \xintiloop [#4+-1]
+ \ifnum \xintiloopindex>\xint_c_
+ 0000000000000000000000000000000000000000000000000000000000000000%
+ \repeat
+}%
+\def\XINT_xtrunc_N {-\XINT_xtrunc_P }%
+\def\XINT_xtrunc_P #1.#2%
+{%
+ \ifnum #2<\xint_c_
+ \expandafter\XINT_xtrunc_negN_Q
+ \else
+ \expandafter\XINT_xtrunc_Q
+ \fi {#2}{#1}.%
+}%
+\def\XINT_xtrunc_negN_Q #1#2.#3#4#5#6%
+{%
+ \expandafter\XINT_xtrunc_negN_R
+ \romannumeral0\XINT_div_prepare {#3}{#2}{#3}{#1}{#4}%
+}%
+\def\XINT_xtrunc_negN_R #1#2#3#4#5%
+{%
+ \expandafter\XINT_xtrunc_negN_S\expandafter
+ {\the\numexpr -#4}{#5}{#2}{#3}{#1}%
+}%
+\def\XINT_xtrunc_negN_S #1#2%
+{%
+ \expandafter\XINT_xtrunc_negN_T\expandafter
+ {\the\numexpr #2-#1}{#1}{#2}%
+}%
+\def\XINT_xtrunc_negN_T #1%
+{%
+ \ifnum \xint_c_<#1
+ \expandafter\XINT_xtrunc_negNA
+ \else
+ \expandafter\XINT_xtrunc_negNW
+ \fi {#1}%
+}%
+\def\XINT_xtrunc_unlock #10.{ }%
+\def\XINT_xtrunc_negNA #1#2#3#4#5#6%
+{%
+ \expandafter\XINT_xtrunc_negNB\expandafter
+ {\romannumeral0\expandafter\expandafter\expandafter
+ \XINT_xtrunc_unlock\expandafter\string
+ \csname\XINT_xtrunc_b {#1}#4/#5[0]\expandafter\endcsname
+ \expandafter}\expandafter
+ {\the\numexpr\xintLength{#6}-#2}{#6}%
+}%
+\def\XINT_xtrunc_negNB #1#2#3{\XINT_xtrunc_negNC {#2}{#3}#1}%
+\def\XINT_xtrunc_negNC #1%
+{%
+ \ifnum \xint_c_ < #1
+ \expandafter\XINT_xtrunc_negNDa
+ \else
+ \expandafter\XINT_xtrunc_negNE
+ \fi {#1}%
+}%
+\def\XINT_xtrunc_negNDa #1#2%
+{%
+ \expandafter\XINT_xtrunc_negNDb%
+ \romannumeral0\XINT_split_fromleft_loop {#1}{}#2\W\W\W\W\W\W\W\W\Z
+}%
+\def\XINT_xtrunc_negNDb #1#2{#1.#2}%
+\def\XINT_xtrunc_negNE #1#2%
+{%
+ 0.\romannumeral0\XINT_dsx_zeroloop {-#1}{}\Z {}#2%
+}%
+\def\XINT_xtrunc_negNW #1#2#3#4#5#6%
+{%
+ \expandafter\XINT_xtrunc_negNX\expandafter
+ {\romannumeral0\xintnum{\xintDecSplitL {-#1}{#6}}}{#3}%
+}%
+\def\XINT_xtrunc_negNX #1#2%
+{%
+ \expandafter\XINT_xtrunc_negNC\expandafter
+ {\the\numexpr\xintLength {#1}-#2}{#1}%
+}%
+\def\XINT_xtrunc_Q #1%
+{%
+ \expandafter\XINT_xtrunc_prepare_I
+ \romannumeral0\XINT_dsx_zeroloop {#1}{}\Z
+}%
+\def\XINT_xtrunc_prepare_I #1.#2#3%
+{%
+ \expandafter\XINT_xtrunc_prepareB_aa\expandafter
+ {\romannumeral0\xintlength {#2}}{#2}{#1}%
+}%
+\def\XINT_xtrunc_prepareB_aa #1%
+{%
+ \ifnum #1=\xint_c_i
+ \expandafter\XINT_xtrunc_prepareB_onedigit
+ \else
+ \expandafter\XINT_xtrunc_prepareB_PaBa
+ \fi
+ {#1}%
+}%
+\def\XINT_xtrunc_prepareB_onedigit #1#2%
+{%
+ \ifcase#2
+ \or\expandafter\XINT_xtrunc_BisOne
+ \or\expandafter\XINT_xtrunc_BisTwo
+ \else\expandafter\XINT_xtrunc_prepareB_PaBe
+ \fi {000}{0}{4}{#2}%
+}%
+\def\XINT_xtrunc_BisOne #1#2#3#4#5#6#7%
+{%
+ #5.\romannumeral0\expandafter\XINT_dsx_zeroloop\expandafter
+ {\the\numexpr #7}{}\Z {}%
+ \xintiloop [#6+-1]
+ \ifnum \xintiloopindex>\xint_c_
+ 0000000000000000000000000000000000000000000000000000000000000000%
+ \repeat
+}%
+\def\XINT_xtrunc_BisTwo #1#2#3#4#5#6#7%
+{%
+ \xintHalf {#5}.\ifodd\xintiiLDg{#5} 5\else 0\fi
+ \romannumeral0\expandafter\XINT_dsx_zeroloop\expandafter
+ {\the\numexpr #7-\xint_c_i}{}\Z {}%
+ \xintiloop [#6+-1]
+ \ifnum \xintiloopindex>\xint_c_
+ 0000000000000000000000000000000000000000000000000000000000000000%
+ \repeat
+}%
+\def\XINT_xtrunc_prepareB_PaBa #1#2%
+{%
+ \expandafter\XINT_xtrunc_Pa\expandafter
+ {\romannumeral0\XINT_xtrunc_prepareB_a {#1}{#2}}%
+}%
+\def\XINT_xtrunc_prepareB_a #1%
+{%
+ \expandafter\XINT_xtrunc_prepareB_c\expandafter
+ {\the\numexpr \xint_c_iv*((#1+\xint_c_i)/\xint_c_iv)}{#1}%
+}%
+\def\XINT_xtrunc_prepareB_c #1#2%
+{%
+ \csname XINT_xtrunc_prepareB_d\romannumeral\numexpr#1-#2\endcsname
+ {#1}%
+}%
+\def\XINT_xtrunc_prepareB_d {\XINT_xtrunc_prepareB_e {}{0000}}%
+\def\XINT_xtrunc_prepareB_di {\XINT_xtrunc_prepareB_e {0}{000}}%
+\def\XINT_xtrunc_prepareB_dii {\XINT_xtrunc_prepareB_e {00}{00}}%
+\def\XINT_xtrunc_prepareB_diii {\XINT_xtrunc_prepareB_e {000}{0}}%
+\def\XINT_xtrunc_prepareB_PaBe #1#2#3#4%
+{%
+ \expandafter\XINT_xtrunc_Pa\expandafter
+ {\romannumeral0\XINT_xtrunc_prepareB_e {#1}{#2}{#3}{#4}}%
+}%
+\def\XINT_xtrunc_prepareB_e #1#2#3#4%
+{%
+ \ifnum#3=\xint_c_iv\expandafter\XINT_xtrunc_prepareLittleB_f
+ \else\expandafter\XINT_xtrunc_prepareB_f
+ \fi
+ #4#1{#3}{#2}{#1}%
+}%
+\def\XINT_xtrunc_prepareB_f #1#2#3#4#5#{%
+ \expandafter\space
+ \expandafter\XINT_div_prepareB_g
+ \the\numexpr #1#2#3#4+\xint_c_i\expandafter
+ .\the\numexpr (#1#2#3#4+\xint_c_i)/\xint_c_ii\expandafter
+ .\romannumeral0\xintreverseorder {#1#2#3#4#5}.{#1#2#3#4}%
+}%
+\def\XINT_xtrunc_prepareLittleB_f #1#{%
+ \expandafter\space\expandafter
+ \XINT_div_prepareB_g \the\numexpr #1/\xint_c_ii.{}.{}.{#1}%
+}%
+\def\XINT_xtrunc_Pa #1#2%
+{%
+ \expandafter\XINT_xtrunc_Pb\romannumeral0#1{#2}{#1}%
+}%
+\def\XINT_xtrunc_Pb #1#2#3#4{#1.\XINT_xtrunc_A {#4}{#2}{#3}}%
+\def\XINT_xtrunc_A #1%
+{%
+ \unless\ifnum #1>\xint_c_ \XINT_xtrunc_transition\fi
+ \expandafter\XINT_xtrunc_B\expandafter{\the\numexpr #1-\xint_c_i}%
+}%
+\def\XINT_xtrunc_B #1#2#3%
+{%
+ \expandafter\XINT_xtrunc_D\romannumeral0#3%
+ {#20000000000000000000000000000000000000000000000000000000000000000}%
+ {#1}{#3}%
+}%
+\def\XINT_xtrunc_D #1#2#3%
+{%
+ \romannumeral0\expandafter\XINT_dsx_zeroloop\expandafter
+ {\the\numexpr \xint_c_ii^vi-\xintLength{#1}}{}\Z {}#1%
+ \XINT_xtrunc_A {#3}{#2}%
+}%
+\def\XINT_xtrunc_transition\fi
+ \expandafter\XINT_xtrunc_B\expandafter #1#2#3#4%
+{%
+ \fi
+ \ifnum #4=\xint_c_ \XINT_xtrunc_abort\fi
+ \expandafter\XINT_xtrunc_x\expandafter
+ {\romannumeral0\XINT_dsx_zeroloop {#4}{}\Z {#2}}{#3}{#4}%
+}%
+\def\XINT_xtrunc_x #1#2%
+{%
+ \expandafter\XINT_xtrunc_y\romannumeral0#2{#1}%
+}%
+\def\XINT_xtrunc_y #1#2#3%
+{%
+ \romannumeral0\expandafter\XINT_dsx_zeroloop\expandafter
+ {\the\numexpr #3-\xintLength{#1}}{}\Z {}#1%
+}%
+\def\XINT_xtrunc_abort\fi\expandafter\XINT_xtrunc_x\expandafter #1#2#3{\fi}%
\mathchardef\XINTdigits 16
\def\xintDigits #1#2%
{\afterassignment \xint_gobble_i \mathchardef\XINTdigits=}%
@@ -1045,7 +1270,7 @@
\krof
}%
\def\XINT_float_zero #1\Z #2#3#4#5{ 0.e0}%
-\def\XINT_float_J {\expandafter\xint_minus_afterstop\romannumeral0\XINT_float_K }%
+\def\XINT_float_J {\expandafter\xint_minus_thenstop\romannumeral0\XINT_float_K }%
\def\XINT_float_K #1\Z #2% #1=A, #2=P, #3=n, #4=B
{%
\expandafter\XINT_float_L\expandafter
@@ -1186,17 +1411,8 @@
{\the\numexpr #3+#4+\xint_c_i-#2}{#1}%
}%
\def\XINT_float_Y #1#2{ #2e#1}%
-\def\xintFloat:csv #1{\expandafter\XINT_float:_a\romannumeral-`0#1,,^}%
-\def\XINT_float:_a {\XINT_float:_b {}}%
-\def\XINT_float:_b #1#2,%
- {\expandafter\XINT_float:_c\romannumeral-`0#2,{#1}}%
-\def\XINT_float:_c #1{\if #1,\expandafter\XINT_:_f
- \else\expandafter\XINT_float:_d\fi #1}%
-\def\XINT_float:_d #1,%
- {\expandafter\XINT_float:_e\romannumeral0\xintfloat {#1},}%
-\def\XINT_float:_e #1,#2{\XINT_float:_b {#2,#1}}%
-\def\XINTinFloat {\romannumeral0\XINT_inFloat }%
-\def\XINT_inFloat [#1]#2%
+\def\XINTinFloat {\romannumeral0\XINTinfloat }%
+\def\XINTinfloat [#1]#2%
{%
\expandafter\XINT_infloat_a\expandafter
{\the\numexpr #1\expandafter}%
@@ -1214,7 +1430,7 @@
0-{\XINT_float_K #1}%
\krof
}%
-\def\XINT_infloat_zero #1\Z #2#3#4#5{ 0/1[0]}%
+\def\XINT_infloat_zero #1\Z #2#3#4#5{ 0[0]}%
\def\XINT_infloat_J {\expandafter-\romannumeral0\XINT_float_K }%
\def\XINT_infloat_Q #1%
{%
@@ -1364,13 +1580,6 @@
\expandafter\XINT_fsum_loop_a\expandafter{\romannumeral0\xintadd {#2}{#1}}%
}%
\def\XINT_fsum_finished #1\Z #2{ #2}%
-\def\xintSum:csv #1{\expandafter\XINT_sum:_a\romannumeral-`0#1,,^}%
-\def\XINT_sum:_a {\XINT_sum:_b {0/1[0]}}%
-\def\XINT_sum:_b #1#2,{\expandafter\XINT_sum:_c\romannumeral-`0#2,{#1}}%
-\def\XINT_sum:_c #1{\if #1,\expandafter\XINT_:_e
- \else\expandafter\XINT_sum:_d\fi #1}%
-\def\XINT_sum:_d #1,#2{\expandafter\XINT_sum:_b\expandafter
- {\romannumeral0\xintadd {#2}{#1}}}%
\def\xintMul {\romannumeral0\xintmul }%
\def\xintmul #1%
{%
@@ -1458,13 +1667,6 @@
\expandafter\XINT_fprod_loop_a\expandafter{\romannumeral0\xintmul {#1}{#2}}%
}%
\def\XINT_fprod_finished #1\Z #2{ #2}%
-\def\xintPrd:csv #1{\expandafter\XINT_prd:_a\romannumeral-`0#1,,^}%
-\def\XINT_prd:_a {\XINT_prd:_b {1/1[0]}}%
-\def\XINT_prd:_b #1#2,{\expandafter\XINT_prd:_c\romannumeral-`0#2,{#1}}%
-\def\XINT_prd:_c #1{\if #1,\expandafter\XINT_:_e
- \else\expandafter\XINT_prd:_d\fi #1}%
-\def\XINT_prd:_d #1,#2{\expandafter\XINT_prd:_b\expandafter
- {\romannumeral0\xintmul {#2}{#1}}}%
\def\xintDiv {\romannumeral0\xintdiv }%
\def\xintdiv #1%
{%
@@ -1521,7 +1723,7 @@
}%
\def\XINT_fgeq_D #1#2#3%
{%
- \expandafter\XINT__SgnFork\romannumeral-`0\expandafter\XINT__Sgn
+ \expandafter\XINT_cntSgnFork\romannumeral-`0\expandafter\XINT_cntSgn
\the\numexpr #2+\xintLength{#3}-\xintLength{#1}\relax\Z
{ 0}{\XINT_fgeq_E #2\Z {#3}{#1}}{ 1}%
}%
@@ -1563,7 +1765,7 @@
#1#5{#2/#3[#4]}{#6/#7[#8]}%
}%
\def\XINT_fmax_minusminus --%
- {\expandafter\xint_minus_afterstop\romannumeral0\XINT_fmin_nonneg_b }%
+ {\expandafter\xint_minus_thenstop\romannumeral0\XINT_fmin_nonneg_b }%
\def\XINT_fmax_firstneg #1-#2#3{ #1#2}%
\def\XINT_fmax_secondneg -#1#2#3{ #1#3}%
\def\XINT_fmax_nonneg_a #1#2#3#4%
@@ -1587,33 +1789,6 @@
\def\XINT_maxof_d #1\Z
{\expandafter\XINT_maxof_b\romannumeral0\xintmax {#1}}%
\def\XINT_maxof_e #1\Z #2\Z { #2}%
-\def\xintMaxof:csv #1{\expandafter\XINT_maxof:_b\romannumeral-`0#1,,}%
-\def\XINT_maxof:_b #1,#2,{\expandafter\XINT_maxof:_c\romannumeral-`0#2,{#1},}%
-\def\XINT_maxof:_c #1{\if #1,\expandafter\XINT_of:_e
- \else\expandafter\XINT_maxof:_d\fi #1}%
-\def\XINT_maxof:_d #1,{\expandafter\XINT_maxof:_b\romannumeral0\xintmax {#1}}%
-\def\XINTinFloatMaxof {\romannumeral0\XINTinfloatmaxof }%
-\def\XINTinfloatmaxof #1{\expandafter\XINT_flmaxof_a\romannumeral-`0#1\relax }%
-\def\XINT_flmaxof_a #1{\expandafter\XINT_flmaxof_b
- \romannumeral0\XINT_inFloat [\XINTdigits]{#1}\Z }%
-\def\XINT_flmaxof_b #1\Z #2%
- {\expandafter\XINT_flmaxof_c\romannumeral-`0#2\Z {#1}\Z}%
-\def\XINT_flmaxof_c #1%
- {\xint_gob_til_relax #1\XINT_flmaxof_e\relax\XINT_flmaxof_d #1}%
-\def\XINT_flmaxof_d #1\Z
- {\expandafter\XINT_flmaxof_b\romannumeral0\xintmax
- {\XINTinFloat [\XINTdigits]{#1}}}%
-\def\XINT_flmaxof_e #1\Z #2\Z { #2}%
-\def\XINTinFloatMaxof:csv #1{\expandafter\XINT_flmaxof:_a\romannumeral-`0#1,,}%
-\def\XINT_flmaxof:_a #1,{\expandafter\XINT_flmaxof:_b
- \romannumeral0\XINT_inFloat [\XINTdigits]{#1},}%
-\def\XINT_flmaxof:_b #1,#2,%
- {\expandafter\XINT_flmaxof:_c\romannumeral-`0#2,{#1},}%
-\def\XINT_flmaxof:_c #1{\if #1,\expandafter\XINT_of:_e
- \else\expandafter\XINT_flmaxof:_d\fi #1}%
-\def\XINT_flmaxof:_d #1,%
- {\expandafter\XINT_flmaxof:_b\romannumeral0\xintmax
- {\XINTinFloat [\XINTdigits]{#1}}}%
\def\xintMin {\romannumeral0\xintmin }%
\def\xintmin #1%
{%
@@ -1634,7 +1809,7 @@
#1#5{#2/#3[#4]}{#6/#7[#8]}%
}%
\def\XINT_fmin_minusminus --%
- {\expandafter\xint_minus_afterstop\romannumeral0\XINT_fmax_nonneg_b }%
+ {\expandafter\xint_minus_thenstop\romannumeral0\XINT_fmax_nonneg_b }%
\def\XINT_fmin_firstneg #1-#2#3{ -#3}%
\def\XINT_fmin_secondneg -#1#2#3{ -#2}%
\def\XINT_fmin_nonneg_a #1#2#3#4%
@@ -1658,33 +1833,6 @@
\def\XINT_minof_d #1\Z
{\expandafter\XINT_minof_b\romannumeral0\xintmin {#1}}%
\def\XINT_minof_e #1\Z #2\Z { #2}%
-\def\xintMinof:csv #1{\expandafter\XINT_minof:_b\romannumeral-`0#1,,}%
-\def\XINT_minof:_b #1,#2,{\expandafter\XINT_minof:_c\romannumeral-`0#2,{#1},}%
-\def\XINT_minof:_c #1{\if #1,\expandafter\XINT_of:_e
- \else\expandafter\XINT_minof:_d\fi #1}%
-\def\XINT_minof:_d #1,{\expandafter\XINT_minof:_b\romannumeral0\xintmin {#1}}%
-\def\XINTinFloatMinof {\romannumeral0\XINTinfloatminof }%
-\def\XINTinfloatminof #1{\expandafter\XINT_flminof_a\romannumeral-`0#1\relax }%
-\def\XINT_flminof_a #1{\expandafter\XINT_flminof_b
- \romannumeral0\XINT_inFloat [\XINTdigits]{#1}\Z }%
-\def\XINT_flminof_b #1\Z #2%
- {\expandafter\XINT_flminof_c\romannumeral-`0#2\Z {#1}\Z}%
-\def\XINT_flminof_c #1%
- {\xint_gob_til_relax #1\XINT_flminof_e\relax\XINT_flminof_d #1}%
-\def\XINT_flminof_d #1\Z
- {\expandafter\XINT_flminof_b\romannumeral0\xintmin
- {\XINTinFloat [\XINTdigits]{#1}}}%
-\def\XINT_flminof_e #1\Z #2\Z { #2}%
-\def\XINTinFloatMinof:csv #1{\expandafter\XINT_flminof:_a\romannumeral-`0#1,,}%
-\def\XINT_flminof:_a #1,{\expandafter\XINT_flminof:_b
- \romannumeral0\XINT_inFloat [\XINTdigits]{#1},}%
-\def\XINT_flminof:_b #1,#2,%
- {\expandafter\XINT_flminof:_c\romannumeral-`0#2,{#1},}%
-\def\XINT_flminof:_c #1{\if #1,\expandafter\XINT_of:_e
- \else\expandafter\XINT_flminof:_d\fi #1}%
-\def\XINT_flminof:_d #1,%
- {\expandafter\XINT_flminof:_b\romannumeral0\xintmin
- {\XINTinFloat [\XINTdigits]{#1}}}%
\def\xintCmp {\romannumeral0\xintcmp }%
\def\xintcmp #1%
{%
@@ -1738,7 +1886,7 @@
}%
\def\XINT_fcmp_D #1#2#3%
{%
- \expandafter\XINT__SgnFork\romannumeral-`0\expandafter\XINT__Sgn
+ \expandafter\XINT_cntSgnFork\romannumeral-`0\expandafter\XINT_cntSgn
\the\numexpr #2+\xintLength{#3}-\xintLength{#1}\relax\Z
{ -1}{\XINT_fcmp_E #2\Z {#3}{#1}}{ 1}%
}%
@@ -1769,7 +1917,7 @@
\def\xintFloatAdd {\romannumeral0\xintfloatadd }%
\def\xintfloatadd #1{\XINT_fladd_chkopt \xintfloat #1\Z }%
\def\XINTinFloatAdd {\romannumeral0\XINTinfloatadd }%
-\def\XINTinfloatadd #1{\XINT_fladd_chkopt \XINT_inFloat #1\Z }%
+\def\XINTinfloatadd #1{\XINT_fladd_chkopt \XINTinfloat #1\Z }%
\def\XINT_fladd_chkopt #1#2%
{%
\ifx [#2\expandafter\XINT_fladd_opt
@@ -1787,11 +1935,11 @@
\def\XINT_FL_Add #1#2%
{%
\expandafter\XINT_FL_Add_a\expandafter{\the\numexpr #1\expandafter}%
- \expandafter{\romannumeral0\XINT_inFloat [#1]{#2}}%
+ \expandafter{\romannumeral0\XINTinfloat [#1]{#2}}%
}%
\def\XINT_FL_Add_a #1#2#3%
{%
- \expandafter\XINT_FL_Add_b\romannumeral0\XINT_inFloat [#1]{#3}#2{#1}%
+ \expandafter\XINT_FL_Add_b\romannumeral0\XINTinfloat [#1]{#3}#2{#1}%
}%
\def\XINT_FL_Add_b #1%
{%
@@ -1816,7 +1964,7 @@
\def\xintFloatSub {\romannumeral0\xintfloatsub }%
\def\xintfloatsub #1{\XINT_flsub_chkopt \xintfloat #1\Z }%
\def\XINTinFloatSub {\romannumeral0\XINTinfloatsub }%
-\def\XINTinfloatsub #1{\XINT_flsub_chkopt \XINT_inFloat #1\Z }%
+\def\XINTinfloatsub #1{\XINT_flsub_chkopt \XINTinfloat #1\Z }%
\def\XINT_flsub_chkopt #1#2%
{%
\ifx [#2\expandafter\XINT_flsub_opt
@@ -1834,7 +1982,7 @@
\def\xintFloatMul {\romannumeral0\xintfloatmul}%
\def\xintfloatmul #1{\XINT_flmul_chkopt \xintfloat #1\Z }%
\def\XINTinFloatMul {\romannumeral0\XINTinfloatmul }%
-\def\XINTinfloatmul #1{\XINT_flmul_chkopt \XINT_inFloat #1\Z }%
+\def\XINTinfloatmul #1{\XINT_flmul_chkopt \XINTinfloat #1\Z }%
\def\XINT_flmul_chkopt #1#2%
{%
\ifx [#2\expandafter\XINT_flmul_opt
@@ -1852,17 +2000,17 @@
\def\XINT_FL_Mul #1#2%
{%
\expandafter\XINT_FL_Mul_a\expandafter{\the\numexpr #1\expandafter}%
- \expandafter{\romannumeral0\XINT_inFloat [#1]{#2}}%
+ \expandafter{\romannumeral0\XINTinfloat [#1]{#2}}%
}%
\def\XINT_FL_Mul_a #1#2#3%
{%
- \expandafter\XINT_FL_Mul_b\romannumeral0\XINT_inFloat [#1]{#3}#2%
+ \expandafter\XINT_FL_Mul_b\romannumeral0\XINTinfloat [#1]{#3}#2%
}%
\def\XINT_FL_Mul_b #1[#2]#3[#4]{\xintE{\xintiiMul {#1}{#3}}{#2+#4}}%
\def\xintFloatDiv {\romannumeral0\xintfloatdiv}%
\def\xintfloatdiv #1{\XINT_fldiv_chkopt \xintfloat #1\Z }%
\def\XINTinFloatDiv {\romannumeral0\XINTinfloatdiv }%
-\def\XINTinfloatdiv #1{\XINT_fldiv_chkopt \XINT_inFloat #1\Z }%
+\def\XINTinfloatdiv #1{\XINT_fldiv_chkopt \XINTinfloat #1\Z }%
\def\XINT_fldiv_chkopt #1#2%
{%
\ifx [#2\expandafter\XINT_fldiv_opt
@@ -1880,17 +2028,17 @@
\def\XINT_FL_Div #1#2%
{%
\expandafter\XINT_FL_Div_a\expandafter{\the\numexpr #1\expandafter}%
- \expandafter{\romannumeral0\XINT_inFloat [#1]{#2}}%
+ \expandafter{\romannumeral0\XINTinfloat [#1]{#2}}%
}%
\def\XINT_FL_Div_a #1#2#3%
{%
- \expandafter\XINT_FL_Div_b\romannumeral0\XINT_inFloat [#1]{#3}#2%
+ \expandafter\XINT_FL_Div_b\romannumeral0\XINTinfloat [#1]{#3}#2%
}%
\def\XINT_FL_Div_b #1[#2]#3[#4]{\xintE{#3/#1}{#4-#2}}%
\def\XINTinFloatSum {\romannumeral0\XINTinfloatsum }%
\def\XINTinfloatsum #1{\expandafter\XINT_floatsum_a\romannumeral-`0#1\relax }%
\def\XINT_floatsum_a #1{\expandafter\XINT_floatsum_b
- \romannumeral0\XINT_inFloat[\XINTdigits]{#1}\Z }%
+ \romannumeral0\XINTinfloat[\XINTdigits]{#1}\Z }%
\def\XINT_floatsum_b #1\Z #2%
{\expandafter\XINT_floatsum_c\romannumeral-`0#2\Z {#1}\Z}%
\def\XINT_floatsum_c #1%
@@ -1898,18 +2046,10 @@
\def\XINT_floatsum_d #1\Z
{\expandafter\XINT_floatsum_b\romannumeral0\XINTinfloatadd {#1}}%
\def\XINT_floatsum_e #1\Z #2\Z { #2}%
-\def\XINTinFloatSum:csv #1{\expandafter\XINT_floatsum:_a\romannumeral-`0#1,,^}%
-\def\XINT_floatsum:_a {\XINT_floatsum:_b {0/1[0]}}%
-\def\XINT_floatsum:_b #1#2,%
- {\expandafter\XINT_floatsum:_c\romannumeral-`0#2,{#1}}%
-\def\XINT_floatsum:_c #1{\if #1,\expandafter\XINT_:_e
- \else\expandafter\XINT_floatsum:_d\fi #1}%
-\def\XINT_floatsum:_d #1,#2{\expandafter\XINT_floatsum:_b\expandafter
- {\romannumeral0\XINTinfloatadd {#2}{#1}}}%
\def\XINTinFloatPrd {\romannumeral0\XINTinfloatprd }%
\def\XINTinfloatprd #1{\expandafter\XINT_floatprd_a\romannumeral-`0#1\relax }%
\def\XINT_floatprd_a #1{\expandafter\XINT_floatprd_b
- \romannumeral0\XINT_inFloat[\XINTdigits]{#1}\Z }%
+ \romannumeral0\XINTinfloat[\XINTdigits]{#1}\Z }%
\def\XINT_floatprd_b #1\Z #2%
{\expandafter\XINT_floatprd_c\romannumeral-`0#2\Z {#1}\Z}%
\def\XINT_floatprd_c #1%
@@ -1917,18 +2057,10 @@
\def\XINT_floatprd_d #1\Z
{\expandafter\XINT_floatprd_b\romannumeral0\XINTinfloatmul {#1}}%
\def\XINT_floatprd_e #1\Z #2\Z { #2}%
-\def\XINTinFloatPred:csv #1{\expandafter\XINT_floatprd:_a\romannumeral-`0#1,,^}%
-\def\XINT_floatprd:_a {\XINT_floatprd:_b {1/1[0]}}%
-\def\XINT_floatprd:_b #1#2,%
- {\expandafter\XINT_floatprd:_c\romannumeral-`0#2,{#1}}%
-\def\XINT_floatprd:_c #1{\if #1,\expandafter\XINT_:_e
- \else\expandafter\XINT_floatprd:_d\fi #1}%
-\def\XINT_floatprd:_d #1,#2{\expandafter\XINT_floatprd:_b\expandafter
- {\romannumeral0\XINTinfloatmul {#2}{#1}}}%
\def\xintFloatPow {\romannumeral0\xintfloatpow}%
\def\xintfloatpow #1{\XINT_flpow_chkopt \xintfloat #1\Z }%
\def\XINTinFloatPow {\romannumeral0\XINTinfloatpow }%
-\def\XINTinfloatpow #1{\XINT_flpow_chkopt \XINT_inFloat #1\Z }%
+\def\XINTinfloatpow #1{\XINT_flpow_chkopt \XINTinfloat #1\Z }%
\def\XINT_flpow_chkopt #1#2%
{%
\ifx [#2\expandafter\XINT_flpow_opt
@@ -1967,12 +2099,12 @@
{%
\expandafter\XINT_flpow_checkB_d \expandafter
{\the\numexpr \expandafter\xintLength\expandafter
- {\the\numexpr #1*20/3}+#1+#2+1}%
+ {\the\numexpr #1*20/\xint_c_iii }+#1+#2+\xint_c_i }%
}%
\def\XINT_flpow_checkB_d #1#2#3#4%
{%
\expandafter \XINT_flpow_a
- \romannumeral0\XINT_inFloat [#1]{#4}{#1}{#2}#3%
+ \romannumeral0\XINTinfloat [#1]{#4}{#1}{#2}#3%
}%
\def\XINT_flpow_a #1%
{%
@@ -1982,82 +2114,84 @@
0-{\XINT_flpow_b 0#1}%
\krof
}%
-\def\XINT_flpow_zero [#1]#2#3#4#5%
-{%
- \if #41 \xint_afterfi {\xintError:DivisionByZero\space 1.e2147483647}%
- \else \xint_afterfi { 0.e0}\fi
-}%
\def\XINT_flpow_b #1#2[#3]#4#5%
{%
- \XINT_flpow_c {#4}{#5}{#2[#3]}{#1*\ifodd #5 1\else 0\fi}%
+ \XINT_flpow_loopI {#5}{#2[#3]}{\romannumeral0\XINTinfloatmul [#4]}%
+ {#1*\ifodd #5 1\else 0\fi}%
}%
-\def\XINT_flpow_c #1#2#3#4%
+\def\XINT_flpow_zero [#1]#2#3#4#5%
{%
- \XINT_flpow_loop {#1}{#2}{#3}{{#1}}\XINT_flpow_prd
- \xint_relax
- \xint_bye\xint_bye\xint_bye\xint_bye
- \xint_bye\xint_bye\xint_bye\xint_bye
- \xint_relax {#4}%
+ \if #41\xint_afterfi {\xintError:DivisionByZero #5{1[2147483648]}}%
+ \else \xint_afterfi {#5{0[0]}}\fi
}%
-\def\XINT_flpow_loop #1#2#3%
+\def\XINT_flpow_loopI #1%
{%
- \ifnum #2 = 1
- \expandafter\XINT_flpow_loop_end
+ \ifnum #1=\xint_c_i\XINT_flpow_ItoIII\fi
+ \ifodd #1
+ \expandafter\XINT_flpow_loopI_odd
\else
- \xint_afterfi{\expandafter\XINT_flpow_loop_a
- \expandafter{\the\numexpr 2*(#2/2)-#2\expandafter }% b mod 2
- \expandafter{\the\numexpr #2-#2/2\expandafter }% [b/2]
- \expandafter{\romannumeral0\XINTinfloatmul [#1]{#3}{#3}}}%
+ \expandafter\XINT_flpow_loopI_even
\fi
- {#1}{{#3}}%
+ {#1}%
}%
-\def\XINT_flpow_loop_a #1#2#3#4%
+\def\XINT_flpow_ItoIII\fi #1\fi #2#3#4#5%
{%
- \ifnum #1 = 1
- \expandafter\XINT_flpow_loop
- \else
- \expandafter\XINT_flpow_loop_throwaway
- \fi
- {#4}{#2}{#3}%
+ \fi\expandafter\XINT_flpow_III\the\numexpr #5\relax #3%
}%
-\def\XINT_flpow_loop_throwaway #1#2#3#4%
+\def\XINT_flpow_loopI_even #1#2#3%
{%
- \XINT_flpow_loop {#1}{#2}{#3}%
+ \expandafter\XINT_flpow_loopI\expandafter
+ {\the\numexpr #1/\xint_c_ii\expandafter}\expandafter
+ {#3{#2}{#2}}{#3}%
}%
-\def\XINT_flpow_loop_end #1{\romannumeral0\XINT_rord_main {}\relax }%
-\def\XINT_flpow_prd #1#2%
+\def\XINT_flpow_loopI_odd #1#2#3%
{%
- \XINT_flpow_prd_getnext {#2}{#1}%
+ \expandafter\XINT_flpow_loopII\expandafter
+ {\the\numexpr #1/\xint_c_ii-\xint_c_i\expandafter}\expandafter
+ {#3{#2}{#2}}{#3}{#2}%
}%
-\def\XINT_flpow_prd_getnext #1#2#3%
+\def\XINT_flpow_loopII #1%
{%
- \XINT_flpow_prd_checkiffinished #3\Z {#1}{#2}%
+ \ifnum #1 = \xint_c_i\XINT_flpow_IItoIII\fi
+ \ifodd #1
+ \expandafter\XINT_flpow_loopII_odd
+ \else
+ \expandafter\XINT_flpow_loopII_even
+ \fi
+ {#1}%
}%
-\def\XINT_flpow_prd_checkiffinished #1%
+\def\XINT_flpow_loopII_even #1#2#3%
{%
- \xint_gob_til_relax #1\XINT_flpow_prd_end\relax
- \XINT_flpow_prd_compute #1%
+ \expandafter\XINT_flpow_loopII\expandafter
+ {\the\numexpr #1/\xint_c_ii\expandafter}\expandafter
+ {#3{#2}{#2}}{#3}%
}%
-\def\XINT_flpow_prd_compute #1\Z #2#3%
+\def\XINT_flpow_loopII_odd #1#2#3#4%
{%
- \expandafter\XINT_flpow_prd_getnext\expandafter
- {\romannumeral0\XINTinfloatmul [#3]{#1}{#2}}{#3}%
+ \expandafter\XINT_flpow_loopII_odda\expandafter
+ {#3{#2}{#4}}{#1}{#2}{#3}%
}%
-\def\XINT_flpow_prd_end\relax\XINT_flpow_prd_compute
- \relax\Z #1#2#3%
+\def\XINT_flpow_loopII_odda #1#2#3#4%
{%
- \expandafter\XINT_flpow_conclude \the\numexpr #3\relax #1%
+ \expandafter\XINT_flpow_loopII\expandafter
+ {\the\numexpr #2/\xint_c_ii-\xint_c_i\expandafter}\expandafter
+ {#4{#3}{#3}}{#4}{#1}%
}%
-\def\XINT_flpow_conclude #1#2[#3]#4%
+\def\XINT_flpow_IItoIII\fi #1\fi #2#3#4#5#6%
{%
- \expandafter\XINT_flpow_conclude_really\expandafter
+ \fi\expandafter\XINT_flpow_III\the\numexpr #6\expandafter\relax
+ #4{#3}{#5}%
+}%
+\def\XINT_flpow_III #1#2[#3]#4%
+{%
+ \expandafter\XINT_flpow_IIIend\expandafter
{\the\numexpr\if #41 -\fi#3\expandafter}%
\xint_UDzerofork
#4{{#2}}%
0{{1/#2}}%
\krof #1%
}%
-\def\XINT_flpow_conclude_really #1#2#3#4%
+\def\XINT_flpow_IIIend #1#2#3#4%
{%
\xint_UDzerofork
#3{#4{#2[#1]}}%
@@ -2067,7 +2201,7 @@
\def\xintFloatPower {\romannumeral0\xintfloatpower}%
\def\xintfloatpower #1{\XINT_flpower_chkopt \xintfloat #1\Z }%
\def\XINTinFloatPower {\romannumeral0\XINTinfloatpower}%
-\def\XINTinfloatpower #1{\XINT_flpower_chkopt \XINT_inFloat #1\Z }%
+\def\XINTinfloatpower #1{\XINT_flpower_chkopt \XINTinfloat #1\Z }%
\def\XINT_flpower_chkopt #1#2%
{%
\ifx [#2\expandafter\XINT_flpower_opt
@@ -2106,68 +2240,84 @@
{%
\expandafter\XINT_flpower_checkB_d \expandafter
{\the\numexpr \expandafter\xintLength\expandafter
- {\the\numexpr #1*20/3}+#1+#2+1}%
+ {\the\numexpr #1*20/\xint_c_iii }+#1+#2+\xint_c_i }%
}%
\def\XINT_flpower_checkB_d #1#2#3#4%
{%
\expandafter \XINT_flpower_a
- \romannumeral0\XINT_inFloat [#1]{#4}{#1}{#2}#3%
+ \romannumeral0\XINTinfloat [#1]{#4}{#1}{#2}#3%
}%
\def\XINT_flpower_a #1%
{%
\xint_UDzerominusfork
- #1-\XINT_flpower_zero
+ #1-\XINT_flpow_zero
0#1{\XINT_flpower_b 1}%
0-{\XINT_flpower_b 0#1}%
\krof
}%
-\def\XINT_flpower_zero [#1]#2#3#4#5%
+\def\XINT_flpower_b #1#2[#3]#4#5%
{%
- \if #41
- \xint_afterfi {\xintError:DivisionByZero\space 1.e2147483647}%
- \else \xint_afterfi { 0.e0}\fi
+ \XINT_flpower_loopI {#5}{#2[#3]}{\romannumeral0\XINTinfloatmul [#4]}%
+ {#1*\xintiiOdd {#5}}%
}%
-\def\XINT_flpower_b #1#2[#3]#4#5%
+\def\XINT_flpower_loopI #1%
{%
- \XINT_flpower_c {#4}{#5}{#2[#3]}{#1*\xintiiOdd {#5}}%
+ \if1\XINT_isOne {#1}\XINT_flpower_ItoIII\fi
+ \if1\xintiiOdd{#1}%
+ \expandafter\expandafter\expandafter\XINT_flpower_loopI_odd
+ \else
+ \expandafter\expandafter\expandafter\XINT_flpower_loopI_even
+ \fi
+ \expandafter {\romannumeral0\xinthalf{#1}}%
}%
-\def\XINT_flpower_c #1#2#3#4%
+\def\XINT_flpower_ItoIII\fi #1\fi\expandafter #2#3#4#5%
{%
- \XINT_flpower_loop {#1}{#2}{#3}{{#1}}\XINT_flpow_prd
- \xint_relax
- \xint_bye\xint_bye\xint_bye\xint_bye
- \xint_bye\xint_bye\xint_bye\xint_bye
- \xint_relax {#4}%
+ \fi\expandafter\XINT_flpow_III \the\numexpr #5\relax #3%
}%
-\def\XINT_flpower_loop #1#2#3%
+\def\XINT_flpower_loopI_even #1#2#3%
{%
- \if0\XINT_isOne {#2}\xint_afterfi
- {\expandafter\XINT_flpower_loop_x\expandafter
- {\romannumeral0\XINTinfloatmul [#1]{#3}{#3}}%
- {\romannumeral0\xintdivision {#2}{2}}%
- }%
- \else\expandafter\XINT_flpow_loop_end
- \fi
- {#1}{{#3}}%
+ \expandafter\XINT_flpower_toI\expandafter {#3{#2}{#2}}{#1}{#3}%
+}%
+\def\XINT_flpower_loopI_odd #1#2#3%
+{%
+ \expandafter\XINT_flpower_toII\expandafter {#3{#2}{#2}}{#1}{#3}{#2}%
}%
-\def\XINT_flpower_loop_x #1#2{\expandafter\XINT_flpower_loop_a #2{#1}}%
-\def\XINT_flpower_loop_a #1#2#3#4%
+\def\XINT_flpower_toI #1#2{\XINT_flpower_loopI {#2}{#1}}%
+\def\XINT_flpower_toII #1#2{\XINT_flpower_loopII {#2}{#1}}%
+\def\XINT_flpower_loopII #1%
{%
- \ifnum #2 = 1
- \expandafter\XINT_flpower_loop
+ \if1\XINT_isOne {#1}\XINT_flpower_IItoIII\fi
+ \if1\xintiiOdd{#1}%
+ \expandafter\expandafter\expandafter\XINT_flpower_loopII_odd
\else
- \expandafter\XINT_flpower_loop_throwaway
+ \expandafter\expandafter\expandafter\XINT_flpower_loopII_even
\fi
- {#4}{#1}{#3}%
+ \expandafter {\romannumeral0\xinthalf{#1}}%
}%
-\def\XINT_flpower_loop_throwaway #1#2#3#4%
+\def\XINT_flpower_loopII_even #1#2#3%
{%
- \XINT_flpower_loop {#1}{#2}{#3}%
+ \expandafter\XINT_flpower_toII\expandafter
+ {#3{#2}{#2}}{#1}{#3}%
+}%
+\def\XINT_flpower_loopII_odd #1#2#3#4%
+{%
+ \expandafter\XINT_flpower_loopII_odda\expandafter
+ {#3{#2}{#4}}{#2}{#3}{#1}%
+}%
+\def\XINT_flpower_loopII_odda #1#2#3#4%
+{%
+ \expandafter\XINT_flpower_toII\expandafter
+ {#3{#2}{#2}}{#4}{#3}{#1}%
+}%
+\def\XINT_flpower_IItoIII\fi #1\fi\expandafter #2#3#4#5#6%
+{%
+ \fi\expandafter\XINT_flpow_III\the\numexpr #6\expandafter\relax
+ #4{#3}{#5}%
}%
\def\xintFloatSqrt {\romannumeral0\xintfloatsqrt }%
\def\xintfloatsqrt #1{\XINT_flsqrt_chkopt \xintfloat #1\Z }%
\def\XINTinFloatSqrt {\romannumeral0\XINTinfloatsqrt }%
-\def\XINTinfloatsqrt #1{\XINT_flsqrt_chkopt \XINT_inFloat #1\Z }%
+\def\XINTinfloatsqrt #1{\XINT_flsqrt_chkopt \XINTinfloat #1\Z }%
\def\XINT_flsqrt_chkopt #1#2%
{%
\ifx [#2\expandafter\XINT_flsqrt_opt
@@ -2193,7 +2343,7 @@
\def\XINT_FL_sqrt_a #1#2%
{%
\expandafter\XINT_FL_sqrt_checkifzeroorneg
- \romannumeral0\XINT_inFloat [#1]{#2}%
+ \romannumeral0\XINTinfloat [#1]{#2}%
}%
\def\XINT_FL_sqrt_checkifzeroorneg #1%
{%
@@ -2203,8 +2353,8 @@
0-{\XINT_FL_sqrt_b #1}%
\krof
}%
-\def\XINT_FL_sqrt_iszero #1[#2]{0/1[0]}%
-\def\XINT_FL_sqrt_isneg #1[#2]{\xintError:RootOfNegative 0/1[0]}%
+\def\XINT_FL_sqrt_iszero #1[#2]{0[0]}%
+\def\XINT_FL_sqrt_isneg #1[#2]{\xintError:RootOfNegative 0[0]}%
\def\XINT_FL_sqrt_b #1[#2]%
{%
\ifodd #2
@@ -2223,15 +2373,14 @@
\expandafter\XINT_sqrt_a
\expandafter{\romannumeral0\xintlength {#2}}\XINT_flsqrt_big_d {#2}{#1}%
}%
-\def\XINT_flsqrt_big_d #1\or #2\fi #3%
+\def\XINT_flsqrt_big_d #1#2%
{%
- \fi
- \ifodd #3
- \xint_afterfi{\expandafter\XINT_flsqrt_big_eB}%
+ \ifodd #2
+ \expandafter\expandafter\expandafter\XINT_flsqrt_big_eB
\else
- \xint_afterfi{\expandafter\XINT_flsqrt_big_eA}%
+ \expandafter\expandafter\expandafter\XINT_flsqrt_big_eA
\fi
- \expandafter {\the\numexpr (#3-\xint_c_i)/\xint_c_ii }{#1}%
+ \expandafter {\the\numexpr (#2-\xint_c_i)/\xint_c_ii }{#1}%
}%
\def\XINT_flsqrt_big_eA #1#2#3%
{%
@@ -2342,6 +2491,108 @@
{\xintHalf{\xintiiQuo{\XINT_dsx_addzerosnofuss {#4}{#2}}{#3}}}}%
}%
\def\XINT_flsqrt_big_end_b #1#2{#2[#1]}%
+\def\XINTinFloatMaxof {\romannumeral0\XINTinfloatmaxof }%
+\def\XINTinfloatmaxof #1{\expandafter\XINT_flmaxof_a\romannumeral-`0#1\relax }%
+\def\XINT_flmaxof_a #1{\expandafter\XINT_flmaxof_b
+ \romannumeral0\XINTinfloat [\XINTdigits]{#1}\Z }%
+\def\XINT_flmaxof_b #1\Z #2%
+ {\expandafter\XINT_flmaxof_c\romannumeral-`0#2\Z {#1}\Z}%
+\def\XINT_flmaxof_c #1%
+ {\xint_gob_til_relax #1\XINT_flmaxof_e\relax\XINT_flmaxof_d #1}%
+\def\XINT_flmaxof_d #1\Z
+ {\expandafter\XINT_flmaxof_b\romannumeral0\xintmax
+ {\XINTinFloat [\XINTdigits]{#1}}}%
+\def\XINT_flmaxof_e #1\Z #2\Z { #2}%
+\def\XINTinFloatMinof {\romannumeral0\XINTinfloatminof }%
+\def\XINTinfloatminof #1{\expandafter\XINT_flminof_a\romannumeral-`0#1\relax }%
+\def\XINT_flminof_a #1{\expandafter\XINT_flminof_b
+ \romannumeral0\XINTinfloat [\XINTdigits]{#1}\Z }%
+\def\XINT_flminof_b #1\Z #2%
+ {\expandafter\XINT_flminof_c\romannumeral-`0#2\Z {#1}\Z}%
+\def\XINT_flminof_c #1%
+ {\xint_gob_til_relax #1\XINT_flminof_e\relax\XINT_flminof_d #1}%
+\def\XINT_flminof_d #1\Z
+ {\expandafter\XINT_flminof_b\romannumeral0\xintmin
+ {\XINTinFloat [\XINTdigits]{#1}}}%
+\def\XINT_flminof_e #1\Z #2\Z { #2}%
+\def\xintRound:csv #1{\expandafter\XINT_round:_a\romannumeral-`0#1,,^}%
+\def\XINT_round:_a {\XINT_round:_b {}}%
+\def\XINT_round:_b #1#2,%
+ {\expandafter\XINT_round:_c\romannumeral-`0#2,{#1}}%
+\def\XINT_round:_c #1{\if #1,\expandafter\XINT_:_f
+ \else\expandafter\XINT_round:_d\fi #1}%
+\def\XINT_round:_d #1,%
+ {\expandafter\XINT_round:_e\romannumeral0\xintiround 0{#1},}%
+\def\XINT_round:_e #1,#2{\XINT_round:_b {#2,#1}}%
+\def\xintFloat:csv #1{\expandafter\XINT_float:_a\romannumeral-`0#1,,^}%
+\def\XINT_float:_a {\XINT_float:_b {}}%
+\def\XINT_float:_b #1#2,%
+ {\expandafter\XINT_float:_c\romannumeral-`0#2,{#1}}%
+\def\XINT_float:_c #1{\if #1,\expandafter\XINT_:_f
+ \else\expandafter\XINT_float:_d\fi #1}%
+\def\XINT_float:_d #1,%
+ {\expandafter\XINT_float:_e\romannumeral0\xintfloat {#1},}%
+\def\XINT_float:_e #1,#2{\XINT_float:_b {#2,#1}}%
+\def\xintSum:csv #1{\expandafter\XINT_sum:_a\romannumeral-`0#1,,^}%
+\def\XINT_sum:_a {\XINT_sum:_b {0/1[0]}}%
+\def\XINT_sum:_b #1#2,{\expandafter\XINT_sum:_c\romannumeral-`0#2,{#1}}%
+\def\XINT_sum:_c #1{\if #1,\expandafter\XINT_:_e
+ \else\expandafter\XINT_sum:_d\fi #1}%
+\def\XINT_sum:_d #1,#2{\expandafter\XINT_sum:_b\expandafter
+ {\romannumeral0\xintadd {#2}{#1}}}%
+\def\xintPrd:csv #1{\expandafter\XINT_prd:_a\romannumeral-`0#1,,^}%
+\def\XINT_prd:_a {\XINT_prd:_b {1/1[0]}}%
+\def\XINT_prd:_b #1#2,{\expandafter\XINT_prd:_c\romannumeral-`0#2,{#1}}%
+\def\XINT_prd:_c #1{\if #1,\expandafter\XINT_:_e
+ \else\expandafter\XINT_prd:_d\fi #1}%
+\def\XINT_prd:_d #1,#2{\expandafter\XINT_prd:_b\expandafter
+ {\romannumeral0\xintmul {#2}{#1}}}%
+\def\xintMaxof:csv #1{\expandafter\XINT_maxof:_b\romannumeral-`0#1,,}%
+\def\XINT_maxof:_b #1,#2,{\expandafter\XINT_maxof:_c\romannumeral-`0#2,{#1},}%
+\def\XINT_maxof:_c #1{\if #1,\expandafter\XINT_of:_e
+ \else\expandafter\XINT_maxof:_d\fi #1}%
+\def\XINT_maxof:_d #1,{\expandafter\XINT_maxof:_b\romannumeral0\xintmax {#1}}%
+\def\xintMinof:csv #1{\expandafter\XINT_minof:_b\romannumeral-`0#1,,}%
+\def\XINT_minof:_b #1,#2,{\expandafter\XINT_minof:_c\romannumeral-`0#2,{#1},}%
+\def\XINT_minof:_c #1{\if #1,\expandafter\XINT_of:_e
+ \else\expandafter\XINT_minof:_d\fi #1}%
+\def\XINT_minof:_d #1,{\expandafter\XINT_minof:_b\romannumeral0\xintmin {#1}}%
+\def\XINTinFloatMinof:csv #1{\expandafter\XINT_flminof:_a\romannumeral-`0#1,,}%
+\def\XINT_flminof:_a #1,{\expandafter\XINT_flminof:_b
+ \romannumeral0\XINTinfloat [\XINTdigits]{#1},}%
+\def\XINT_flminof:_b #1,#2,%
+ {\expandafter\XINT_flminof:_c\romannumeral-`0#2,{#1},}%
+\def\XINT_flminof:_c #1{\if #1,\expandafter\XINT_of:_e
+ \else\expandafter\XINT_flminof:_d\fi #1}%
+\def\XINT_flminof:_d #1,%
+ {\expandafter\XINT_flminof:_b\romannumeral0\xintmin
+ {\XINTinFloat [\XINTdigits]{#1}}}%
+\def\XINTinFloatMaxof:csv #1{\expandafter\XINT_flmaxof:_a\romannumeral-`0#1,,}%
+\def\XINT_flmaxof:_a #1,{\expandafter\XINT_flmaxof:_b
+ \romannumeral0\XINTinfloat [\XINTdigits]{#1},}%
+\def\XINT_flmaxof:_b #1,#2,%
+ {\expandafter\XINT_flmaxof:_c\romannumeral-`0#2,{#1},}%
+\def\XINT_flmaxof:_c #1{\if #1,\expandafter\XINT_of:_e
+ \else\expandafter\XINT_flmaxof:_d\fi #1}%
+\def\XINT_flmaxof:_d #1,%
+ {\expandafter\XINT_flmaxof:_b\romannumeral0\xintmax
+ {\XINTinFloat [\XINTdigits]{#1}}}%
+\def\XINTinFloatSum:csv #1{\expandafter\XINT_floatsum:_a\romannumeral-`0#1,,^}%
+\def\XINT_floatsum:_a {\XINT_floatsum:_b {0[0]}}%
+\def\XINT_floatsum:_b #1#2,%
+ {\expandafter\XINT_floatsum:_c\romannumeral-`0#2,{#1}}%
+\def\XINT_floatsum:_c #1{\if #1,\expandafter\XINT_:_e
+ \else\expandafter\XINT_floatsum:_d\fi #1}%
+\def\XINT_floatsum:_d #1,#2{\expandafter\XINT_floatsum:_b\expandafter
+ {\romannumeral0\XINTinfloatadd {#2}{#1}}}%
+\def\XINTinFloatPred:csv #1{\expandafter\XINT_floatprd:_a\romannumeral-`0#1,,^}%
+\def\XINT_floatprd:_a {\XINT_floatprd:_b {1[0]}}%
+\def\XINT_floatprd:_b #1#2,%
+ {\expandafter\XINT_floatprd:_c\romannumeral-`0#2,{#1}}%
+\def\XINT_floatprd:_c #1{\if #1,\expandafter\XINT_:_e
+ \else\expandafter\XINT_floatprd:_d\fi #1}%
+\def\XINT_floatprd:_d #1,#2{\expandafter\XINT_floatprd:_b\expandafter
+ {\romannumeral0\XINTinfloatmul {#2}{#1}}}%
\XINT_restorecatcodes_endinput%
\endinput
%%