summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/xint/xintfrac.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2015-10-11 21:21:00 +0000
committerKarl Berry <karl@freefriends.org>2015-10-11 21:21:00 +0000
commitc42b50b291d00f547400888b81ef4d2bcad45142 (patch)
tree9ab2f5792d7627887e9f858a103ba1c7de329a67 /Master/texmf-dist/tex/generic/xint/xintfrac.sty
parentced6522f86e501ede0097c2b6362bc17603b6eef (diff)
xint (11oct15)
git-svn-id: svn://tug.org/texlive/trunk@38612 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.sty604
1 files changed, 452 insertions, 152 deletions
diff --git a/Master/texmf-dist/tex/generic/xint/xintfrac.sty b/Master/texmf-dist/tex/generic/xint/xintfrac.sty
index f0e50614e0d..59030c1e9be 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 v1.1c 2015/09/12
+%% The xint bundle v1.2 2015/10/10
%% Copyright (C) 2013-2015 by Jean-Francois Burnol
%% xintfrac: Expandable operations on fractions
%% ---------------------------------------------------------------
@@ -70,8 +70,7 @@
\XINTsetupcatcodes% defined in xintkernel.sty
\XINT_providespackage
\ProvidesPackage{xintfrac}%
- [2015/09/12 v1.1c Expandable operations on fractions (jfB)]%
-\chardef\xint_c_xviii 18
+ [2015/10/10 v1.2 Expandable operations on fractions (jfB)]%
\def\XINT_cntSgnFork #1%
{%
\ifcase #1\expandafter\xint_secondofthree
@@ -150,126 +149,132 @@
\def\XINT_inFrac {\romannumeral0\XINT_infrac }%
\def\XINT_infrac #1%
{%
- \expandafter\XINT_infrac_ \romannumeral-`0#1[\W]\Z\T
+ \expandafter\XINT_infrac_fork\romannumeral-`0#1/\XINT_W[\XINT_W\XINT_T
}%
-\def\XINT_infrac_ #1[#2#3]#4\Z
+\def\XINT_infrac_fork #1[#2%
{%
- \xint_UDwfork
- #2\XINT_infrac_A
- \W\XINT_infrac_B
+ \xint_UDXINTWfork
+ #2\XINT_frac_gen
+ \XINT_W\XINT_infrac_res_a % strict A[N] or A/B[N] input
\krof
- #1[#2#3]#4%
+ #1[#2%
}%
-\def\XINT_infrac_A #1[\W]\T
+\def\XINT_infrac_res_a #1%
{%
- \XINT_frac #1/\W\Z
+ \xint_gob_til_zero #1\XINT_infrac_res_zero 0\XINT_infrac_res_b #1%
}%
-\def\XINT_infrac_B #1%
+\def\XINT_infrac_res_zero 0\XINT_infrac_res_b #1\XINT_T {{0}{0}{1}}%
+\def\XINT_infrac_res_b #1/#2%
{%
- \xint_gob_til_zero #1\XINT_infrac_Zero0\XINT_infrac_BB #1%
-}%
-\def\XINT_infrac_BB #1[\W]\T {\XINT_infrac_BC #1/\W\Z }%
-\def\XINT_infrac_BC #1/#2#3\Z
-{%
- \xint_UDwfork
- #2\XINT_infrac_BCa
- \W{\expandafter\XINT_infrac_BCb \romannumeral-`0#2}%
+ \xint_UDXINTWfork
+ #2\XINT_infrac_res_ca
+ \XINT_W\XINT_infrac_res_cb
\krof
- #3\Z #1\Z
-}%
-\def\XINT_infrac_BCa \Z #1[#2]#3\Z { {#2}{#1}{1}}%
-\def\XINT_infrac_BCb #1[#2]/\W\Z #3\Z { {#2}{#3}{#1}}%
-\def\XINT_infrac_Zero #1\T { {0}{0}{1}}%
-\def\XINT_frac #1/#2#3\Z
-{%
- \xint_UDwfork
- #2\XINT_frac_A
- \W{\expandafter\XINT_frac_U \romannumeral-`0#2}%
+ #1/#2%
+}%
+\def\XINT_infrac_res_ca #1[#2]/\XINT_W[\XINT_W\XINT_T
+ {\expandafter{\the\numexpr 0#2}{#1}{1}}%
+\def\XINT_infrac_res_cb #1/#2[%
+ {\expandafter\XINT_infrac_res_cc\romannumeral-`0#2~#1[}%
+\def\XINT_infrac_res_cc #1~#2[#3]/\XINT_W[\XINT_W\XINT_T
+ {\expandafter{\the\numexpr 0#3}{#2}{#1}}%
+\def\XINT_frac_gen #1/#2%
+{%
+ \xint_UDXINTWfork
+ #2\XINT_frac_gen_A
+ \XINT_W\XINT_frac_gen_B
\krof
- #3e\W\Z #1e\W\Z
+ #1/#2%
}%
-\def\XINT_frac_U #1e#2#3\Z
+\def\XINT_frac_gen_A #1/\XINT_W [\XINT_W {\XINT_frac_gen_C 0~1!#1ee.\XINT_W }%
+\def\XINT_frac_gen_B #1/#2/\XINT_W[%\XINT_W
{%
- \xint_UDwfork
- #2\XINT_frac_Ua
- \W{\XINT_frac_Ub #2}%
- \krof
- #3\Z #1\Z
+ \expandafter\XINT_frac_gen_Ba
+ \romannumeral-`0#2ee.\XINT_W\XINT_Z #1ee.%\XINT_W
}%
-\def\XINT_frac_Ua \Z #1/\W\Z {\XINT_frac_B #1.\W\Z {0}}%
-\def\XINT_frac_Ub #1/\W e\W\Z #2\Z {\XINT_frac_B #2.\W\Z {#1}}%
-\def\XINT_frac_B #1.#2#3\Z
+\def\XINT_frac_gen_Ba #1.#2%
{%
- \xint_UDwfork
- #2\XINT_frac_Ba
- \W{\XINT_frac_Bb #2}%
+ \xint_UDXINTWfork
+ #2\XINT_frac_gen_Bb
+ \XINT_W\XINT_frac_gen_Bc
\krof
- #3\Z #1\Z
+ #1.#2%
}%
-\def\XINT_frac_Ba \Z #1\Z {\XINT_frac_T {0}{#1}}%
-\def\XINT_frac_Bb #1.\W\Z #2\Z
+\def\XINT_frac_gen_Bb #1e#2e#3\XINT_Z
+ {\expandafter\XINT_frac_gen_C\the\numexpr 0#2~#1!}%
+\def\XINT_frac_gen_Bc #1.#2e%
{%
- \expandafter \XINT_frac_T \expandafter
- {\romannumeral0\xintlength {#1}}{#2#1}%
+ \expandafter\XINT_frac_gen_Bd\romannumeral-`0#2.#1e%
}%
-\def\XINT_frac_A e\W\Z {\XINT_frac_T {0}{1}{0}}%
-\def\XINT_frac_T #1#2#3#4e#5#6\Z
+\def\XINT_frac_gen_Bd #1.#2e#3e#4\XINT_Z
{%
- \xint_UDwfork
- #5\XINT_frac_Ta
- \W{\XINT_frac_Tb #5}%
- \krof
- #6\Z #4\Z {#1}{#2}{#3}%
+ \expandafter\XINT_frac_gen_C\the\numexpr 0#3-\romannumeral0\expandafter
+ \XINT_length_loop
+ 0.#1\xint_relax\xint_relax\xint_relax\xint_relax
+ \xint_relax\xint_relax\xint_relax\xint_relax\xint_bye~#2#1!%
}%
-\def\XINT_frac_Ta \Z #1\Z {\XINT_frac_C #1.\W\Z {0}}%
-\def\XINT_frac_Tb #1e\W\Z #2\Z {\XINT_frac_C #2.\W\Z {#1}}%
-\def\XINT_frac_C #1.#2#3\Z
+\def\XINT_frac_gen_C #1!#2.#3%
{%
- \xint_UDwfork
- #2\XINT_frac_Ca
- \W{\XINT_frac_Cb #2}%
+ \xint_UDXINTWfork
+ #3\XINT_frac_gen_Ca
+ \XINT_W\XINT_frac_gen_Cb
\krof
- #3\Z #1\Z
+ #1!#2.#3%
}%
-\def\XINT_frac_Ca \Z #1\Z {\XINT_frac_D {0}{#1}}%
-\def\XINT_frac_Cb #1.\W\Z #2\Z
+\def\XINT_frac_gen_Ca #1~#2!#3e#4e#5\XINT_T
{%
- \expandafter\XINT_frac_D\expandafter
- {\romannumeral0\xintlength {#1}}{#2#1}%
+ \expandafter\XINT_frac_gen_F\the\numexpr #4-#1\expandafter
+ ~\romannumeral0\XINT_num_loop
+ #2\xint_relax\xint_relax\xint_relax\xint_relax
+ \xint_relax\xint_relax\xint_relax\xint_relax\Z~#3~%
}%
-\def\XINT_frac_D #1#2#3#4#5#6%
+\def\XINT_frac_gen_Cb #1.#2e%
{%
- \expandafter \XINT_frac_E \expandafter
- {\the\numexpr -#1+#3+#4-#6\expandafter}\expandafter
- {\romannumeral0\XINT_num_loop #2%
- \xint_relax\xint_relax\xint_relax\xint_relax
- \xint_relax\xint_relax\xint_relax\xint_relax\Z }%
- {\romannumeral0\XINT_num_loop #5%
- \xint_relax\xint_relax\xint_relax\xint_relax
- \xint_relax\xint_relax\xint_relax\xint_relax\Z }%
+ \expandafter\XINT_frac_gen_Cc\romannumeral-`0#2.#1e%
}%
-\def\XINT_frac_E #1#2#3%
+\def\XINT_frac_gen_Cc #1.#2~#3!#4e#5e#6\XINT_T
{%
- \expandafter \XINT_frac_F #3\Z {#2}{#1}%
+ \expandafter\XINT_frac_gen_F\the\numexpr #5-#2-%
+ \romannumeral0\XINT_length_loop
+ 0.#1\xint_relax\xint_relax\xint_relax\xint_relax
+ \xint_relax\xint_relax\xint_relax\xint_relax\xint_bye\expandafter
+ ~\romannumeral0\XINT_num_loop
+ #3\xint_relax\xint_relax\xint_relax\xint_relax
+ \xint_relax\xint_relax\xint_relax\xint_relax\Z
+ ~#4#1~%
}%
-\def\XINT_frac_F #1%
+\def\XINT_frac_gen_F #1~#2%
{%
\xint_UDzerominusfork
- #1-\XINT_frac_Gdivisionbyzero
- 0#1\XINT_frac_Gneg
- 0-{\XINT_frac_Gpos #1}%
- \krof
+ #2-\XINT_frac_gen_Gdivbyzero
+ 0#2{\XINT_frac_gen_G -{}}%
+ 0-{\XINT_frac_gen_G {}#2}%
+ \krof #1~%
}%
-\edef\XINT_frac_Gdivisionbyzero #1\Z #2#3%
+\def\XINT_frac_gen_Gdivbyzero #1~~#2~%
{%
- \noexpand\xintError:DivisionByZero\space {0}{#2}{0}%
+ \expandafter\XINT_frac_gen_Gdivbyzero_a
+ \romannumeral0\XINT_num_loop
+ #2\xint_relax\xint_relax\xint_relax\xint_relax
+ \xint_relax\xint_relax\xint_relax\xint_relax\Z~#1~%
}%
-\def\XINT_frac_Gneg #1\Z #2#3%
+\def\XINT_frac_gen_Gdivbyzero_a #1~#2~%
{%
- \expandafter\XINT_frac_H \expandafter{\romannumeral0\XINT_opp #2}{#3}{#1}%
+ \xintError:DivisionByZero {#2}{#1}{0}%
}%
-\def\XINT_frac_H #1#2{ {#2}{#1}}%
-\def\XINT_frac_Gpos #1\Z #2#3{ {#3}{#2}{#1}}%
+\def\XINT_frac_gen_G #1#2#3~#4~#5~%
+{%
+ \expandafter\XINT_frac_gen_Ga
+ \romannumeral0\XINT_num_loop
+ #1#5\xint_relax\xint_relax\xint_relax\xint_relax
+ \xint_relax\xint_relax\xint_relax\xint_relax\Z~#3~{#2#4}%
+}%
+\def\XINT_frac_gen_Ga #1#2~#3~%
+{%
+ \xint_gob_til_zero #1\XINT_frac_gen_zero 0%
+ {#3}{#1#2}%
+}%
+\def\XINT_frac_gen_zero 0#1#2#3{{0}{0}{1}}%
\def\XINT_factortens #1%
{%
\expandafter\XINT_cuz_cnt_loop\expandafter
@@ -363,6 +368,96 @@
\xint_bye\xint_bye\xint_bye\xint_bye
\xint_relax }{#1}%
}%
+\def\XINT_addm_A #1#2#3#4#5#6%
+{%
+ \xint_gob_til_W #3\xint_addm_az\W
+ \XINT_addm_AB #1{#3#4#5#6}{#2}%
+}%
+\def\xint_addm_az\W\XINT_addm_AB #1#2%
+{%
+ \XINT_addm_AC_checkcarry #1%
+}%
+\def\XINT_addm_AB #1#2#3#4\W\X\Y\Z #5#6#7#8%
+{%
+ \XINT_addm_ABE #1#2{#8#7#6#5}{#3}#4\W\X\Y\Z
+}%
+\def\XINT_addm_ABE #1#2#3#4#5#6%
+{%
+ \expandafter\XINT_addm_ABEA\the\numexpr #1+10#5#4#3#2+#6.%
+}%
+\def\XINT_addm_ABEA #1#2#3.#4%
+{%
+ \XINT_addm_A #2{#3#4}%
+}%
+\def\XINT_addm_AC_checkcarry #1%
+{%
+ \xint_gob_til_zero #1\xint_addm_AC_nocarry 0\XINT_addm_C
+}%
+\def\xint_addm_AC_nocarry 0\XINT_addm_C #1#2\W\X\Y\Z
+{%
+ \expandafter
+ \xint_cleanupzeros_andstop
+ \romannumeral0%
+ \XINT_rord_main {}#2%
+ \xint_relax
+ \xint_bye\xint_bye\xint_bye\xint_bye
+ \xint_bye\xint_bye\xint_bye\xint_bye
+ \xint_relax
+ #1%
+}%
+\def\XINT_addm_C #1#2#3#4#5%
+{%
+ \xint_gob_til_W
+ #5\xint_addm_cw
+ #4\xint_addm_cx
+ #3\xint_addm_cy
+ #2\xint_addm_cz
+ \W\XINT_addm_CD {#5#4#3#2}{#1}%
+}%
+\def\XINT_addm_CD #1%
+{%
+ \expandafter\XINT_addm_CC\the\numexpr 1+10#1.%
+}%
+\def\XINT_addm_CC #1#2#3.#4%
+{%
+ \XINT_addm_AC_checkcarry #2{#3#4}%
+}%
+\def\xint_addm_cw
+ #1\xint_addm_cx
+ #2\xint_addm_cy
+ #3\xint_addm_cz
+ \W\XINT_addm_CD
+{%
+ \expandafter\XINT_addm_CDw\the\numexpr 1+#1#2#3.%
+}%
+\def\XINT_addm_CDw #1.#2#3\X\Y\Z
+{%
+ \XINT_addm_end #1#3%
+}%
+\def\xint_addm_cx
+ #1\xint_addm_cy
+ #2\xint_addm_cz
+ \W\XINT_addm_CD
+{%
+ \expandafter\XINT_addm_CDx\the\numexpr 1+#1#2.%
+}%
+\def\XINT_addm_CDx #1.#2#3\Y\Z
+{%
+ \XINT_addm_end #1#3%
+}%
+\def\xint_addm_cy
+ #1\xint_addm_cz
+ \W\XINT_addm_CD
+{%
+ \expandafter\XINT_addm_CDy\the\numexpr 1+#1.%
+}%
+\def\XINT_addm_CDy #1.#2#3\Z
+{%
+ \XINT_addm_end #1#3%
+}%
+\def\xint_addm_cz\W\XINT_addm_CD #1#2#3{\XINT_addm_end #1#3}%
+\edef\XINT_addm_end #1#2#3#4#5%
+ {\noexpand\expandafter\space\noexpand\the\numexpr #1#2#3#4#5\relax}%
\def\xintRaw {\romannumeral0\xintraw }%
\def\xintraw
{%
@@ -736,8 +831,8 @@
\def\XINT_jrr_loop_b #1#2#3#4#5#6#7%
{%
\expandafter \XINT_jrr_loop_c \expandafter
- {\romannumeral0\xintiiadd{\XINT_Mul{#4}{#1}}{#6}}%
- {\romannumeral0\xintiiadd{\XINT_Mul{#5}{#1}}{#7}}%
+ {\romannumeral0\xintiiadd{\XINT_mul_fork #4\Z #1\Z}{#6}}%
+ {\romannumeral0\xintiiadd{\XINT_mul_fork #5\Z #1\Z}{#7}}%
{#2}{#3}{#4}{#5}%
}%
\def\XINT_jrr_loop_c #1#2%
@@ -1058,33 +1153,7 @@
\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
@@ -1104,48 +1173,76 @@
0000000000000000000000000000000000000000000000000000000000000000%
\repeat
}%
-\def\XINT_xtrunc_prepareB_PaBa #1#2%
+%%%%%%%%%%%%
+\def\XINT_xtrunc_Q #1%
+{%
+ \expandafter\XINT_xtrunc_prepare
+ \romannumeral0\XINT_dsx_zeroloop {#1}{}\Z
+}%
+\def\XINT_xtrunc_prepare #1.#2#3%
{%
\expandafter\XINT_xtrunc_Pa\expandafter
- {\romannumeral0\XINT_xtrunc_prepareB_a {#1}{#2}}%
+ {\romannumeral0%
+ \XINT_xtrunc_prepare_a #2\R\R\R\R\R\R\R\R {10}0000001\W !{#2}}{#1}%
}%
-\def\XINT_xtrunc_prepareB_a #1%
+%%%%%%%%%%%%
+\def\XINT_xtrunc_prepare_a #1#2#3#4#5#6#7#8#9%
{%
- \expandafter\XINT_xtrunc_prepareB_c\expandafter
- {\the\numexpr \xint_c_iv*((#1+\xint_c_i)/\xint_c_iv)}{#1}%
+ \xint_gob_til_R #9\XINT_xtrunc_prepare_small\R
+ \XINT_xtrunc_prepare_b #9%
}%
-\def\XINT_xtrunc_prepareB_c #1#2%
+\def\XINT_xtrunc_prepare_small\R #1!#2%
{%
- \csname XINT_xtrunc_prepareB_d\romannumeral\numexpr#1-#2\endcsname
- {#1}%
+ \ifcase #2
+ \or\xint_afterfi{ \XINT_div_BisOne}%
+ \or\xint_afterfi{ \XINT_div_BisTwo}%
+ \else\expandafter\XINT_xtrunc_small_aa
+ \fi {#2}%
}%
-\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%
+\def\XINT_xtrunc_small_aa #1%
{%
- \expandafter\XINT_xtrunc_Pa\expandafter
- {\romannumeral0\XINT_xtrunc_prepareB_e {#1}{#2}{#3}{#4}}%
+ \expandafter\space\expandafter\XINT_xtrunc_small_a
+ \the\numexpr #1/\xint_c_ii\expandafter
+ .\the\numexpr \xint_c_x^viii+#1!%
}%
-\def\XINT_xtrunc_prepareB_e #1#2#3#4%
+%%%%%%%%%%%%
+\def\XINT_xtrunc_small_a #1.#2!#3%
{%
- \ifnum#3=\xint_c_iv\expandafter\XINT_xtrunc_prepareLittleB_f
- \else\expandafter\XINT_xtrunc_prepareB_f
- \fi
- #4#1{#3}{#2}{#1}%
+ \expandafter\XINT_div_small_b\the\numexpr #1\expandafter
+ .\the\numexpr #2\expandafter!%
+ \romannumeral0\XINT_div_small_ba #3\R\R\R\R\R\R\R\R{10}0000001\W
+ #3\XINT_sepbyviii_Z_end 2345678\relax
}%
-\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_prepare_b
+ {\expandafter\XINT_xtrunc_prepare_c\romannumeral0\XINT_zeroes_forviii }%
+\def\XINT_xtrunc_prepare_c #1!%
+{%
+ \XINT_xtrunc_prepare_d #1.00000000!{#1}%
}%
-\def\XINT_xtrunc_prepareLittleB_f #1#{%
- \expandafter\space\expandafter
- \XINT_div_prepareB_g \the\numexpr #1/\xint_c_ii.{}.{}.{#1}%
+\def\XINT_xtrunc_prepare_d #1#2#3#4#5#6#7#8#9%
+{%
+ \expandafter\XINT_xtrunc_prepare_e\xint_gob_til_dot #1#2#3#4#5#6#7#8#9!%
}%
+\def\XINT_xtrunc_prepare_e #1!#2!#3#4%
+{%
+ \XINT_xtrunc_prepare_f #4#3\X {#1}{#3}%
+}%
+\def\XINT_xtrunc_prepare_f #1#2#3#4#5#6#7#8#9\X
+{%
+ \expandafter\space\expandafter\XINT_div_prepare_g
+ \the\numexpr #1#2#3#4#5#6#7#8+\xint_c_i\expandafter
+ .\the\numexpr (#1#2#3#4#5#6#7#8+\xint_c_i)/\xint_c_ii\expandafter
+ .\the\numexpr #1#2#3#4#5#6#7#8\expandafter
+ .\romannumeral0\XINT_sepandrev_andcount
+ #1#2#3#4#5#6#7#8#9\XINT_rsepbyviii_end_A 2345678%
+ \XINT_rsepbyviii_end_B 2345678%
+ \relax\xint_c_ii\xint_c_iii
+ \R.\xint_c_vi\R.\xint_c_v\R.\xint_c_iv\R.\xint_c_iii
+ \R.\xint_c_ii\R.\xint_c_i\R.\xint_c_\W
+ \X
+}%
+%%%%%%%%%%%%
\def\XINT_xtrunc_Pa #1#2%
{%
\expandafter\XINT_xtrunc_Pb\romannumeral0#1{#2}{#1}%
@@ -1540,7 +1637,7 @@
}%
\def\XINT_fadd_C #1#2#3%
{%
- \ifcase\romannumeral0\XINT_cmp_pre {#2}{#3} %<- intentional space here.
+ \ifcase\romannumeral0\xintiicmp {#2}{#3} %<- intentional space here.
\expandafter\XINT_fadd_eq
\or\expandafter\XINT_fadd_D
\else\expandafter\XINT_fadd_Da
@@ -2000,10 +2097,10 @@
\expandafter\XINT_fcmp_Fe\expandafter
{\romannumeral0\XINT_dsx_addzerosnofuss {#1}{#3}}{#2}%
}%
-\def\XINT_fcmp_Fe #1#2{\XINT_cmp_pre {#2}{#1}}%
+\def\XINT_fcmp_Fe #1#2{\xintiicmp {#2}{#1}}%
\def\XINT_fcmp_Fn #1\Z #2#3%
{%
- \expandafter\XINT_cmp_pre\expandafter
+ \expandafter\xintiicmp\expandafter
{\romannumeral0\XINT_dsx_addzerosnofuss {#1}{#2}}{#3}%
}%
\def\xintAbs {\romannumeral0\xintabs }%
@@ -2391,6 +2488,209 @@
\fi\expandafter\XINT_flpow_III\the\numexpr #6\expandafter\relax
#4{#3}{#5}%
}%
+\def\xintFloatFac {\romannumeral0\xintfloatfac}%
+\def\xintfloatfac #1{\XINT_flfac_chkopt \xintfloat #1\xint_relax }%
+\def\XINTinFloatFac {\romannumeral0\XINTinfloatfac }%
+\def\XINTinfloatfac #1{\XINT_flfac_chkopt \XINTinfloat #1\xint_relax }%
+\def\XINT_flfac_chkopt #1#2%
+{%
+ \ifx [#2\expandafter\XINT_flfac_opt
+ \else\expandafter\XINT_flfac_noopt
+ \fi
+ #1#2%
+}%
+\def\XINT_flfac_noopt #1#2\xint_relax
+{%
+ \expandafter\XINT_FL_fac_start\expandafter
+ {\the\numexpr #2}{\XINTdigits}{#1[\XINTdigits]}%
+}%
+\def\XINT_flfac_opt #1[\xint_relax #2]#3%
+{%
+ \expandafter\XINT_FL_fac_start\expandafter
+ {\the\numexpr #3\expandafter}\expandafter{\the\numexpr#2}{#1[#2]}%
+}%
+\def\XINT_FL_fac_start #1%
+{%
+ \ifcase\XINT_cntSgn #1\Z
+ \expandafter\XINT_FL_fac_iszero
+ \or
+ \expandafter\XINT_FL_fac_increaseP
+ \else
+ \expandafter\XINT_FL_fac_isneg
+ \fi {#1}%
+}%
+\def\XINT_FL_fac_iszero #1#2#3{#3{1/1[0]}}%
+\def\XINT_FL_fac_isneg #1#2#3%
+ {\expandafter\xintError:FactorialOfNegativeNumber #3{1/1[0]}}%
+\def\XINT_FL_fac_increaseP #1#2%
+{%
+ \expandafter\XINT_FL_fac_fork
+ \the\numexpr \xint_c_viii*%
+ ((\xint_c_v+#2+\XINT_FL_fac_extradigits #187654321\Z)/\xint_c_viii).%
+ #1.%
+}%
+\def\XINT_FL_fac_extradigits #1#2#3#4#5#6#7#8{\XINT_FL_fac_extra_a }%
+\def\XINT_FL_fac_extra_a #1#2\Z {#1}%
+\def\XINT_FL_fac_fork #1.#2.#3%
+{%
+ \ifnum #2>99999999 \xint_dothis{\XINT_FL_fac_toobig }\fi
+ \ifnum #2>9999 \xint_dothis{\XINT_FL_fac_vbigloop_a }\fi
+ \ifnum #2>465 \xint_dothis{\XINT_FL_fac_bigloop_a }\fi
+ \ifnum #2>101 \xint_dothis{\XINT_FL_fac_medloop_a }\fi
+ \xint_orthat{\XINT_FL_fac_smallloop_a }%
+ #2.#1.{\XINT_FL_fac_out}{#3}%
+}%
+\def\XINT_FL_fac_toobig #1.#2.#3#4%
+ {\expandafter\xintError:FactorialOfTooBigNumber #4{1/1[0]}}%
+\def\XINT_FL_fac_out #1\Z![#2]#3{#3{\romannumeral0\XINT_mul_out
+ #1\Z!1\R!1\R!1\R!1\R!1\R!1\R!1\R!1\R!\W [#2]}}%
+\def\XINT_FL_fac_vbigloop_a #1.#2.%
+{%
+ \XINT_FL_fac_bigloop_a 9999.#2.%
+ {\expandafter\XINT_FL_fac_vbigloop_loop\the\numexpr 100010000\expandafter.%
+ \the\numexpr \xint_c_x^viii+#1.}%
+}%
+\def\XINT_FL_fac_vbigloop_loop #1.#2.%
+{%
+ \ifnum #1>#2 \expandafter\XINT_FL_fac_loop_exit\fi
+ \expandafter\XINT_FL_fac_vbigloop_loop
+ \the\numexpr #1+\xint_c_i\expandafter.%
+ \the\numexpr #2\expandafter.\the\numexpr\XINT_FL_fac_mul #1!%
+}%
+\def\XINT_FL_fac_bigloop_a #1.%
+{%
+ \expandafter\XINT_FL_fac_bigloop_b \the\numexpr
+ #1+\xint_c_i-\xint_c_ii*((#1-464)/\xint_c_ii).#1.%
+}%
+\def\XINT_FL_fac_bigloop_b #1.#2.#3.%
+{%
+ \expandafter\XINT_FL_fac_medloop_a
+ \the\numexpr #1-\xint_c_i.#3.{\XINT_FL_fac_bigloop_loop #1.#2.}%
+}%
+\def\XINT_FL_fac_bigloop_loop #1.#2.%
+{%
+ \ifnum #1>#2 \expandafter\XINT_FL_fac_loop_exit\fi
+ \expandafter\XINT_FL_fac_bigloop_loop
+ \the\numexpr #1+\xint_c_ii\expandafter.%
+ \the\numexpr #2\expandafter.\the\numexpr\XINT_FL_fac_bigloop_mul #1!%
+}%
+\def\XINT_FL_fac_bigloop_mul #1!%
+{%
+ \expandafter\XINT_FL_fac_mul
+ \the\numexpr \xint_c_x^viii+#1*(#1+\xint_c_i)!%
+}%
+\def\XINT_FL_fac_medloop_a #1.%
+{%
+ \expandafter\XINT_FL_fac_medloop_b
+ \the\numexpr #1+\xint_c_i-\xint_c_iii*((#1-100)/\xint_c_iii).#1.%
+}%
+\def\XINT_FL_fac_medloop_b #1.#2.#3.%
+{%
+ \expandafter\XINT_FL_fac_smallloop_a
+ \the\numexpr #1-\xint_c_i.#3.{\XINT_FL_fac_medloop_loop #1.#2.}%
+}%
+\def\XINT_FL_fac_medloop_loop #1.#2.%
+{%
+ \ifnum #1>#2 \expandafter\XINT_FL_fac_loop_exit\fi
+ \expandafter\XINT_FL_fac_medloop_loop
+ \the\numexpr #1+\xint_c_iii\expandafter.%
+ \the\numexpr #2\expandafter.\the\numexpr\XINT_FL_fac_medloop_mul #1!%
+}%
+\def\XINT_FL_fac_medloop_mul #1!%
+{%
+ \expandafter\XINT_FL_fac_mul
+ \the\numexpr
+ \xint_c_x^viii+#1*(#1+\xint_c_i)*(#1+\xint_c_ii)!%
+}%
+\def\XINT_FL_fac_smallloop_a #1.%
+{%
+ \csname
+ XINT_FL_fac_smallloop_\the\numexpr #1-\xint_c_iv*(#1/\xint_c_iv)\relax
+ \endcsname #1.%
+}%
+\expandafter\def\csname XINT_FL_fac_smallloop_1\endcsname #1.#2.%
+{%
+ \XINT_FL_fac_addzeros #2.100000001!.{2.#1.}{#2}%
+}%
+\expandafter\def\csname XINT_FL_fac_smallloop_-2\endcsname #1.#2.%
+{%
+ \XINT_FL_fac_addzeros #2.100000002!.{3.#1.}{#2}%
+}%
+\expandafter\def\csname XINT_FL_fac_smallloop_-1\endcsname #1.#2.%
+{%
+ \XINT_FL_fac_addzeros #2.100000006!.{4.#1.}{#2}%
+}%
+\expandafter\def\csname XINT_FL_fac_smallloop_0\endcsname #1.#2.%
+{%
+ \XINT_FL_fac_addzeros #2.100000024!.{5.#1.}{#2}%
+}%
+\def\XINT_FL_fac_addzeros #1.%
+{%
+ \ifnum #1=\xint_c_viii \expandafter\XINT_FL_fac_addzeros_exit\fi
+ \expandafter\XINT_FL_fac_addzeros\the\numexpr #1-\xint_c_viii.100000000!%
+}%
+\def\XINT_FL_fac_addzeros_exit #1.#2.#3#4%
+ {\XINT_FL_fac_smallloop_loop #3#21\Z![-#4]}%
+\def\XINT_FL_fac_smallloop_loop #1.#2.%
+{%
+ \ifnum #1>#2 \expandafter\XINT_FL_fac_loop_exit\fi
+ \expandafter\XINT_FL_fac_smallloop_loop
+ \the\numexpr #1+\xint_c_iv\expandafter.%
+ \the\numexpr #2\expandafter.\romannumeral0\XINT_FL_fac_smallloop_mul #1!%
+}%
+\def\XINT_FL_fac_smallloop_mul #1!%
+{%
+ \expandafter\XINT_FL_fac_mul
+ \the\numexpr
+ \xint_c_x^viii+#1*(#1+\xint_c_i)*(#1+\xint_c_ii)*(#1+\xint_c_iii)!%
+}%[[
+\def\XINT_FL_fac_loop_exit #1!#2]#3{#3#2]}%
+\def\XINT_FL_fac_mul 1#1!%
+ {\expandafter\XINT_FL_fac_mul_a\the\numexpr\XINT_FL_fac_smallmul 10!{#1}}%
+\def\XINT_FL_fac_mul_a #1-#2%
+{%
+ \if#21\xint_afterfi{\expandafter\space\xint_gob_til_exclam}\else
+ \expandafter\space\fi #11\Z!%
+}%
+\def\XINT_FL_fac_minimulwc_a #1#2#3#4#5!#6#7#8#9%
+{%
+ \XINT_FL_fac_minimulwc_b {#1#2#3#4}{#5}{#6#7#8#9}%
+}%
+\def\XINT_FL_fac_minimulwc_b #1#2#3#4!#5%
+{%
+ \expandafter\XINT_FL_fac_minimulwc_c
+ \the\numexpr \xint_c_x^ix+#5+#2*#4.{{#1}{#2}{#3}{#4}}%
+}%
+\def\XINT_FL_fac_minimulwc_c 1#1#2#3#4#5#6.#7%
+{%
+ \expandafter\XINT_FL_fac_minimulwc_d {#1#2#3#4#5}#7{#6}%
+}%
+\def\XINT_FL_fac_minimulwc_d #1#2#3#4#5%
+{%
+ \expandafter\XINT_FL_fac_minimulwc_e
+ \the\numexpr \xint_c_x^ix+#1+#2*#5+#3*#4.{#2}{#4}%
+}%
+\def\XINT_FL_fac_minimulwc_e 1#1#2#3#4#5#6.#7#8#9%
+{%
+ 1#6#9\expandafter!%
+ \the\numexpr\expandafter\XINT_FL_fac_smallmul
+ \the\numexpr \xint_c_x^viii+#1#2#3#4#5+#7*#8!%
+}%
+\def\XINT_FL_fac_smallmul 1#1!#21#3!%
+{%
+ \xint_gob_til_Z #3\XINT_FL_fac_smallmul_end\Z
+ \XINT_FL_fac_minimulwc_a #2!#3!{#1}{#2}%
+}%
+\def\XINT_FL_fac_smallmul_end\Z\XINT_FL_fac_minimulwc_a #1!\Z!#2#3[#4]%
+{%
+ \ifnum #2=\xint_c_
+ \expandafter\xint_firstoftwo\else
+ \expandafter\xint_secondoftwo
+ \fi
+ {-2\relax[#4]}%
+ {1#2\expandafter!\expandafter-\expandafter1\expandafter
+ [\the\numexpr #4+\xint_c_viii]}%
+}%
\def\xintFloatSqrt {\romannumeral0\xintfloatsqrt }%
\def\xintfloatsqrt #1{\XINT_flsqrt_chkopt \xintfloat #1\xint_relax }%
\def\XINTinFloatSqrt {\romannumeral0\XINTinfloatsqrt }%
@@ -2539,7 +2839,7 @@
{%
\expandafter\XINT_flsqrt_big_j
\romannumeral0\xintiidivision
- {#1}{\romannumeral0\XINT_dbl_pos #2\R\R\R\R\R\R\R\Z \W\W\W\W\W\W\W }{#2}%
+ {#1}{\romannumeral0\XINT_dbl_pos #2\Z}{#2}%
}%
\def\XINT_flsqrt_big_j #1%
{%
@@ -2551,8 +2851,8 @@
\def\XINT_flsqrt_big_k #1#2#3%
{%
\expandafter\XINT_flsqrt_big_l\expandafter
- {\romannumeral0\XINT_sub_pre {#3}{#1}}%
- {\romannumeral0\xintiiadd {#2}{\romannumeral0\XINT_sqr {#1}}}%
+ {\romannumeral0\xintiisub {#3}{#1}}%
+ {\romannumeral0\xintiiadd {#2}{\romannumeral0\XINT_sqr #1\Z}}%
}%
\def\XINT_flsqrt_big_l #1#2%
{%