summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/xint/xintfrac.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2013-09-24 22:26:51 +0000
committerKarl Berry <karl@freefriends.org>2013-09-24 22:26:51 +0000
commitd9dac37ce48e9caf9f59e903857484b52bec72cb (patch)
tree18c82bb521e2ac15cd9bf1e3e2602ea2bd568373 /Master/texmf-dist/tex/generic/xint/xintfrac.sty
parent60832b1a02dcf82922ff377c63d5fd5a57c201ad (diff)
xint (24sep13)
git-svn-id: svn://tug.org/texlive/trunk@31744 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.sty303
1 files changed, 235 insertions, 68 deletions
diff --git a/Master/texmf-dist/tex/generic/xint/xintfrac.sty b/Master/texmf-dist/tex/generic/xint/xintfrac.sty
index 162aa549471..dc3c8ad2f9a 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.08b of June 14, 2013)
+%% The xint bundle (version 1.09a of September 22, 2013)
%% xintfrac: Expandable operations on fractions
%% Copyright (C) 2013 by Jean-Francois Burnol
%%----------------------------------------------------------------
@@ -165,7 +165,7 @@
\fi
\expandafter\x\csname ver@xintfrac.sty\endcsname
\ProvidesPackage{xintfrac}%
- [2013/06/14 v1.08b Expandable operations on fractions (jfB)]%
+ [2013/09/24 v1.09a Expandable operations on fractions (jfB)]%
\chardef\xint_c_vi 6
\chardef\xint_c_vii 7
\chardef\xint_c_xviii 18
@@ -480,6 +480,12 @@
\def\XINT_rawz_Ba #1#2#3{\expandafter\XINT_rawz_Bb
\expandafter{\romannumeral0\xint_dsh {#3}{#1}}{#2}}%
\def\XINT_rawz_Bb #1#2{ #2/#1}%
+\def\xintFloor {\romannumeral0\xintfloor }%
+\def\xintfloor #1{\expandafter\XINT_floor
+ \romannumeral0\xintrawwithzeros {#1}.}%
+\def\XINT_floor #1/#2.{\xintiquo {#1}{#2}}%
+\def\xintCeil {\romannumeral0\xintceil }%
+\def\xintceil #1{\xintiiopp {\xintFloor {\xintOpp{#1}}}}%
\def\xintNumerator {\romannumeral0\xintnumerator }%
\def\xintnumerator
{%
@@ -781,8 +787,8 @@
\def\XINT_jrr_loop_b #1#2#3#4#5#6#7%
{%
\expandafter \XINT_jrr_loop_c \expandafter
- {\romannumeral0\xintiadd{\XINT_Mul{#4}{#1}}{#6}}%
- {\romannumeral0\xintiadd{\XINT_Mul{#5}{#1}}{#7}}%
+ {\romannumeral0\xintiiadd{\XINT_Mul{#4}{#1}}{#6}}%
+ {\romannumeral0\xintiiadd{\XINT_Mul{#5}{#1}}{#7}}%
{#2}{#3}{#4}{#5}%
}%
\def\XINT_jrr_loop_c #1#2%
@@ -965,10 +971,20 @@
{%
\XINT_addm_A 0{}1000\W\X\Y\Z #1000\W\X\Y\Z \Z
}%
-\mathchardef\XINT_digits 16
+\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_round:_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\XINT_round:_f ,#1#2^{\xint_gobble_i #1}%
+\mathchardef\XINTdigits 16
\def\xintDigits #1#2%
- {\afterassignment \xint_gobble_i \mathchardef\XINT_digits=}%
-\def\xinttheDigits {\number\XINT_digits }%
+ {\afterassignment \xint_gobble_i \mathchardef\XINTdigits=}%
+\def\xinttheDigits {\number\XINTdigits }%
\def\xintFloat {\romannumeral0\xintfloat }%
\def\xintfloat #1{\XINT_float_chkopt #1\Z }%
\def\XINT_float_chkopt #1%
@@ -979,7 +995,7 @@
}%
\def\XINT_float_noopt #1\Z
{%
- \expandafter\XINT_float_a\expandafter\XINT_digits
+ \expandafter\XINT_float_a\expandafter\XINTdigits
\romannumeral0\XINT_infrac {#1}\XINT_float_Q
}%
\def\XINT_float_opt [\Z #1]#2%
@@ -1019,7 +1035,8 @@
\def\XINT_float_Ma #1#2#3%
{%
\expandafter\XINT_float_Mb\expandafter
- {\the\numexpr #1-#2\expandafter}\expandafter
+ {\the\numexpr #1-#2\expandafter\expandafter\expandafter}%
+ \expandafter\expandafter\expandafter
{\expandafter\xint_firstoftwo
\romannumeral0\XINT_split_fromleft_loop {#2}{}#3\W\W\W\W\W\W\W\W\Z
}{#2}%
@@ -1050,7 +1067,8 @@
\expandafter\XINT_float_P\expandafter
{\the\numexpr #2\expandafter}\expandafter
{\the\numexpr #2\expandafter}\expandafter
- {\the\numexpr #3-#1+#2\expandafter}\expandafter
+ {\the\numexpr #3-#1+#2\expandafter\expandafter\expandafter}%
+ \expandafter\expandafter\expandafter
{\expandafter\xint_firstoftwo
\romannumeral0\XINT_split_fromleft_loop {#2}{}#4\W\W\W\W\W\W\W\W\Z
}%
@@ -1072,13 +1090,13 @@
{%
\expandafter\XINT_float_Sa
\romannumeral0\xintiquo {#2}%
- {\romannumeral-`0\XINT_dsx_addzerosnofuss {-#1}{#3}}\Z {#1}%
+ {\XINT_dsx_addzerosnofuss {-#1}{#3}}\Z {#1}%
}%
\def\XINT_float_Rii #1#2#3%
{%
\expandafter\XINT_float_Sa
\romannumeral0\xintiquo
- {\romannumeral-`0\XINT_dsx_addzerosnofuss {#1}{#2}}{#3}\Z {#1}%
+ {\XINT_dsx_addzerosnofuss {#1}{#2}}{#3}\Z {#1}%
}%
\def\XINT_float_Sa #1%
{%
@@ -1140,6 +1158,17 @@
{\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_float:_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\XINT_float:_f ,#1#2^{\xint_gobble_i #1}%
+\def\XINTinFloat {\romannumeral0\XINT_inFloat }%
\def\XINT_inFloat [#1]#2%
{%
\expandafter\XINT_infloat_a\expandafter
@@ -1158,8 +1187,8 @@
0-\dummy {\XINT_float_K #1}%
\krof
}%
-\def\XINT_infloat_zero #1\Z #2#3#4#5{0[0]}%
-\def\XINT_infloat_J {\expandafter-\romannumeral-`0\XINT_float_K }%
+\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%
{%
\ifnum #1<\xint_c_
@@ -1172,13 +1201,13 @@
{%
\expandafter\XINT_infloat_S\expandafter
{\romannumeral0\xintiquo {#2}%
- {\romannumeral-`0\XINT_dsx_addzerosnofuss {-#1}{#3}}}{#1}%
+ {\XINT_dsx_addzerosnofuss {-#1}{#3}}}{#1}%
}%
\def\XINT_infloat_Rii #1#2#3%
{%
\expandafter\XINT_infloat_S\expandafter
{\romannumeral0\xintiquo
- {\romannumeral-`0\XINT_dsx_addzerosnofuss {#1}{#2}}{#3}}{#1}%
+ {\XINT_dsx_addzerosnofuss {#1}{#2}}{#3}}{#1}%
}%
\def\XINT_infloat_S #1#2#3%
{%
@@ -1246,10 +1275,10 @@
\def\XINT_fadd_B #1#2#3#4#5#6#7%
{%
\expandafter\XINT_fadd_C\expandafter
- {\romannumeral0\xintimul {#7}{#5}}%
- {\romannumeral0\xintiadd
- {\romannumeral0\xintimul {\xintDSH {\the\numexpr -#3+#1\relax}{#6}}{#5}}%
- {\romannumeral0\xintimul {#7}{\xintDSH {\the\numexpr -#2+#1\relax}{#4}}}%
+ {\romannumeral0\xintiimul {#7}{#5}}%
+ {\romannumeral0\xintiiadd
+ {\romannumeral0\xintiimul {\xintDSH {\the\numexpr -#3+#1\relax}{#6}}{#5}}%
+ {\romannumeral0\xintiimul {#7}{\xintDSH {\the\numexpr -#2+#1\relax}{#4}}}%
}%
{#1}%
}%
@@ -1277,10 +1306,10 @@
\def\XINT_fsub_B #1#2#3#4#5#6#7%
{%
\expandafter\XINT_fsub_C\expandafter
- {\romannumeral0\xintimul {#7}{#5}}%
- {\romannumeral0\xintisub
- {\romannumeral0\xintimul {\xintDSH {\the\numexpr -#3+#1\relax}{#6}}{#5}}%
- {\romannumeral0\xintimul {#7}{\xintDSH {\the\numexpr -#2+#1\relax}{#4}}}%
+ {\romannumeral0\xintiimul {#7}{#5}}%
+ {\romannumeral0\xintiisub
+ {\romannumeral0\xintiimul {\xintDSH {\the\numexpr -#3+#1\relax}{#6}}{#5}}%
+ {\romannumeral0\xintiimul {#7}{\xintDSH {\the\numexpr -#2+#1\relax}{#4}}}%
}%
{#1}%
}%
@@ -1308,6 +1337,14 @@
\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_sum:_e
+ \else\expandafter\XINT_sum:_d\fi #1}%
+\def\XINT_sum:_d #1,#2{\expandafter\XINT_sum:_b\expandafter
+ {\romannumeral0\xintadd {#2}{#1}}}%
+\def\XINT_sum:_e ,#1#2^{#1}% allows empty list
\def\xintMul {\romannumeral0\xintmul }%
\def\xintmul #1%
{%
@@ -1319,8 +1356,8 @@
{%
\expandafter\XINT_fmul_B
\expandafter{\the\numexpr #1+#4\expandafter}%
- \expandafter{\romannumeral0\xintimul {#6}{#3}}%
- {\romannumeral0\xintimul {#5}{#2}}%
+ \expandafter{\romannumeral0\xintiimul {#6}{#3}}%
+ {\romannumeral0\xintiimul {#5}{#2}}%
}%
\def\XINT_fmul_B #1#2#3%
{%
@@ -1398,6 +1435,14 @@
\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_prd:_e
+ \else\expandafter\XINT_prd:_d\fi #1}%
+\def\XINT_prd:_d #1,#2{\expandafter\XINT_prd:_b\expandafter
+ {\romannumeral0\xintmul {#2}{#1}}}%
+\def\XINT_prd:_e ,#1#2^{#1}% allows empty list
\def\xintDiv {\romannumeral0\xintdiv }%
\def\xintdiv #1%
{%
@@ -1409,8 +1454,8 @@
{%
\expandafter\XINT_fdiv_B
\expandafter{\the\numexpr #4-#1\expandafter}%
- \expandafter{\romannumeral0\xintimul {#2}{#6}}%
- {\romannumeral0\xintimul {#3}{#5}}%
+ \expandafter{\romannumeral0\xintiimul {#2}{#6}}%
+ {\romannumeral0\xintiimul {#3}{#5}}%
}%
\def\XINT_fdiv_B #1#2#3%
{%
@@ -1418,6 +1463,10 @@
\expandafter{#3}{#1}{#2}%
}%
\def\XINT_fdiv_C #1#2{\XINT_outfrac {#2}{#1}}%
+\def\xintIsOne {\romannumeral0\xintisone }%
+\def\xintisone #1{\expandafter\XINT_fracisone
+ \romannumeral0\xintrawwithzeros{#1}\Z }%
+\def\XINT_fracisone #1/#2\Z{\xintsgnfork{\XINT_Cmp {#1}{#2}}{0}{1}{0}}%
\def\xintGeq {\romannumeral0\xintgeq }%
\def\xintgeq #1%
{%
@@ -1438,8 +1487,8 @@
\xint_gob_til_zero #4\XINT_fgeq_Zi 0%
\expandafter\XINT_fgeq_C\expandafter
{\the\numexpr #7-#3\expandafter}\expandafter
- {\romannumeral0\xintimul {#4#5}{#2}}%
- {\romannumeral0\xintimul {#6}{#1}}%
+ {\romannumeral0\xintiimul {#4#5}{#2}}%
+ {\romannumeral0\xintiimul {#6}{#1}}%
}%
\def\XINT_fgeq_Zi 0#1#2#3#4#5#6#7{ 0}%
\def\XINT_fgeq_C #1#2#3%
@@ -1505,6 +1554,45 @@
\or \xint_afterfi{ #2}%
\fi
}%
+\def\xintMaxof {\romannumeral0\xintmaxof }%
+\def\xintmaxof #1{\expandafter\XINT_maxof_a\romannumeral-`0#1\relax }%
+\def\XINT_maxof_a #1{\expandafter\XINT_maxof_b\romannumeral0\xintraw{#1}\Z }%
+\def\XINT_maxof_b #1\Z #2%
+ {\expandafter\XINT_maxof_c\romannumeral-`0#2\Z {#1}\Z}%
+\def\XINT_maxof_c #1%
+ {\xint_gob_til_relax #1\XINT_maxof_e\relax\XINT_maxof_d #1}%
+\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_maxof:_e
+ \else\expandafter\XINT_maxof:_d\fi #1}%
+\def\XINT_maxof:_d #1,{\expandafter\XINT_maxof:_b\romannumeral0\xintmax {#1}}%
+\def\XINT_maxof:_e ,#1,{#1}%
+\def\xintFloatMaxof {\romannumeral0\xintflmaxof }%
+\def\xintflmaxof #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\xintFloatMaxof: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_flmaxof:_e
+ \else\expandafter\XINT_flmaxof:_d\fi #1}%
+\def\XINT_flmaxof:_d #1,%
+ {\expandafter\XINT_flmaxof:_b\romannumeral0\xintmax
+ {\XINTinFloat [\XINTdigits]{#1}}}%
+\def\XINT_flmaxof:_e ,#1,{#1}%
\def\xintMin {\romannumeral0\xintmin }%
\def\xintmin #1%
{%
@@ -1539,6 +1627,45 @@
\or \xint_afterfi{ #1}%
\fi
}%
+\def\xintMinof {\romannumeral0\xintminof }%
+\def\xintminof #1{\expandafter\XINT_minof_a\romannumeral-`0#1\relax }%
+\def\XINT_minof_a #1{\expandafter\XINT_minof_b\romannumeral0\xintraw{#1}\Z }%
+\def\XINT_minof_b #1\Z #2%
+ {\expandafter\XINT_minof_c\romannumeral-`0#2\Z {#1}\Z}%
+\def\XINT_minof_c #1%
+ {\xint_gob_til_relax #1\XINT_minof_e\relax\XINT_minof_d #1}%
+\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_minof:_e
+ \else\expandafter\XINT_minof:_d\fi #1}%
+\def\XINT_minof:_d #1,{\expandafter\XINT_minof:_b\romannumeral0\xintmin {#1}}%
+\def\XINT_minof:_e ,#1,{#1}%
+\def\xintFloatMinof {\romannumeral0\xintflminof }%
+\def\xintflminof #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\xintFloatMinof: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_flminof:_e
+ \else\expandafter\XINT_flminof:_d\fi #1}%
+\def\XINT_flminof:_d #1,%
+ {\expandafter\XINT_flminof:_b\romannumeral0\xintmin
+ {\XINTinFloat [\XINTdigits]{#1}}}%
+\def\XINT_flminof:_e ,#1,{#1}%
\def\xintCmp {\romannumeral0\xintcmp }%
\def\xintcmp #1%
{%
@@ -1571,9 +1698,9 @@
\krof
#1#2%
}%
-\def\XINT_fcmp_zerozero #1[#2]#3[#4]{ 0}%
-\def\XINT_fcmp_firstzero #1[#2]#3[#4]{ -1}%
-\def\XINT_fcmp_secondzero #1[#2]#3[#4]{ 1}%
+\def\XINT_fcmp_zerozero #1#2#3#4{ 0}% 1.08b had some [ and ] here!!!
+\def\XINT_fcmp_firstzero #1#2#3#4{ -1}% incredibly I never saw that until
+\def\XINT_fcmp_secondzero #1#2#3#4{ 1}% preparing 1.09a.
\def\XINT_fcmp_pos #1#2#3#4%
{%
\XINT_fcmp_B #1#3#2#4%
@@ -1582,8 +1709,8 @@
{%
\expandafter\XINT_fcmp_C\expandafter
{\the\numexpr #6-#3\expandafter}\expandafter
- {\romannumeral0\xintimul {#4}{#2}}%
- {\romannumeral0\xintimul {#5}{#1}}%
+ {\romannumeral0\xintiimul {#4}{#2}}%
+ {\romannumeral0\xintiimul {#5}{#1}}%
}%
\def\XINT_fcmp_C #1#2#3%
{%
@@ -1696,7 +1823,7 @@
}%
\def\xintFloatAdd {\romannumeral0\xintfloatadd }%
\def\xintfloatadd #1{\XINT_fladd_chkopt \xintfloat #1\Z }%
-\def\XINTinFloatAdd {\romannumeral-`0\XINTinfloatadd }%
+\def\XINTinFloatAdd {\romannumeral0\XINTinfloatadd }%
\def\XINTinfloatadd #1{\XINT_fladd_chkopt \XINT_inFloat #1\Z }%
\def\XINT_fladd_chkopt #1#2%
{%
@@ -1706,7 +1833,7 @@
}%
\def\XINT_fladd_noopt #1#2\Z #3%
{%
- #1[\XINT_digits]{\XINT_FL_Add {\XINT_digits+2}{#2}{#3}}%
+ #1[\XINTdigits]{\XINT_FL_Add {\XINTdigits+2}{#2}{#3}}%
}%
\def\XINT_fladd_opt #1[\Z #2]#3#4%
{%
@@ -1715,11 +1842,11 @@
\def\XINT_FL_Add #1#2%
{%
\expandafter\XINT_FL_Add_a\expandafter{\the\numexpr #1\expandafter}%
- \expandafter{\romannumeral-`0\XINT_inFloat [#1]{#2}}%
+ \expandafter{\romannumeral0\XINT_inFloat [#1]{#2}}%
}%
\def\XINT_FL_Add_a #1#2#3%
{%
- \expandafter\XINT_FL_Add_b\romannumeral-`0\XINT_inFloat [#1]{#3}#2{#1}%
+ \expandafter\XINT_FL_Add_b\romannumeral0\XINT_inFloat [#1]{#3}#2{#1}%
}%
\def\XINT_FL_Add_b #1%
{%
@@ -1743,7 +1870,7 @@
\def\XINT_FL_Add_zerobis 0\XINT_FL_Add_d #1[#2]0[0]#3{#1[#2]}%
\def\xintFloatSub {\romannumeral0\xintfloatsub }%
\def\xintfloatsub #1{\XINT_flsub_chkopt \xintfloat #1\Z }%
-\def\XINTinFloatSub {\romannumeral-`0\XINTinfloatsub }%
+\def\XINTinFloatSub {\romannumeral0\XINTinfloatsub }%
\def\XINTinfloatsub #1{\XINT_flsub_chkopt \XINT_inFloat #1\Z }%
\def\XINT_flsub_chkopt #1#2%
{%
@@ -1753,7 +1880,7 @@
}%
\def\XINT_flsub_noopt #1#2\Z #3%
{%
- #1[\XINT_digits]{\XINT_FL_Add {\XINT_digits+2}{#2}{\xintOpp{#3}}}%
+ #1[\XINTdigits]{\XINT_FL_Add {\XINTdigits+2}{#2}{\xintOpp{#3}}}%
}%
\def\XINT_flsub_opt #1[\Z #2]#3#4%
{%
@@ -1761,7 +1888,7 @@
}%
\def\xintFloatMul {\romannumeral0\xintfloatmul}%
\def\xintfloatmul #1{\XINT_flmul_chkopt \xintfloat #1\Z }%
-\def\XINTinFloatMul {\romannumeral-`0\XINTinfloatmul }%
+\def\XINTinFloatMul {\romannumeral0\XINTinfloatmul }%
\def\XINTinfloatmul #1{\XINT_flmul_chkopt \XINT_inFloat #1\Z }%
\def\XINT_flmul_chkopt #1#2%
{%
@@ -1771,7 +1898,7 @@
}%
\def\XINT_flmul_noopt #1#2\Z #3%
{%
- #1[\XINT_digits]{\XINT_FL_Mul {\XINT_digits+2}{#2}{#3}}%
+ #1[\XINTdigits]{\XINT_FL_Mul {\XINTdigits+2}{#2}{#3}}%
}%
\def\XINT_flmul_opt #1[\Z #2]#3#4%
{%
@@ -1780,16 +1907,16 @@
\def\XINT_FL_Mul #1#2%
{%
\expandafter\XINT_FL_Mul_a\expandafter{\the\numexpr #1\expandafter}%
- \expandafter{\romannumeral-`0\XINT_inFloat [#1]{#2}}%
+ \expandafter{\romannumeral0\XINT_inFloat [#1]{#2}}%
}%
\def\XINT_FL_Mul_a #1#2#3%
{%
- \expandafter\XINT_FL_Mul_b\romannumeral-`0\XINT_inFloat [#1]{#3}#2%
+ \expandafter\XINT_FL_Mul_b\romannumeral0\XINT_inFloat [#1]{#3}#2%
}%
-\def\XINT_FL_Mul_b #1[#2]#3[#4]{\xintE{\xintiMul {#1}{#3}}{#2+#4}}%
+\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 {\romannumeral-`0\XINTinfloatdiv }%
+\def\XINTinFloatDiv {\romannumeral0\XINTinfloatdiv }%
\def\XINTinfloatdiv #1{\XINT_fldiv_chkopt \XINT_inFloat #1\Z }%
\def\XINT_fldiv_chkopt #1#2%
{%
@@ -1799,7 +1926,7 @@
}%
\def\XINT_fldiv_noopt #1#2\Z #3%
{%
- #1[\XINT_digits]{\XINT_FL_Div {\XINT_digits+2}{#2}{#3}}%
+ #1[\XINTdigits]{\XINT_FL_Div {\XINTdigits+2}{#2}{#3}}%
}%
\def\XINT_fldiv_opt #1[\Z #2]#3#4%
{%
@@ -1808,16 +1935,56 @@
\def\XINT_FL_Div #1#2%
{%
\expandafter\XINT_FL_Div_a\expandafter{\the\numexpr #1\expandafter}%
- \expandafter{\romannumeral-`0\XINT_inFloat [#1]{#2}}%
+ \expandafter{\romannumeral0\XINT_inFloat [#1]{#2}}%
}%
\def\XINT_FL_Div_a #1#2#3%
{%
- \expandafter\XINT_FL_Div_b\romannumeral-`0\XINT_inFloat [#1]{#3}#2%
+ \expandafter\XINT_FL_Div_b\romannumeral0\XINT_inFloat [#1]{#3}#2%
}%
\def\XINT_FL_Div_b #1[#2]#3[#4]{\xintE{#3/#1}{#4-#2}}%
+\def\xintFloatSum {\romannumeral0\xintfloatsum }%
+\def\xintfloatsum #1{\expandafter\XINT_floatsum_a\romannumeral-`0#1\relax }%
+\def\XINT_floatsum_a #1{\expandafter\XINT_floatsum_b
+ \romannumeral0\xintraw{#1}\Z }% normalizes if only 1
+\def\XINT_floatsum_b #1\Z #2% but a bit wasteful
+ {\expandafter\XINT_floatsum_c\romannumeral-`0#2\Z {#1}\Z}%
+\def\XINT_floatsum_c #1%
+ {\xint_gob_til_relax #1\XINT_floatsum_e\relax\XINT_floatsum_d #1}%
+\def\XINT_floatsum_d #1\Z
+ {\expandafter\XINT_floatsum_b\romannumeral0\XINTinfloatadd {#1}}%
+\def\XINT_floatsum_e #1\Z #2\Z { #2}%
+\def\xintFloatSum: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_floatsum:_e
+ \else\expandafter\XINT_floatsum:_d\fi #1}%
+\def\XINT_floatsum:_d #1,#2{\expandafter\XINT_floatsum:_b\expandafter
+ {\romannumeral0\XINTinfloatadd {#2}{#1}}}%
+\def\XINT_floatsum:_e ,#1#2^{#1}% allows empty list
+\def\xintFloatPrd {\romannumeral0\xintfloatprd }%
+\def\xintfloatprd #1{\expandafter\XINT_floatprd_a\romannumeral-`0#1\relax }%
+\def\XINT_floatprd_a #1{\expandafter\XINT_floatprd_b
+ \romannumeral0\xintraw{#1}\Z }%
+\def\XINT_floatprd_b #1\Z #2%
+ {\expandafter\XINT_floatprd_c\romannumeral-`0#2\Z {#1}\Z}%
+\def\XINT_floatprd_c #1%
+ {\xint_gob_til_relax #1\XINT_floatprd_e\relax\XINT_floatprd_d #1}%
+\def\XINT_floatprd_d #1\Z
+ {\expandafter\XINT_floatprd_b\romannumeral0\XINTinfloatmul {#1}}%
+\def\XINT_floatprd_e #1\Z #2\Z { #2}%
+\def\xintFloatPrd: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_floatprd:_e
+ \else\expandafter\XINT_floatprd:_d\fi #1}%
+\def\XINT_floatprd:_d #1,#2{\expandafter\XINT_floatprd:_b\expandafter
+ {\romannumeral0\XINTinfloatmul {#2}{#1}}}%
+\def\XINT_floatprd:_e ,#1#2^{#1}% allows empty list
\def\xintFloatPow {\romannumeral0\xintfloatpow}%
\def\xintfloatpow #1{\XINT_flpow_chkopt \xintfloat #1\Z }%
-\def\XINTinFloatPow {\romannumeral-`0\XINTinfloatpow }%
+\def\XINTinFloatPow {\romannumeral0\XINTinfloatpow }%
\def\XINTinfloatpow #1{\XINT_flpow_chkopt \XINT_inFloat #1\Z }%
\def\XINT_flpow_chkopt #1#2%
{%
@@ -1830,7 +1997,7 @@
{%
\expandafter\XINT_flpow_checkB_start\expandafter
{\the\numexpr #3\expandafter}\expandafter
- {\the\numexpr \XINT_digits}{#2}{#1[\XINT_digits]}%
+ {\the\numexpr \XINTdigits}{#2}{#1[\XINTdigits]}%
}%
\def\XINT_flpow_opt #1[\Z #2]#3#4%
{%
@@ -1862,7 +2029,7 @@
\def\XINT_flpow_checkB_d #1#2#3#4%
{%
\expandafter \XINT_flpow_a
- \romannumeral-`0\XINT_inFloat [#1]{#4}{#1}{#2}#3%
+ \romannumeral0\XINT_inFloat [#1]{#4}{#1}{#2}#3%
}%
\def\XINT_flpow_a #1%
{%
@@ -1897,7 +2064,7 @@
\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{\romannumeral-`0\XINTinfloatmul [#1]{#3}{#3}}}%
+ \expandafter{\romannumeral0\XINTinfloatmul [#1]{#3}{#3}}}%
\fi
{#1}{{#3}}%
}%
@@ -1931,7 +2098,7 @@
\def\XINT_flpow_prd_compute #1\Z #2#3%
{%
\expandafter\XINT_flpow_prd_getnext\expandafter
- {\romannumeral-`0\XINTinfloatmul [#3]{#1}{#2}}{#3}%
+ {\romannumeral0\XINTinfloatmul [#3]{#1}{#2}}{#3}%
}%
\def\XINT_flpow_prd_end\relax\XINT_flpow_prd_compute
\relax\Z #1#2#3%
@@ -1956,7 +2123,7 @@
}%
\def\xintFloatPower {\romannumeral0\xintfloatpower}%
\def\xintfloatpower #1{\XINT_flpower_chkopt \xintfloat #1\Z }%
-\def\XINTinFloatPower {\romannumeral-`0\XINTinfloatpower}%
+\def\XINTinFloatPower {\romannumeral0\XINTinfloatpower}%
\def\XINTinfloatpower #1{\XINT_flpower_chkopt \XINT_inFloat #1\Z }%
\def\XINT_flpower_chkopt #1#2%
{%
@@ -1968,8 +2135,8 @@
\def\XINT_flpower_noopt #1#2\Z #3%
{%
\expandafter\XINT_flpower_checkB_start\expandafter
- {\the\numexpr \XINT_digits\expandafter}\expandafter
- {\romannumeral0\xintnum{#3}}{#2}{#1[\XINT_digits]}%
+ {\the\numexpr \XINTdigits\expandafter}\expandafter
+ {\romannumeral0\xintnum{#3}}{#2}{#1[\XINTdigits]}%
}%
\def\XINT_flpower_opt #1[\Z #2]#3#4%
{%
@@ -2001,7 +2168,7 @@
\def\XINT_flpower_checkB_d #1#2#3#4%
{%
\expandafter \XINT_flpower_a
- \romannumeral-`0\XINT_inFloat [#1]{#4}{#1}{#2}#3%
+ \romannumeral0\XINT_inFloat [#1]{#4}{#1}{#2}#3%
}%
\def\XINT_flpower_a #1%
{%
@@ -2033,7 +2200,7 @@
{%
\ifcase\XINT_isOne {#2}
\xint_afterfi{\expandafter\XINT_flpower_loop_x\expandafter
- {\romannumeral-`0\XINTinfloatmul [#1]{#3}{#3}}%
+ {\romannumeral0\XINTinfloatmul [#1]{#3}{#3}}%
{\romannumeral0\xintdivision {#2}{2}}}%
\or \expandafter\XINT_flpow_loop_end
\fi
@@ -2055,7 +2222,7 @@
}%
\def\xintFloatSqrt {\romannumeral0\xintfloatsqrt }%
\def\xintfloatsqrt #1{\XINT_flsqrt_chkopt \xintfloat #1\Z }%
-\def\XINTinFloatSqrt {\romannumeral-`0\XINTinfloatsqrt }%
+\def\XINTinFloatSqrt {\romannumeral0\XINTinfloatsqrt }%
\def\XINTinfloatsqrt #1{\XINT_flsqrt_chkopt \XINT_inFloat #1\Z }%
\def\XINT_flsqrt_chkopt #1#2%
{%
@@ -2065,7 +2232,7 @@
}%
\def\XINT_flsqrt_noopt #1#2\Z
{%
- #1[\XINT_digits]{\XINT_FL_sqrt \XINT_digits {#2}}%
+ #1[\XINTdigits]{\XINT_FL_sqrt \XINTdigits {#2}}%
}%
\def\XINT_flsqrt_opt #1[\Z #2]#3%
{%
@@ -2082,7 +2249,7 @@
\def\XINT_FL_sqrt_a #1#2%
{%
\expandafter\XINT_FL_sqrt_checkifzeroorneg
- \romannumeral-`0\XINT_inFloat [#1]{#2}%
+ \romannumeral0\XINT_inFloat [#1]{#2}%
}%
\def\XINT_FL_sqrt_checkifzeroorneg #1%
{%
@@ -2182,14 +2349,14 @@
\def\XINT_flsqrt_big_f #1%
{%
\expandafter\XINT_flsqrt_big_fa\expandafter
- {\romannumeral0\xintisqr {#1}}{#1}%
+ {\romannumeral0\xintiisqr {#1}}{#1}%
}%
\def\XINT_flsqrt_big_fa #1#2#3#4%
{%
\expandafter\XINT_flsqrt_big_fb\expandafter
- {\romannumeral-`0\XINT_dsx_addzerosnofuss
+ {\romannumeral0\XINT_dsx_addzerosnofuss
{\numexpr #3-\xint_c_viii\relax}{#2}}%
- {\romannumeral0\xintisub
+ {\romannumeral0\xintiisub
{\XINT_dsx_addzerosnofuss
{\numexpr \xint_c_ii*(#3-\xint_c_viii)\relax}{#1}}{#4}}%
{#3}%
@@ -2215,7 +2382,7 @@
{%
\expandafter\XINT_flsqrt_big_l\expandafter
{\romannumeral0\XINT_sub_pre {#3}{#1}}%
- {\romannumeral0\xintiadd {#2}{\romannumeral0\XINT_sqr {#1}}}%
+ {\romannumeral0\xintiiadd {#2}{\romannumeral0\XINT_sqr {#1}}}%
}%
\def\XINT_flsqrt_big_l #1#2%
{%
@@ -2226,7 +2393,7 @@
{%
\expandafter\XINT_flsqrt_big_end_b\expandafter
{\the\numexpr -#4+#5/\xint_c_ii\expandafter}\expandafter
- {\romannumeral0\xintisub
+ {\romannumeral0\xintiisub
{\XINT_dsx_addzerosnofuss {#4}{#3}}%
{\xintHalf{\xintiQuo{\XINT_dsx_addzerosnofuss {#4}{#2}}{#3}}}}%
}%