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.sty1868
1 files changed, 1077 insertions, 791 deletions
diff --git a/Master/texmf-dist/tex/generic/xint/xintfrac.sty b/Master/texmf-dist/tex/generic/xint/xintfrac.sty
index 50a961d49cd..39b9785986f 100644
--- a/Master/texmf-dist/tex/generic/xint/xintfrac.sty
+++ b/Master/texmf-dist/tex/generic/xint/xintfrac.sty
@@ -21,8 +21,8 @@
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%% ---------------------------------------------------------------
-%% The xint bundle v1.2e 2015/11/22
-%% Copyright (C) 2013-2015 by Jean-Francois Burnol
+%% The xint bundle 1.2f 2016/03/12
+%% Copyright (C) 2013-2016 by Jean-Francois Burnol
%% xintfrac: Expandable operations on fractions
%% ---------------------------------------------------------------
\begingroup\catcode61\catcode48\catcode32=10\relax%
@@ -70,7 +70,7 @@
\XINTsetupcatcodes% defined in xintkernel.sty
\XINT_providespackage
\ProvidesPackage{xintfrac}%
- [2015/11/22 v1.2e Expandable operations on fractions (jfB)]%
+ [2016/03/12 1.2f Expandable operations on fractions (JFB)]%
\def\XINT_cntSgnFork #1%
{%
\ifcase #1\expandafter\xint_secondofthree
@@ -88,17 +88,16 @@
\expandafter\space
\the\numexpr -1+\XINT_Abs {#1}+\XINT_Len {#2}+\XINT_Len {#3}\relax
}%
-\def\XINT_lenrord_loop #1#2#3#4#5#6#7#8#9%
-{% faire \romannumeral`&&@\XINT_lenrord_loop 0{}#1\Z\W\W\W\W\W\W\W\Z
+\def\XINT_lenrord_loop #1.#2#3#4#5#6#7#8#9%
+{%
\xint_gob_til_W #9\XINT_lenrord_W\W
- \expandafter\XINT_lenrord_loop\expandafter
- {\the\numexpr #1+7}{#9#8#7#6#5#4#3#2}%
+ \expandafter\XINT_lenrord_loop\the\numexpr #1+\xint_c_vii.{#9#8#7#6#5#4#3#2}%
}%
-\def\XINT_lenrord_W\W\expandafter\XINT_lenrord_loop\expandafter #1#2#3\Z
+\def\XINT_lenrord_W\W\expandafter\XINT_lenrord_loop #1.#2#3\Z
{%
- \expandafter\XINT_lenrord_X\expandafter {#1}#2\Z
+ \expandafter\XINT_lenrord_X #1.#2\Z
}%
-\def\XINT_lenrord_X #1#2\Z
+\def\XINT_lenrord_X #1.#2\Z
{%
\XINT_lenrord_Y #2\R\R\R\R\R\R\T {#1}%
}%
@@ -113,10 +112,7 @@
#2\XINT_lenrord_Z \xint_c_iii
\W\XINT_lenrord_Z \xint_c_ii \Z
}%
-\def\XINT_lenrord_Z #1#2\Z #3% retourne: {longueur}renverse\Z
-{%
- \expandafter{\the\numexpr #3-#1\relax}%
-}%
+\def\XINT_lenrord_Z #1#2\Z #3{\the\numexpr #3-#1.}%
\def\XINT_outfrac #1#2#3%
{%
\ifcase\XINT_cntSgn #3\Z
@@ -173,11 +169,11 @@
#1/#2%
}%
\def\XINT_infrac_res_ca #1[#2]/\XINT_W[\XINT_W\XINT_T
- {\expandafter{\the\numexpr 0#2}{#1}{1}}%
+ {\expandafter{\the\numexpr #2}{#1}{1}}%
\def\XINT_infrac_res_cb #1/#2[%
{\expandafter\XINT_infrac_res_cc\romannumeral`&&@#2~#1[}%
\def\XINT_infrac_res_cc #1~#2[#3]/\XINT_W[\XINT_W\XINT_T
- {\expandafter{\the\numexpr 0#3}{#2}{#1}}%
+ {\expandafter{\the\numexpr #3}{#2}{#1}}%
\def\XINT_frac_gen #1/#2%
{%
\xint_UDXINTWfork
@@ -201,14 +197,14 @@
#1.#2%
}%
\def\XINT_frac_gen_Bb #1e#2e#3\XINT_Z
- {\expandafter\XINT_frac_gen_C\the\numexpr 0#2~#1!}%
+ {\expandafter\XINT_frac_gen_C\the\numexpr #2+\xint_c_~#1!}%
\def\XINT_frac_gen_Bc #1.#2e%
{%
\expandafter\XINT_frac_gen_Bd\romannumeral`&&@#2.#1e%
}%
\def\XINT_frac_gen_Bd #1.#2e#3e#4\XINT_Z
{%
- \expandafter\XINT_frac_gen_C\the\numexpr 0#3-\romannumeral0\expandafter
+ \expandafter\XINT_frac_gen_C\the\numexpr #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!%
@@ -370,10 +366,10 @@
}%
\def\XINT_addm_A #1#2#3#4#5#6%
{%
- \xint_gob_til_W #3\xint_addm_az\W
+ \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%
+\def\XINT_addm_az\W\XINT_addm_AB #1#2%
{%
\XINT_addm_AC_checkcarry #1%
}%
@@ -391,9 +387,9 @@
}%
\def\XINT_addm_AC_checkcarry #1%
{%
- \xint_gob_til_zero #1\xint_addm_AC_nocarry 0\XINT_addm_C
+ \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
+\def\XINT_addm_AC_nocarry 0\XINT_addm_C #1#2\W\X\Y\Z
{%
\expandafter
\xint_cleanupzeros_andstop
@@ -408,10 +404,10 @@
\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
+ #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%
@@ -422,10 +418,10 @@
{%
\XINT_addm_AC_checkcarry #2{#3#4}%
}%
-\def\xint_addm_cw
- #1\xint_addm_cx
- #2\xint_addm_cy
- #3\xint_addm_cz
+\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.%
@@ -434,9 +430,9 @@
{%
\XINT_addm_end #1#3%
}%
-\def\xint_addm_cx
- #1\xint_addm_cy
- #2\xint_addm_cz
+\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.%
@@ -445,8 +441,8 @@
{%
\XINT_addm_end #1#3%
}%
-\def\xint_addm_cy
- #1\xint_addm_cz
+\def\XINT_addm_cy
+ #1\XINT_addm_cz
\W\XINT_addm_CD
{%
\expandafter\XINT_addm_CDy\the\numexpr 1+#1.%
@@ -455,7 +451,7 @@
{%
\XINT_addm_end #1#3%
}%
-\def\xint_addm_cz\W\XINT_addm_CD #1#2#3{\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 }%
@@ -690,38 +686,9 @@
}%
\def\XINT_e #1#2#3#4%
{%
- \expandafter\XINT_e_end\expandafter{\the\numexpr #1+#4}{#2}{#3}%
-}%
-\def\XINT_e_end #1#2#3{ #2/#3[#1]}%
-\def\xintFloatE {\romannumeral0\xintfloate }%
-\def\xintfloate #1{\XINT_floate_chkopt #1\xint_relax }%
-\def\XINT_floate_chkopt #1%
-{%
- \ifx [#1\expandafter\XINT_floate_opt
- \else\expandafter\XINT_floate_noopt
- \fi #1%
-}%
-\def\XINT_floate_noopt #1\xint_relax
-{%
- \expandafter\XINT_floate_a\expandafter\XINTdigits
- \romannumeral0\XINT_infrac {#1}%
-}%
-\def\XINT_floate_opt [\xint_relax #1]#2%
-{%
- \expandafter\XINT_floate_a\expandafter
- {\the\numexpr #1\expandafter}\romannumeral0\XINT_infrac {#2}%
-}%
-\def\XINT_floate_a #1#2#3#4#5%
-{%
- \expandafter\expandafter\expandafter\XINT_float_a
- \expandafter\xint_exchangetwo_keepbraces\expandafter
- {\the\numexpr #2+#5}{#1}{#3}{#4}\XINT_float_Q
+ \expandafter\XINT_e_end\the\numexpr #1+#4.{#2}{#3}%
}%
-\def\XINTinFloatE {\romannumeral0\XINTinfloate }%
-\def\XINTinfloate {\expandafter\XINT_infloate\romannumeral0\XINTinfloat [\XINTdigits]}%
-\def\XINT_infloate #1[#2]#3%
- {\expandafter\XINT_infloate_end\expandafter {\the\numexpr #3+#2}{#1}}%
-\def\XINT_infloate_end #1#2{ #2[#1]}%
+\def\XINT_e_end #1.#2#3{ #2/#3[#1]}%
\def\xintIrr {\romannumeral0\xintirr }%
\def\xintirr #1%
{%
@@ -767,9 +734,9 @@
}%
\def\XINT_irr_loop_e #1#2\Z
{%
- \xint_gob_til_zero #1\xint_irr_loop_exit0\XINT_irr_loop_a {#1#2}%
+ \xint_gob_til_zero #1\XINT_irr_loop_exit0\XINT_irr_loop_a {#1#2}%
}%
-\def\xint_irr_loop_exit0\XINT_irr_loop_a #1#2#3#4%
+\def\XINT_irr_loop_exit0\XINT_irr_loop_a #1#2#3#4%
{%
\expandafter\XINT_irr_loop_exitb\expandafter
{\romannumeral0\xintiiquo {#3}{#2}}%
@@ -845,9 +812,9 @@
}%
\def\XINT_jrr_loop_e #1#2\Z
{%
- \xint_gob_til_zero #1\xint_jrr_loop_exit0\XINT_jrr_loop_a {#1#2}%
+ \xint_gob_til_zero #1\XINT_jrr_loop_exit0\XINT_jrr_loop_a {#1#2}%
}%
-\def\xint_jrr_loop_exit0\XINT_jrr_loop_a #1#2#3#4#5#6%
+\def\XINT_jrr_loop_exit0\XINT_jrr_loop_a #1#2#3#4#5#6%
{%
\XINT_irr_finish {#3}{#4}%
}%
@@ -864,12 +831,6 @@
\def\XINT_tfrac_zero #1\Z { 0/1[0]}%
\def\XINT_tfrac_P #1/#2\Z {\expandafter\XINT_rez_AB
\romannumeral0\xintiirem{#1}{#2}\Z {0}{#2}}%
-\def\XINTinFloatFracdigits {\romannumeral0\XINTinfloatfracdigits }%
-\def\XINTinfloatfracdigits #1%
-{%
- \expandafter\XINT_infloatfracdg_a\expandafter {\romannumeral0\xinttfrac{#1}}%
-}%
-\def\XINT_infloatfracdg_a {\XINTinfloat [\XINTdigits]}%
\def\xintTrunc {\romannumeral0\xinttrunc }%
\def\xintiTrunc {\romannumeral0\xintitrunc }%
\def\xinttrunc #1%
@@ -916,13 +877,13 @@
\def\XINT_trunc_C #1#2#3%
{%
\expandafter\XINT_trunc_CE\expandafter
- {\romannumeral0\XINT_dsx_zeroloop {-#1}{}\Z {#3}}{#2}%
+ {\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_E
- \romannumeral0\XINT_dsx_zeroloop {#1}{}\Z {#2}.%
+ \romannumeral0\XINT_dsx_zeroloop #1.{}\Z {#2}.%
}%
\def\XINT_trunc_E #1%
{%
@@ -965,7 +926,7 @@
\def\XINT_trunc_Hb #1#2#3%
{%
\expandafter #3\expandafter0\expandafter.%
- \romannumeral0\XINT_dsx_zeroloop {#1}{}\Z {}#2% #1=-0 autoris\'e !
+ \romannumeral0\XINT_dsx_zeroloop #1.{}\Z {}#2% #1=-0 autoris\'e !
}%
\def\xintTTrunc {\romannumeral0\xintttrunc }%
\def\xintttrunc #1%
@@ -1075,8 +1036,8 @@
}%
\def\XINT_xtrunc_zero .#1#2#3#4#5%
{%
- 0.\romannumeral0\expandafter\XINT_dsx_zeroloop\expandafter
- {\the\numexpr #5}{}\Z {}%
+ 0.\romannumeral0\expandafter\XINT_dsx_zeroloop
+ \the\numexpr #5.{}\Z {}%
\xintiloop [#4+-1]
\ifnum \xintiloopindex>\xint_c_
0000000000000000000000000000000000000000000000000000000000000000%
@@ -1136,12 +1097,12 @@
\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
+ \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_negNDb #1.#2.{#1.#2}%
\def\XINT_xtrunc_negNE #1#2%
{%
- 0.\romannumeral0\XINT_dsx_zeroloop {-#1}{}\Z {}#2%
+ 0.\romannumeral0\XINT_dsx_zeroloop -#1.{}\Z {}#2%
}%
\def\XINT_xtrunc_negNW #1#2#3#4#5#6%
{%
@@ -1153,11 +1114,10 @@
\expandafter\XINT_xtrunc_negNC\expandafter
{\the\numexpr\xintLength {#1}-#2}{#1}%
}%
-%%%%%%%%%%%%
\def\XINT_xtrunc_BisOne #1#2#3#4#5#6#7%
{%
- #5.\romannumeral0\expandafter\XINT_dsx_zeroloop\expandafter
- {\the\numexpr #7}{}\Z {}%
+ #5.\romannumeral0\expandafter\XINT_dsx_zeroloop
+ \the\numexpr #7.{}\Z {}%
\xintiloop [#6+-1]
\ifnum \xintiloopindex>\xint_c_
0000000000000000000000000000000000000000000000000000000000000000%
@@ -1166,18 +1126,17 @@
\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 {}%
+ \romannumeral0\expandafter\XINT_dsx_zeroloop
+ \the\numexpr #7-\xint_c_i.{}\Z {}%
\xintiloop [#6+-1]
\ifnum \xintiloopindex>\xint_c_
0000000000000000000000000000000000000000000000000000000000000000%
\repeat
}%
-%%%%%%%%%%%%
\def\XINT_xtrunc_Q #1%
{%
\expandafter\XINT_xtrunc_prepare
- \romannumeral0\XINT_dsx_zeroloop {#1}{}\Z
+ \romannumeral0\XINT_dsx_zeroloop #1.{}\Z
}%
\def\XINT_xtrunc_prepare #1.#2#3%
{%
@@ -1185,7 +1144,6 @@
{\romannumeral0%
\XINT_xtrunc_prepare_a #2\R\R\R\R\R\R\R\R {10}0000001\W !{#2}}{#1}%
}%
-%%%%%%%%%%%%
\def\XINT_xtrunc_prepare_a #1#2#3#4#5#6#7#8#9%
{%
\xint_gob_til_R #9\XINT_xtrunc_prepare_small\R
@@ -1205,7 +1163,6 @@
\the\numexpr #1/\xint_c_ii\expandafter
.\the\numexpr \xint_c_x^viii+#1!%
}%
-%%%%%%%%%%%%
\def\XINT_xtrunc_small_a #1.#2!#3%
{%
\expandafter\XINT_div_small_b\the\numexpr #1\expandafter
@@ -1213,7 +1170,6 @@
\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_prepare_b
{\expandafter\XINT_xtrunc_prepare_c\romannumeral0\XINT_zeroes_forviii }%
\def\XINT_xtrunc_prepare_c #1!%
@@ -1242,7 +1198,6 @@
\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}%
@@ -1261,8 +1216,8 @@
}%
\def\XINT_xtrunc_D #1#2#3%
{%
- \romannumeral0\expandafter\XINT_dsx_zeroloop\expandafter
- {\the\numexpr \xint_c_ii^vi-\xintLength{#1}}{}\Z {}#1%
+ \romannumeral0\expandafter\XINT_dsx_zeroloop
+ \the\numexpr \xint_c_ii^vi-\xintLength{#1}.{}\Z {}#1%
\XINT_xtrunc_A {#3}{#2}%
}%
\def\XINT_xtrunc_transition\fi
@@ -1271,7 +1226,7 @@
\fi
\ifnum #4=\xint_c_ \XINT_xtrunc_abort\fi
\expandafter\XINT_xtrunc_x\expandafter
- {\romannumeral0\XINT_dsx_zeroloop {#4}{}\Z {#2}}{#3}{#4}%
+ {\romannumeral0\XINT_dsx_zeroloop #4.{}\Z {#2}}{#3}{#4}%
}%
\def\XINT_xtrunc_x #1#2%
{%
@@ -1279,330 +1234,17 @@
}%
\def\XINT_xtrunc_y #1#2#3%
{%
- \romannumeral0\expandafter\XINT_dsx_zeroloop\expandafter
- {\the\numexpr #3-\xintLength{#1}}{}\Z {}#1%
+ \romannumeral0\expandafter\XINT_dsx_zeroloop
+ \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=}%
\def\xinttheDigits {\number\XINTdigits }%
-\def\xintFloat {\romannumeral0\xintfloat }%
-\def\xintfloat #1{\XINT_float_chkopt #1\xint_relax }%
-\def\XINT_float_chkopt #1%
-{%
- \ifx [#1\expandafter\XINT_float_opt
- \else\expandafter\XINT_float_noopt
- \fi #1%
-}%
-\def\XINT_float_noopt #1\xint_relax
-{%
- \expandafter\XINT_float_a\expandafter\XINTdigits
- \romannumeral0\XINT_infrac {#1}\XINT_float_Q
-}%
-\def\XINT_float_opt [\xint_relax #1]#2%
-{%
- \expandafter\XINT_float_a\expandafter
- {\the\numexpr #1\expandafter}%
- \romannumeral0\XINT_infrac {#2}\XINT_float_Q
-}%
-\def\XINT_float_a #1#2#3% #1=P, #2=n, #3=A, #4=B
-{%
- \XINT_float_fork #3\Z {#1}{#2}% #1 = precision, #2=n
-}%
-\def\XINT_float_fork #1%
-{%
- \xint_UDzerominusfork
- #1-\XINT_float_zero
- 0#1\XINT_float_J
- 0-{\XINT_float_K #1}%
- \krof
-}%
-\def\XINT_float_zero #1\Z #2#3#4#5{ 0.e0}%
-\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
- {\the\numexpr\xintLength{#1}\expandafter}\expandafter
- {\the\numexpr #2+\xint_c_ii}{#1}{#2}%
-}%
-\def\XINT_float_L #1#2%
-{%
- \ifnum #1>#2
- \expandafter\XINT_float_Ma
- \else
- \expandafter\XINT_float_Mc
- \fi {#1}{#2}%
-}%
-\def\XINT_float_Ma #1#2#3%
-{%
- \expandafter\XINT_float_Mb\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}%
-}%
-\def\XINT_float_Mb #1#2#3#4#5#6% #2=A', #3=P+2, #4=P, #5=n, #6=B
-{%
- \expandafter\XINT_float_N\expandafter
- {\the\numexpr\xintLength{#6}\expandafter}\expandafter
- {\the\numexpr #3\expandafter}\expandafter
- {\the\numexpr #1+#5}%
- {#6}{#3}{#2}{#4}%
-}% long de B, P+2, n', B, |A'|=P+2, A', P
-\def\XINT_float_Mc #1#2#3#4#5#6%
-{%
- \expandafter\XINT_float_N\expandafter
- {\romannumeral0\xintlength{#6}}{#2}{#5}{#6}{#1}{#3}{#4}%
-}% long de B, P+2, n, B, |A|, A, P
-\def\XINT_float_N #1#2%
-{%
- \ifnum #1>#2
- \expandafter\XINT_float_O
- \else
- \expandafter\XINT_float_P
- \fi {#1}{#2}%
-}%
-\def\XINT_float_O #1#2#3#4%
-{%
- \expandafter\XINT_float_P\expandafter
- {\the\numexpr #2\expandafter}\expandafter
- {\the\numexpr #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
- }%
-}% |B|,P+2,n,B,|A|,A,P
-\def\XINT_float_P #1#2#3#4#5#6#7#8%
-{%
- \expandafter #8\expandafter {\the\numexpr #1-#5+#2-\xint_c_i}%
- {#6}{#4}{#7}{#3}%
-}% |B|-|A|+P+1,A,B,P,n
-\def\XINT_float_Q #1%
-{%
- \ifnum #1<\xint_c_
- \expandafter\XINT_float_Ri
- \else
- \expandafter\XINT_float_Rii
- \fi {#1}%
-}%
-\def\XINT_float_Ri #1#2#3%
-{%
- \expandafter\XINT_float_Sa
- \romannumeral0\xintiiquo {#2}%
- {\XINT_dsx_addzerosnofuss {-#1}{#3}}\Z {#1}%
-}%
-\def\XINT_float_Rii #1#2#3%
-{%
- \expandafter\XINT_float_Sa
- \romannumeral0\xintiiquo
- {\XINT_dsx_addzerosnofuss {#1}{#2}}{#3}\Z {#1}%
-}%
-\def\XINT_float_Sa #1%
-{%
- \if #19%
- \xint_afterfi {\XINT_float_Sb\XINT_float_Wb }%
- \else
- \xint_afterfi {\XINT_float_Sb\XINT_float_Wa }%
- \fi #1%
-}%
-\def\XINT_float_Sb #1#2\Z #3#4%
-{%
- \expandafter\XINT_float_T\expandafter
- {\the\numexpr #4+\xint_c_i\expandafter}%
- \romannumeral`&&@\XINT_lenrord_loop 0{}#2\Z\W\W\W\W\W\W\W\Z #1{#3}{#4}%
-}%
-\def\XINT_float_T #1#2#3%
-{%
- \ifnum #2>#1
- \xint_afterfi{\XINT_float_U\XINT_float_Xb}%
- \else
- \xint_afterfi{\XINT_float_U\XINT_float_Xa #3}%
- \fi
-}%
-\def\XINT_float_U #1#2%
-{%
- \ifnum #2<\xint_c_v
- \expandafter\XINT_float_Va
- \else
- \expandafter\XINT_float_Vb
- \fi #1%
-}%
-\def\XINT_float_Va #1#2\Z #3%
-{%
- \expandafter#1%
- \romannumeral0\expandafter\XINT_float_Wa
- \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 \Z
-}%
-\def\XINT_float_Vb #1#2\Z #3%
-{%
- \expandafter #1%
- \romannumeral0\expandafter #3%
- \romannumeral0\XINT_addm_A 0{}1000\W\X\Y\Z #2000\W\X\Y\Z \Z
-}%
-\def\XINT_float_Wa #1{ #1.}%
-\def\XINT_float_Wb #1#2%
- {\if #11\xint_afterfi{ 10.}\else\xint_afterfi{ #1.#2}\fi }%
-\def\XINT_float_Xa #1\Z #2#3#4%
-{%
- \expandafter\XINT_float_Y\expandafter
- {\the\numexpr #3+#4-#2}{#1}%
-}%
-\def\XINT_float_Xb #1\Z #2#3#4%
-{%
- \expandafter\XINT_float_Y\expandafter
- {\the\numexpr #3+#4+\xint_c_i-#2}{#1}%
-}%
-\def\XINT_float_Y #1#2{ #2e#1}%
-\def\xintPFloat {\romannumeral0\xintpfloat }%
-\def\xintpfloat #1{\XINT_pfloat_chkopt #1\xint_relax }%
-\def\XINT_pfloat_chkopt #1%
-{%
- \ifx [#1\expandafter\XINT_pfloat_opt
- \else\expandafter\XINT_pfloat_noopt
- \fi #1%
-}%
-\def\XINT_pfloat_noopt #1\xint_relax
-{%
- \expandafter\XINT_pfloat_a\expandafter\XINTdigits
- \romannumeral0\XINTinfloat [\XINTdigits]{#1}%
-}%
-\def\XINT_pfloat_opt [\xint_relax #1]%#2%
-{%
- \expandafter\XINT_pfloat_a\expandafter {\the\numexpr #1\expandafter}%
- \romannumeral0\XINTinfloat [\numexpr #1\relax]%{#2}%
-}%
-\def\XINT_pfloat_a #1#2%
-{%
- \xint_UDzerominusfork
- #2-\XINT_pfloat_zero
- 0#2\XINT_pfloat_neg
- 0-{\XINT_pfloat_pos #2}%
- \krof {#1}%
-}%
-\def\XINT_pfloat_zero #1[#2]{ 0}%
-\def\XINT_pfloat_neg
- {\expandafter\xint_minus_thenstop\romannumeral0\XINT_pfloat_pos {}}%
-\def\XINT_pfloat_pos #1#2#3[#4]%
-{%
- \ifnum#4>0 \xint_dothis\XINT_pfloat_no\fi
- \ifnum#4>\numexpr-#2\relax \xint_dothis\XINT_pfloat_b\fi
- \ifnum#4>\numexpr-#2-\xint_c_v\relax \xint_dothis\XINT_pfloat_B\fi
- \xint_orthat\XINT_pfloat_no {#2}{#4}{#1#3}%
-}%
-\def\XINT_pfloat_no #1#2%
-{%
- \expandafter\XINT_pfloat_no_b\expandafter{\the\numexpr #2+#1-\xint_c_i\relax}%
-}%
-\def\XINT_pfloat_no_b #1#2{\XINT_pfloat_no_c #2e#1}%
-\def\XINT_pfloat_no_c #1{ #1.}%
-\def\XINT_pfloat_b #1#2#3%
- {\expandafter\XINT_pfloat_c
- \romannumeral0\expandafter\XINT_split_fromleft_loop
- \expandafter {\the\numexpr #1+#2-\xint_c_i}#3\W\W\W\W\W\W\W\W\Z }%
-\def\XINT_pfloat_c #1#2{ #1.#2}% #2 peut \^etre vide
-\def\XINT_pfloat_B #1#2#3%
- {\expandafter\XINT_pfloat_C
- \romannumeral0\XINT_dsx_zeroloop {\numexpr -#1-#2}{}\Z {}#3}%
-\def\XINT_pfloat_C { 0.}%
-\def\XINTinFloat {\romannumeral0\XINTinfloat }%
-\def\XINTinfloat [#1]#2%
-{%
- \expandafter\XINT_infloat_a\expandafter
- {\the\numexpr #1\expandafter}%
- \romannumeral0\XINT_infrac {#2}\XINT_infloat_Q
-}%
-\def\XINT_infloat_a #1#2#3% #1=P, #2=n, #3=A, #4=B
-{%
- \XINT_infloat_fork #3\Z {#1}{#2}% #1 = precision, #2=n
-}%
-\def\XINT_infloat_fork #1%
-{%
- \xint_UDzerominusfork
- #1-\XINT_infloat_zero
- 0#1\XINT_infloat_J
- 0-{\XINT_float_K #1}%
- \krof
-}%
-\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_
- \expandafter\XINT_infloat_Ri
- \else
- \expandafter\XINT_infloat_Rii
- \fi {#1}%
-}%
-\def\XINT_infloat_Ri #1#2#3%
-{%
- \expandafter\XINT_infloat_S\expandafter
- {\romannumeral0\xintiiquo {#2}%
- {\XINT_dsx_addzerosnofuss {-#1}{#3}}}{#1}%
-}%
-\def\XINT_infloat_Rii #1#2#3%
-{%
- \expandafter\XINT_infloat_S\expandafter
- {\romannumeral0\xintiiquo
- {\XINT_dsx_addzerosnofuss {#1}{#2}}{#3}}{#1}%
-}%
-\def\XINT_infloat_S #1#2#3%
-{%
- \expandafter\XINT_infloat_T\expandafter
- {\the\numexpr #3+\xint_c_i\expandafter}%
- \romannumeral`&&@\XINT_lenrord_loop 0{}#1\Z\W\W\W\W\W\W\W\Z
- {#2}%
-}%
-\def\XINT_infloat_T #1#2#3%
-{%
- \ifnum #2>#1
- \xint_afterfi{\XINT_infloat_U\XINT_infloat_Wb}%
- \else
- \xint_afterfi{\XINT_infloat_U\XINT_infloat_Wa #3}%
- \fi
-}%
-\def\XINT_infloat_U #1#2%
-{%
- \ifnum #2<\xint_c_v
- \expandafter\XINT_infloat_Va
- \else
- \expandafter\XINT_infloat_Vb
- \fi #1%
-}%
-\def\XINT_infloat_Va #1#2\Z
-{%
- \expandafter#1%
- \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 \Z
-}%
-\def\XINT_infloat_Vb #1#2\Z
-{%
- \expandafter #1%
- \romannumeral0\XINT_addm_A 0{}1000\W\X\Y\Z #2000\W\X\Y\Z \Z
-}%
-\def\XINT_infloat_Wa #1\Z #2#3%
-{%
- \expandafter\XINT_infloat_X\expandafter
- {\the\numexpr #3+\xint_c_i-#2}{#1}%
-}%
-\def\XINT_infloat_Wb #1\Z #2#3%
-{%
- \expandafter\XINT_infloat_X\expandafter
- {\the\numexpr #3+\xint_c_ii-#2}{#1}%
-}%
-\def\XINT_infloat_X #1#2{ #2[#1]}%
\def\xintAdd {\romannumeral0\xintadd }%
-\def\xintadd #1{\expandafter\xint_fadd\romannumeral0\xintraw {#1}}%
-\def\xint_fadd #1{\xint_gob_til_zero #1\XINT_fadd_Azero 0\XINT_fadd_a #1}%
+\def\xintadd #1{\expandafter\XINT_fadd\romannumeral0\xintraw {#1}}%
+\def\XINT_fadd #1{\xint_gob_til_zero #1\XINT_fadd_Azero 0\XINT_fadd_a #1}%
\def\XINT_fadd_Azero #1]{\xintraw }%
\def\XINT_fadd_a #1/#2[#3]#4%
{\expandafter\XINT_fadd_b\romannumeral0\xintraw {#4}{#3}{#1}{#2}}%
@@ -1626,13 +1268,13 @@
\def\XINT_fadd_Ba #1#2#3#4#5#6#7%
{%
\expandafter\XINT_fadd_C\expandafter
- {\romannumeral0\XINT_dsx_zeroloop {#1}{}\Z {#6}}%
+ {\romannumeral0\XINT_dsx_zeroloop #1.{}\Z {#6}}%
{#7}{#5}{#4}[#2]%
}%
\def\XINT_fadd_Bb #1#2#3#4#5#6#7%
{%
\expandafter\XINT_fadd_C\expandafter
- {\romannumeral0\XINT_dsx_zeroloop {-#1}{}\Z {#4}}%
+ {\romannumeral0\XINT_dsx_zeroloop -#1.{}\Z {#4}}%
{#5}{#7}{#6}[#3]%
}%
\def\XINT_fadd_C #1#2#3%
@@ -1693,8 +1335,8 @@
\def\XINT_fadd_N #1#2{ #2/#1}%
\edef\XINT_fadd_iszero\fi #1[#2]{\noexpand\fi\space 0/1[0]}% ou [#2] originel?
\def\xintSub {\romannumeral0\xintsub }%
-\def\xintsub #1{\expandafter\xint_fsub\romannumeral0\xintraw {#1}}%
-\def\xint_fsub #1{\xint_gob_til_zero #1\XINT_fsub_Azero 0\XINT_fsub_a #1}%
+\def\xintsub #1{\expandafter\XINT_fsub\romannumeral0\xintraw {#1}}%
+\def\XINT_fsub #1{\xint_gob_til_zero #1\XINT_fsub_Azero 0\XINT_fsub_a #1}%
\def\XINT_fsub_Azero #1]{\xintopp }%
\def\XINT_fsub_a #1/#2[#3]#4%
{\expandafter\XINT_fsub_b\romannumeral0\xintraw {#4}{#3}{#1}{#2}}%
@@ -1723,8 +1365,8 @@
}%
\def\XINT_fsum_finished #1\Z #2{ #2}%
\def\xintMul {\romannumeral0\xintmul }%
-\def\xintmul #1{\expandafter\xint_fmul\romannumeral0\xintraw {#1}.}%
-\def\xint_fmul #1{\xint_gob_til_zero #1\XINT_fmul_zero 0\XINT_fmul_a #1}%
+\def\xintmul #1{\expandafter\XINT_fmul\romannumeral0\xintraw {#1}.}%
+\def\XINT_fmul #1{\xint_gob_til_zero #1\XINT_fmul_zero 0\XINT_fmul_a #1}%
\def\XINT_fmul_a #1[#2].#3%
{\expandafter\XINT_fmul_b\romannumeral0\xintraw {#3}#1[#2.]}%
\def\XINT_fmul_b #1{\xint_gob_til_zero #1\XINT_fmul_zero 0\XINT_fmul_c #1}%
@@ -1742,9 +1384,9 @@
\def\XINT_fmul_e #1#2{\XINT_outfrac {#2}{#1}}%
\def\XINT_fmul_zero #1.#2{ 0/1[0]}%
\def\xintSqr {\romannumeral0\xintsqr }%
-\def\xintsqr #1{\expandafter\xint_fsqr\romannumeral0\xintraw {#1}}%
-\def\xint_fsqr #1{\xint_gob_til_zero #1\XINT_fsqr_zero 0\XINT_fsqr_a #1}%
-\def\xint_fsqr_a #1/#2[#3]%
+\def\xintsqr #1{\expandafter\XINT_fsqr\romannumeral0\xintraw {#1}}%
+\def\XINT_fsqr #1{\xint_gob_til_zero #1\XINT_fsqr_zero 0\XINT_fsqr_a #1}%
+\def\XINT_fsqr_a #1/#2[#3]%
{%
\expandafter\XINT_fsqr_b
\expandafter{\the\numexpr #3+#3\expandafter}%
@@ -1753,12 +1395,16 @@
}%
\def\XINT_fsqr_b #1#2#3{\expandafter \XINT_fmul_e \expandafter{#3}{#1}{#2}}%
\def\XINT_fsqr_zero #1]{ 0/1[0]}%
+\def\xintipow #1#2%
+{%
+ \expandafter\xint_pow\the\numexpr \xintNum{#2}\expandafter.\romannumeral0\xintnum{#1}\Z%
+}%
\def\xintPow {\romannumeral0\xintpow }%
\def\xintpow #1%
{%
- \expandafter\xint_fpow\expandafter {\romannumeral0\XINT_infrac {#1}}%
+ \expandafter\XINT_fpow\expandafter {\romannumeral0\XINT_infrac {#1}}%
}%
-\def\xint_fpow #1#2%
+\def\XINT_fpow #1#2%
{%
\expandafter\XINT_fpow_fork\the\numexpr \xintNum{#2}\relax\Z #1%
}%
@@ -1791,10 +1437,16 @@
\expandafter\XINT_fpow_pos_B\expandafter {#3}{#1}{#2}%
}%
\def\XINT_fpow_pos_B #1#2{\XINT_outfrac {#2}{#1}}%
-\def\xintFac {\romannumeral0\xintfac }%
-\def\xintfac #1%
+\def\xintifac #1{\expandafter\XINT_fac_fork\the\numexpr \xintNum{#1}.}%
+\def\xintibinomial #1#2%
+{%
+ \expandafter\XINT_binom_pre
+ \the\numexpr\xintNum{#1}\expandafter.\the\numexpr\xintNum{#2}.%
+}%
+\def\xintipfactorial #1#2%
{%
- \expandafter\XINT_fac_fork\expandafter{\the\numexpr \xintNum{#1}}%
+ \expandafter\XINT_pfac_fork
+ \the\numexpr\xintNum{#1}\expandafter.\the\numexpr\xintNum{#2}.%
}%
\def\xintPrd {\romannumeral0\xintprd }%
\def\xintprd #1{\xintprdexpr #1\relax }%
@@ -1818,9 +1470,9 @@
\def\xintDiv {\romannumeral0\xintdiv }%
\def\xintdiv #1%
{%
- \expandafter\xint_fdiv\expandafter {\romannumeral0\XINT_infrac {#1}}%
+ \expandafter\XINT_fdiv\expandafter {\romannumeral0\XINT_infrac {#1}}%
}%
-\def\xint_fdiv #1#2%
+\def\XINT_fdiv #1#2%
{\expandafter\XINT_fdiv_A\romannumeral0\XINT_infrac {#2}#1}%
\def\XINT_fdiv_A #1#2#3#4#5#6%
{%
@@ -1877,12 +1529,6 @@
{\xintiiE{\xintiiMul {#2}{#6}}{#4-#7}}% t fois n
}%
\def\XINT_mod_pos_a #1.#2#3#4{\xintiirem {#3}{#4}/#2[#1]}%
-\def\XINTinFloatMod {\romannumeral0\XINTinfloatmod [\XINTdigits]}%
-\def\XINTinfloatmod [#1]#2#3{\expandafter\XINT_infloatmod\expandafter
- {\romannumeral0\XINTinfloat[#1]{#2}}%
- {\romannumeral0\XINTinfloat[#1]{#3}}{#1}}%
-\def\XINT_infloatmod #1#2{\expandafter\XINT_infloatmod_a\expandafter {#2}{#1}}%
-\def\XINT_infloatmod_a #1#2#3{\XINTinfloat [#3]{\xintMod {#2}{#1}}}%
\def\xintIsOne {\romannumeral0\xintisone }%
\def\xintisone #1{\expandafter\XINT_fracisone
\romannumeral0\xintrawwithzeros{#1}\Z }%
@@ -1891,9 +1537,9 @@
\def\xintGeq {\romannumeral0\xintgeq }%
\def\xintgeq #1%
{%
- \expandafter\xint_fgeq\expandafter {\romannumeral0\xintabs {#1}}%
+ \expandafter\XINT_fgeq\expandafter {\romannumeral0\xintabs {#1}}%
}%
-\def\xint_fgeq #1#2%
+\def\XINT_fgeq #1#2%
{%
\expandafter\XINT_fgeq_A \romannumeral0\xintabs {#2}#1%
}%
@@ -1944,9 +1590,9 @@
\def\xintMax {\romannumeral0\xintmax }%
\def\xintmax #1%
{%
- \expandafter\xint_fmax\expandafter {\romannumeral0\xintraw {#1}}%
+ \expandafter\XINT_fmax\expandafter {\romannumeral0\xintraw {#1}}%
}%
-\def\xint_fmax #1#2%
+\def\XINT_fmax #1#2%
{%
\expandafter\XINT_fmax_A\romannumeral0\xintraw {#2}#1%
}%
@@ -1988,9 +1634,9 @@
\def\xintMin {\romannumeral0\xintmin }%
\def\xintmin #1%
{%
- \expandafter\xint_fmin\expandafter {\romannumeral0\xintraw {#1}}%
+ \expandafter\XINT_fmin\expandafter {\romannumeral0\xintraw {#1}}%
}%
-\def\xint_fmin #1#2%
+\def\XINT_fmin #1#2%
{%
\expandafter\XINT_fmin_A\romannumeral0\xintraw {#2}#1%
}%
@@ -2031,9 +1677,9 @@
\def\XINT_minof_e #1\Z #2\Z { #2}%
\def\xintcmp #1%
{%
- \expandafter\xint_fcmp\expandafter {\romannumeral0\xintraw {#1}}%
+ \expandafter\XINT_fcmp\expandafter {\romannumeral0\xintraw {#1}}%
}%
-\def\xint_fcmp #1#2%
+\def\XINT_fcmp #1#2%
{%
\expandafter\XINT_fcmp_A\romannumeral0\xintraw {#2}#1%
}%
@@ -2109,6 +1755,422 @@
\def\xintopp #1{\expandafter\XINT_opp\romannumeral0\xintraw {#1}}%
\def\xintSgn {\romannumeral0\xintsgn }%
\def\xintsgn #1{\expandafter\XINT_sgn\romannumeral0\xintraw {#1}\Z }%
+\def\xintFloat {\romannumeral0\xintfloat }%
+\def\xintfloat #1{\XINT_float_chkopt #1\xint_relax }%
+\def\XINT_float_chkopt #1%
+{%
+ \ifx [#1\expandafter\XINT_float_opt
+ \else\expandafter\XINT_float_noopt
+ \fi #1%
+}%
+\def\XINT_float_noopt #1\xint_relax
+{%
+ \expandafter\XINT_float_a\expandafter\XINTdigits\expandafter.%
+ \romannumeral0\XINT_infrac {#1}\XINT_float_Q
+}%
+\def\XINT_float_opt [\xint_relax #1]#2%
+{%
+ \expandafter\XINT_float_a\the\numexpr #1\expandafter.%
+ \romannumeral0\XINT_infrac {#2}\XINT_float_Q
+}%
+\def\XINT_float_a #1.#2#3% #1=P, #2=n, #3=A, #4=B
+{%
+ \XINT_float_fork #3\Z {#1}{#2}% #1 = precision, #2=n
+}%
+\def\XINT_float_fork #1%
+{%
+ \xint_UDzerominusfork
+ #1-\XINT_float_zero
+ 0#1\XINT_float_J
+ 0-{\XINT_float_K #1}%
+ \krof
+}%
+\def\XINT_float_zero #1\Z #2#3#4#5{ 0.e0}%
+\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
+ \the\numexpr\xintLength{#1}\expandafter.\the\numexpr #2+\xint_c_ii.{#1}{#2}%
+}%
+\def\XINT_float_L #1.#2.%
+{%
+ \ifnum #1>#2
+ \expandafter\XINT_float_Ma
+ \else
+ \expandafter\XINT_float_Mb
+ \fi #1.#2.%
+}%
+\def\XINT_float_Ma #1.#2.#3%
+{%
+ \expandafter\XINT_float_MatoN
+ \the\numexpr #1-#2\expandafter.%
+ \romannumeral0\XINT_split_fromleft_loop #2.{}#3\W\W\W\W\W\W\W\W\Z
+ {#2}%
+}%
+\def\XINT_float_MatoN #1.#2.#3.#4#5#6#7%
+{%
+ \expandafter\XINT_float_N
+ \the\numexpr\xintLength{#7}\expandafter.\the\numexpr #1+#6.#4.%
+ {#7}{#4}{#2}{#5}%
+}%
+\def\XINT_float_Mb #1.#2.#3#4#5#6%
+{%
+ \expandafter\XINT_float_N
+ \romannumeral0\xintlength{#6}.#5.#2.{#6}{#1}{#3}{#4}%
+}%
+\def\XINT_float_N #1.#2.#3.%
+{%
+ \ifnum #1>#3 \xint_dothis\XINT_float_N_Blong\fi
+ \ifnum #1=\xint_c_i\xint_dothis\XINT_float_N_Bshort\fi
+ \xint_orthat{\XINT_float_P 0.}%
+ #1.#2.#3.%
+}%
+\def\XINT_float_N_Blong #1.#2.#3.#4%
+{%
+ \expandafter\XINT_float_NaP
+ \the\numexpr #2-#1+#3\expandafter.%
+ \romannumeral0\XINT_split_fromleft_loop #3.{}#4\W\W\W\W\W\W\W\W\Z {#3}%
+}%
+\def\XINT_float_NaP #1.#2.#3.#4{\XINT_float_P 0.#4.#1.#4.{#2}}%
+\def\XINT_float_N_Bshort 1.#1.#2.#3%
+{%
+ \ifnum #3=\xint_c_i \xint_dothis{\XINT_float_P 1.}\fi
+ \xint_orthat{\XINT_float_P 0.}1.#1.#2.#3%
+}%
+\def\XINT_float_P #1.#2.#3.#4.#5#6#7#8#9%
+{%
+ \expandafter #9\expandafter#1%
+ \the\numexpr #2-#6+#4-\xint_c_i.{#7}{#5}{#8}{#3}%
+}%
+\def\XINT_float_Q #1%
+{%
+ \if 1#1\expandafter\XINT_float_Ri\else\expandafter\XINT_float_Rii\fi
+}%
+\def\XINT_float_Ri #1.#2#3%
+{%
+ \expandafter\XINT_float_Sa
+ \romannumeral0\XINT_dsx_addzerosnofuss {#1}{#2}\Z {#1}%
+}%
+\def\XINT_float_Rii #1.#2#3%
+{%
+ \expandafter\XINT_float_Sa
+ \romannumeral0\xintiiquo{\XINT_dsx_addzerosnofuss {#1}{#2}}{#3}\Z {#1}%
+}%
+\def\XINT_float_Sa #1%
+{%
+ \if #19\xint_dothis {\XINT_float_Sb\XINT_float_Wb }\fi
+ \xint_orthat {\XINT_float_Sb\XINT_float_Wa }#1%
+}%
+\def\XINT_float_Sb #1#2\Z #3#4%
+{%
+ \expandafter\XINT_float_T
+ \the\numexpr #4+\xint_c_i\expandafter.%
+ \romannumeral`&&@\XINT_lenrord_loop 0.{}#2\Z\W\W\W\W\W\W\W\Z #1{#3}{#4}%
+}%
+\def\XINT_float_T #1.#2.#3%
+{%
+ \ifnum #2>#1 \xint_dothis{\XINT_float_U\XINT_float_Xb}\fi
+ \xint_orthat{\XINT_float_U\XINT_float_Xa #3}%
+}%
+\def\XINT_float_U #1#2%
+{%
+ \ifnum #2<\xint_c_v
+ \expandafter\XINT_float_Va
+ \else
+ \expandafter\XINT_float_Vb
+ \fi #1%
+}%
+\def\XINT_float_Va #1#2\Z #3%
+{%
+ \expandafter#1%
+ \romannumeral0\expandafter\XINT_float_Wa
+ \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 \Z
+}%
+\def\XINT_float_Vb #1#2\Z #3%
+{%
+ \expandafter #1%
+ \romannumeral0\expandafter #3%
+ \romannumeral0\XINT_addm_A 0{}1000\W\X\Y\Z #2000\W\X\Y\Z \Z
+}%
+\def\XINT_float_Wa #1{ #1.}%
+\def\XINT_float_Wb #1#2{\if #11\xint_dothis{ 10.}\fi\xint_orthat{ #1.#2}}%
+\def\XINT_float_Xa #1\Z #2#3#4%
+{%
+ \expandafter\XINT_float_Y\the\numexpr #3+#4-#2.{#1}%
+}%
+\def\XINT_float_Xb #1\Z #2#3#4%
+{%
+ \expandafter\XINT_float_Y\the\numexpr #3+#4+\xint_c_i-#2.{#1}%
+}%
+\def\XINT_float_Y #1.#2{ #2e#1}%
+\def\XINTinFloat {\romannumeral0\XINTinfloat }%
+\def\XINTinfloat [#1]#2%
+{%
+ \expandafter\XINT_infloat\the\numexpr #1\expandafter.%
+ \romannumeral0\expandafter\XINT_infloat_in
+ \romannumeral`&&@#2/\XINT_W[\XINT_W\XINT_T\XINT_infloat_Q
+}%
+\def\XINT_infloat #1.#2{#2#1.}%
+\def\XINT_infloat_in #1[#2%
+{%
+ \xint_UDXINTWfork
+ #2\XINT_infloat_gen
+ \XINT_W\XINT_infloat_res_a
+ \krof
+ #1[#2%
+}%
+\edef\XINT_infloat_gen {\noexpand\expandafter\space\noexpand\expandafter
+ \noexpand\XINT_infloat_a
+ \noexpand\romannumeral0\noexpand\XINT_frac_gen }%
+\def\XINT_infloat_res_a #1%
+{%
+ \xint_gob_til_zero #1\XINT_infloat_res_zero 0\XINT_infloat_res_b #1%
+}%
+\def\XINT_infloat_res_zero #1\XINT_infloat_Q { \XINT_infloat_sp_zero}%
+\def\XINT_infloat_sp_zero #1.{ 0[0]}%
+\def\XINT_infloat_res_b #1/#2%
+{%
+ \xint_UDXINTWfork
+ #2\XINT_infloat_res_ca
+ \XINT_W\XINT_infloat_res_cb
+ \krof
+ #1/#2%
+}%
+\def\XINT_infloat_res_ca #1[#2]/\XINT_W[\XINT_W\XINT_T\XINT_infloat_Q
+ { \XINT_infloat_sp #1.#2.}%
+\def\XINT_infloat_res_cb #1/#2[%
+ {\expandafter\XINT_infloat_res_cc\romannumeral`&&@#2~#1[}%
+\edef\XINT_infloat_res_cc #1~#2[#3]/\XINT_W[\XINT_W\XINT_T
+ {\noexpand\expandafter\space\noexpand\expandafter
+ \noexpand\XINT_infloat_a\noexpand\expandafter
+ {\noexpand\the\numexpr #3}{#2}{#1}}%
+\def\XINT_infloat_sp #1.#2%
+{%
+ \if-#2\xint_dothis{\expandafter-\romannumeral0\XINT_infloat_sp_a {}}\fi
+ \xint_orthat{\XINT_infloat_sp_a #2}#1.%
+}%
+\def\XINT_infloat_sp_a #1#2.#3.%
+{%
+ \expandafter\XINT_infloat_sp_b\the\numexpr#2-\xintLength{#1#3}.#1#3.#2.%
+}%
+\def\XINT_infloat_sp_b #1%
+{%
+ \xint_UDzerominusfork
+ #1-\XINT_infloat_sp_quick
+ 0#1\XINT_infloat_sp_c
+ 0-{\XINT_infloat_sp_addzeroes #1}%
+ \krof
+}%
+\def\XINT_infloat_sp_quick .#1.#2.#3.{ #1[#3]}%
+\def\XINT_infloat_sp_addzeroes #1.#2.#3.#4.%
+{%
+ \expandafter\XINT_infloat_sp_done
+ \the\numexpr #4-#1\expandafter.%
+ \romannumeral0\XINT_dsx_addzerosnofuss {#1}{#2};%
+}%
+\def\XINT_infloat_sp_done #1.#2;{ #2[#1]}%
+\def\XINT_infloat_sp_c #1.#2%
+{%
+ \if #29\xint_dothis {\XINT_infloat_sp_d\XINT_infloat_Wb }\fi
+ \xint_orthat {\XINT_infloat_sp_d\xint_c_ }#1.#2%
+}%
+\def\XINT_infloat_sp_d #1#2.#3.#4.%#5.%
+{%
+ \expandafter\XINT_infloat_sp_e
+ \romannumeral0\expandafter\XINT_split_fromleft_loop
+ \the\numexpr #4+\xint_c_i.{}#3\W\W\W\W\W\W\W\W\Z #1#2.%
+}%
+\def\XINT_infloat_sp_e #1.#2.%
+{%
+ \expandafter\XINT_infloat_sp_f
+ \romannumeral0\XINT_rord_main {}#1%
+ \xint_relax
+ \xint_bye\xint_bye\xint_bye\xint_bye
+ \xint_bye\xint_bye\xint_bye\xint_bye
+ \xint_relax ;%
+}%
+\def\XINT_infloat_sp_f #1%
+{%
+ \ifnum #1<\xint_c_v
+ \expandafter\XINT_infloat_sp_ga\else\expandafter\XINT_infloat_sp_h\fi
+}%
+\def\XINT_infloat_sp_ga #1;#2#3.#4.%
+{%
+ \expandafter\XINT_infloat_sp_done\the\numexpr #3+#4\expandafter.%
+ \romannumeral0\XINT_rord_main {}#1%
+ \xint_relax
+ \xint_bye\xint_bye\xint_bye\xint_bye
+ \xint_bye\xint_bye\xint_bye\xint_bye
+ \xint_relax ;%
+}%
+\def\XINT_infloat_sp_h #1;#2%
+{%
+ \expandafter\XINT_infloat_sp_i
+ \romannumeral0\expandafter#2%
+ \romannumeral0\XINT_addm_A 0{}1000\W\X\Y\Z #1000\W\X\Y\Z;%
+}%
+\def\XINT_infloat_sp_i #1#2;#3.#4.%
+{%
+ \expandafter\XINT_infloat_sp_done\the\numexpr #1+#3+#4.#2;%
+}%
+\def\XINT_infloat_a #1.#2#3% #1=P, #2=n, #3=A, #4=B
+{%
+ \XINT_infloat_fork #3\Z {#1}{#2}% #1 = precision, #2=n
+}%
+\def\XINT_infloat_fork #1%
+{%
+ \xint_UDzerominusfork
+ #1-\XINT_infloat_zero
+ 0#1\XINT_infloat_J
+ 0-{\XINT_float_K #1}%
+ \krof
+}%
+\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%
+{%
+ \if 1#1\expandafter\XINT_infloat_Ri\else\expandafter\XINT_infloat_Rii\fi
+}%
+\def\XINT_infloat_Ri #1.#2#3%
+{%
+ \expandafter\XINT_infloat_Sa
+ \romannumeral0\XINT_dsx_addzerosnofuss {#1}{#2}\Z {#1}%
+}%
+\def\XINT_infloat_Rii #1.#2#3%
+{%
+ \expandafter\XINT_infloat_Sa
+ \romannumeral0\xintiiquo{\XINT_dsx_addzerosnofuss {#1}{#2}}{#3}\Z {#1}%
+}%
+\def\XINT_infloat_Sa #1%
+{%
+ \if #19\xint_dothis {\XINT_infloat_Sb\XINT_infloat_Wb }\fi
+ \xint_orthat {\XINT_infloat_Sb\xint_c_ }#1%
+}%
+\def\XINT_infloat_Sb #1#2\Z #3#4%
+{%
+ \expandafter\XINT_infloat_T
+ \the\numexpr #4+\xint_c_i\expandafter.%
+ \romannumeral`&&@\XINT_lenrord_loop 0.{}#2\Z\W\W\W\W\W\W\W\Z #1{#3}%
+}%
+\def\XINT_infloat_T #1.#2.#3%
+{%
+ \ifnum #2>#1 \xint_dothis{\XINT_infloat_U\XINT_infloat_Xb}\fi
+ \xint_orthat{\XINT_infloat_U\XINT_infloat_Xa #3}%
+}%
+\def\XINT_infloat_U #1#2%
+{%
+ \ifnum #2<\xint_c_v
+ \expandafter\XINT_infloat_Va
+ \else
+ \expandafter\XINT_infloat_Vb
+ \fi #1%
+}%
+\def\XINT_infloat_Va #1#2\Z #3%
+{%
+ \expandafter#1%
+ \romannumeral0\expandafter\xint_c_
+ \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 \Z
+}%
+\def\XINT_infloat_Vb #1#2\Z #3%
+{%
+ \expandafter #1%
+ \romannumeral0\expandafter #3%
+ \romannumeral0\XINT_addm_A 0{}1000\W\X\Y\Z #2000\W\X\Y\Z \Z
+}%
+\def\XINT_infloat_Wb #1#2%
+ {\if #11\xint_dothis{\xint_c_i1}\fi\xint_orthat{\xint_c_#1#2}}%
+\def\XINT_infloat_Xa #1#2\Z #3#4%
+{%
+ \expandafter\XINT_infloat_Y\the\numexpr #1+\xint_c_i+#4-#3.{#2}%
+}%
+\def\XINT_infloat_Xb #1#2\Z #3#4%
+{%
+ \expandafter\XINT_infloat_Y\the\numexpr #1+\xint_c_ii+#4-#3.{#2}%
+}%
+\def\XINT_infloat_Y #1.#2{ #2[#1]}%
+\def\xintPFloat {\romannumeral0\xintpfloat }%
+\def\xintpfloat #1{\XINT_pfloat_chkopt #1\xint_relax }%
+\def\XINT_pfloat_chkopt #1%
+{%
+ \ifx [#1\expandafter\XINT_pfloat_opt
+ \else\expandafter\XINT_pfloat_noopt
+ \fi #1%
+}%
+\def\XINT_pfloat_noopt #1\xint_relax
+{%
+ \expandafter\XINT_pfloat_a
+ \romannumeral0\xintfloat [\XINTdigits]{#1};\XINTdigits.%
+}%
+\def\XINT_pfloat_opt [\xint_relax #1]%#2%
+{%
+ \expandafter\XINT_pfloat_opt_a \the\numexpr #1.%
+}%
+\def\XINT_pfloat_opt_a #1.#2%
+{%
+ \expandafter\XINT_pfloat_a\romannumeral0\xintfloat [#1]{#2};#1.%
+}%
+\def\XINT_pfloat_a #1%
+{%
+ \xint_UDzerominusfork
+ #1-\XINT_pfloat_zero
+ 0#1\XINT_pfloat_neg
+ 0-{\XINT_pfloat_pos #1}%
+ \krof
+}%
+\def\XINT_pfloat_zero #1;#2.{ 0.}%
+\def\XINT_pfloat_neg
+ {\expandafter\xint_minus_thenstop\romannumeral0\XINT_pfloat_pos }%
+\def\XINT_pfloat_pos #1e#2;#3.%
+{%
+ \ifnum #2>\xint_c_v \xint_dothis\XINT_pfloat_no\fi
+ \ifnum #2<-\xint_c_v \xint_dothis\XINT_pfloat_no\fi
+ \ifnum #2<\xint_c_ \xint_dothis\XINT_pfloat_N\fi
+ \ifnum #2>\numexpr #3-\xint_c_i\relax \xint_dothis\XINT_pfloat_Ps\fi
+ \xint_orthat\XINT_pfloat_P #1e#2;%
+}%
+\def\XINT_pfloat_no #1;{ #1}%
+\def\XINT_pfloat_N #1#2.#3e#4;%
+{%
+ \csname XINT_pfloat_N\romannumeral-#4\endcsname #2#10.#3;%
+}%
+\def\XINT_pfloat_Ni #1#2#3.#4;{ #2.#1#4}%
+\def\XINT_pfloat_Nii #1#2#3.#4;{ 0.#2#1#4}%
+\def\XINT_pfloat_Niii#1#2#3.#4;{ 0.0#2#1#4}%
+\def\XINT_pfloat_Niv #1#2#3.#4;{ 0.00#2#1#4}%
+\def\XINT_pfloat_Nv #1#2#3.#4;{ 0.000#2#1#4}%
+\def\XINT_pfloat_P #1#2.#3e#4;%
+{%
+ \csname XINT_pfloat_P_\romannumeral#4\endcsname #3.#1#2;%
+}%
+\def\XINT_pfloat_P_ #1.#2;{ #2.#1}%
+\def\XINT_pfloat_P_i #1#2.#3;{ #3#1.#2}%
+\def\XINT_pfloat_P_ii #1#2#3.#4;{ #4#1#2.#3}%
+\def\XINT_pfloat_P_iii#1#2#3#4.#5;{ #5#1#2#3.#4}%
+\def\XINT_pfloat_P_iv #1#2#3#4#5.#6;{ #6#1#2#3#4.#5}%
+\def\XINT_pfloat_P_v #1#2#3#4#5#6.#7;{ #7#1#2#3#4#5.#6}%
+\def\XINT_pfloat_Ps #1#2.#3e#4;%
+{%
+ \csname XINT_pfloat_Ps\romannumeral#4\endcsname #300000.#1#2;%
+}%
+\def\XINT_pfloat_Psi #1#2.#3;{ #3#1.}%
+\def\XINT_pfloat_Psii #1#2#3.#4;{ #4#1#2.}%
+\def\XINT_pfloat_Psiii#1#2#3#4.#5;{ #5#1#2#3.}%
+\def\XINT_pfloat_Psiv #1#2#3#4#5.#6;{ #6#1#2#3#4.}%
+\def\XINT_pfloat_Psv #1#2#3#4#5#6.#7;{ #7#1#2#3#4#5.}%
+\def\XINTinFloatFracdigits {\romannumeral0\XINTinfloatfracdigits }%
+\def\XINTinfloatfracdigits #1%
+{%
+ \expandafter\XINT_infloatfracdg_a\expandafter {\romannumeral0\xinttfrac{#1}}%
+}%
+\def\XINT_infloatfracdg_a {\XINTinfloat [\XINTdigits]}%
\def\xintFloatAdd {\romannumeral0\xintfloatadd }%
\def\xintfloatadd #1{\XINT_fladd_chkopt \xintfloat #1\xint_relax }%
\def\XINTinFloatAdd {\romannumeral0\XINTinfloatadd }%
@@ -2121,46 +2183,41 @@
}%
\def\XINT_fladd_noopt #1#2\xint_relax #3%
{%
- #1[\XINTdigits]{\XINT_FL_Add {\XINTdigits+\xint_c_ii}{#2}{#3}}%
+ #1[\XINTdigits]%
+ {\expandafter\XINT_FL_add_a
+ \romannumeral0\XINTinfloat[\XINTdigits]{#2}\XINTdigits.{#3}}%
}%
-\def\XINT_fladd_opt #1[\xint_relax #2]#3#4%
+\def\XINT_fladd_opt #1[\xint_relax #2]%#3#4%
{%
- #1[#2]{\XINT_FL_Add {#2+\xint_c_ii}{#3}{#4}}%
+ \expandafter\XINT_fladd_opt_a\the\numexpr #2.#1%
}%
-\def\XINT_FL_Add #1#2%
+\def\XINT_fladd_opt_a #1.#2#3#4%
{%
- \expandafter\XINT_FL_Add_a\expandafter{\the\numexpr #1\expandafter}%
- \expandafter{\romannumeral0\XINTinfloat [#1]{#2}}%
+ #2[#1]{\expandafter\XINT_FL_add_a\romannumeral0\XINTinfloat[#1]{#3}#1.{#4}}%
}%
-\def\XINT_FL_Add_a #1#2#3%
+\def\XINT_FL_add_a #1%
{%
- \expandafter\XINT_FL_Add_b\romannumeral0\XINTinfloat [#1]{#3}#2{#1}%
+ \xint_gob_til_zero #1\XINT_FL_add_zero 0\XINT_FL_add_b #1%
}%
-\def\XINT_FL_Add_b #1%
+\def\XINT_FL_add_zero #1.#2{#2}%
+\def\XINT_FL_add_b #1]#2.#3%
{%
- \xint_gob_til_zero #1\XINT_FL_Add_zero 0\XINT_FL_Add_c #1%
+ \expandafter\XINT_FL_add_c\romannumeral0\XINTinfloat[#2]{#3}#2.#1]%
}%
-\def\XINT_FL_Add_c #1[#2]#3%
+\def\XINT_FL_add_c #1%
{%
- \xint_gob_til_zero #3\XINT_FL_Add_zerobis 0\XINT_FL_Add_d #1[#2]#3%
+ \xint_gob_til_zero #1\XINT_FL_add_zero 0\XINT_FL_add_d #1%
}%
-\def\XINT_FL_Add_d #1[#2]#3[#4]#5%
+\def\XINT_FL_add_d #1[#2]#3.#4[#5]%
{%
- \ifnum \numexpr #2-#4-#5>\xint_c_i
- \expandafter \xint_secondofthree_thenstop
- \else
- \ifnum \numexpr #4-#2-#5>\xint_c_i
- \expandafter\expandafter\expandafter\xint_thirdofthree_thenstop
- \fi
- \fi
- \xintadd {#1[#2]}{#3[#4]}%
+ \ifnum\numexpr #2-#3-#5>\xint_c_\xint_dothis\xint_firstoftwo\fi
+ \ifnum\numexpr #5-#3-#2>\xint_c_\xint_dothis\xint_secondoftwo\fi
+ \xint_orthat\xintAdd {#1[#2]}{#4[#5]}%
}%
-\def\XINT_FL_Add_zero 0\XINT_FL_Add_c 0[0]#1[#2]#3{#1[#2]}%
-\def\XINT_FL_Add_zerobis 0\XINT_FL_Add_d #1[#2]0[0]#3{#1[#2]}%
-\def\xintFloatSub {\romannumeral0\xintfloatsub }%
+\def\xintFloatSub {\romannumeral0\xintfloatsub }%
\def\xintfloatsub #1{\XINT_flsub_chkopt \xintfloat #1\xint_relax }%
-\def\XINTinFloatSub {\romannumeral0\XINTinfloatsub }%
-\def\XINTinfloatsub #1{\XINT_flsub_chkopt \XINTinfloat #1\xint_relax }%
+\def\XINTinFloatSub {\romannumeral0\XINTinfloatsub }%
+\def\XINTinfloatsub #1{\XINT_flsub_chkopt \XINTinfloat #1\xint_relax }%
\def\XINT_flsub_chkopt #1#2%
{%
\ifx [#2\expandafter\XINT_flsub_opt
@@ -2169,14 +2226,20 @@
}%
\def\XINT_flsub_noopt #1#2\xint_relax #3%
{%
- #1[\XINTdigits]{\XINT_FL_Add {\XINTdigits+\xint_c_ii}{#2}{\xintOpp{#3}}}%
+ #1[\XINTdigits]%
+ {\expandafter\XINT_FL_add_a
+ \romannumeral0\XINTinfloat[\XINTdigits]{#2}\XINTdigits.{\xintOpp{#3}}}%
+}%
+\def\XINT_flsub_opt #1[\xint_relax #2]%#3#4%
+{%
+ \expandafter\XINT_flsub_opt_a\the\numexpr #2.#1%
}%
-\def\XINT_flsub_opt #1[\xint_relax #2]#3#4%
+\def\XINT_flsub_opt_a #1.#2#3#4%
{%
- #1[#2]{\XINT_FL_Add {#2+\xint_c_ii}{#3}{\xintOpp{#4}}}%
+ #2[#1]{\expandafter\XINT_FL_add_a\romannumeral0\XINTinfloat[#1]{#3}#1.{\xintOpp{#4}}}%
}%
-\def\xintFloatMul {\romannumeral0\xintfloatmul}%
-\def\xintfloatmul #1{\XINT_flmul_chkopt \xintfloat #1\xint_relax }%
+\def\xintFloatMul {\romannumeral0\xintfloatmul }%
+\def\xintfloatmul #1{\XINT_flmul_chkopt \xintfloat #1\xint_relax }%
\def\XINTinFloatMul {\romannumeral0\XINTinfloatmul }%
\def\XINTinfloatmul #1{\XINT_flmul_chkopt \XINTinfloat #1\xint_relax }%
\def\XINT_flmul_chkopt #1#2%
@@ -2187,26 +2250,27 @@
}%
\def\XINT_flmul_noopt #1#2\xint_relax #3%
{%
- #1[\XINTdigits]{\XINT_FL_Mul {\XINTdigits+\xint_c_ii}{#2}{#3}}%
+ #1[\XINTdigits]%
+ {\expandafter\XINT_FL_mul_a
+ \romannumeral0\XINTinfloat[\XINTdigits]{#2}\XINTdigits.{#3}}%
}%
-\def\XINT_flmul_opt #1[\xint_relax #2]#3#4%
+\def\XINT_flmul_opt #1[\xint_relax #2]%#3#4%
{%
- #1[#2]{\XINT_FL_Mul {#2+\xint_c_ii}{#3}{#4}}%
+ \expandafter\XINT_flmul_opt_a\the\numexpr #2.#1%
}%
-\def\XINT_FL_Mul #1#2%
+\def\XINT_flmul_opt_a #1.#2#3#4%
{%
- \expandafter\XINT_FL_Mul_a\expandafter{\the\numexpr #1\expandafter}%
- \expandafter{\romannumeral0\XINTinfloat [#1]{#2}}%
+ #2[#1]{\expandafter\XINT_FL_mul_a\romannumeral0\XINTinfloat[#1]{#3}#1.{#4}}%
}%
-\def\XINT_FL_Mul_a #1#2#3%
+\def\XINT_FL_mul_a #1[#2]#3.#4%
{%
- \expandafter\XINT_FL_Mul_b\romannumeral0\XINTinfloat [#1]{#3}#2%
+ \expandafter\XINT_FL_mul_b\romannumeral0\XINTinfloat [#3]{#4}#1[#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\xint_relax }%
-\def\XINTinFloatDiv {\romannumeral0\XINTinfloatdiv }%
-\def\XINTinfloatdiv #1{\XINT_fldiv_chkopt \XINTinfloat #1\xint_relax }%
+\def\XINT_FL_mul_b #1[#2]#3[#4]{\xintE{\xintiiMul {#3}{#1}}{#4+#2}}%
+\def\xintFloatDiv {\romannumeral0\xintfloatdiv }%
+\def\xintfloatdiv #1{\XINT_fldiv_chkopt \xintfloat #1\xint_relax }%
+\def\XINTinFloatDiv {\romannumeral0\XINTinfloatdiv }%
+\def\XINTinfloatdiv #1{\XINT_fldiv_chkopt \XINTinfloat #1\xint_relax }%
\def\XINT_fldiv_chkopt #1#2%
{%
\ifx [#2\expandafter\XINT_fldiv_opt
@@ -2215,23 +2279,24 @@
}%
\def\XINT_fldiv_noopt #1#2\xint_relax #3%
{%
- #1[\XINTdigits]{\XINT_FL_Div {\XINTdigits+\xint_c_ii}{#2}{#3}}%
+ #1[\XINTdigits]%
+ {\expandafter\XINT_FL_div_a
+ \romannumeral0\XINTinfloat[\XINTdigits]{#2}\XINTdigits.{#3}}%
}%
-\def\XINT_fldiv_opt #1[\xint_relax #2]#3#4%
+\def\XINT_fldiv_opt #1[\xint_relax #2]%#3#4%
{%
- #1[#2]{\XINT_FL_Div {#2+\xint_c_ii}{#3}{#4}}%
+ \expandafter\XINT_fldiv_opt_a\the\numexpr #2.#1%
}%
-\def\XINT_FL_Div #1#2%
+\def\XINT_fldiv_opt_a #1.#2#3#4%
{%
- \expandafter\XINT_FL_Div_a\expandafter{\the\numexpr #1\expandafter}%
- \expandafter{\romannumeral0\XINTinfloat [#1]{#2}}%
+ #2[#1]{\expandafter\XINT_FL_div_a\romannumeral0\XINTinfloat[#1]{#3}#1.{#4}}%
}%
-\def\XINT_FL_Div_a #1#2#3%
+\def\XINT_FL_div_a #1[#2]#3.#4%
{%
- \expandafter\XINT_FL_Div_b\romannumeral0\XINTinfloat [#1]{#3}#2%
+ \expandafter\XINT_FL_div_b\romannumeral0\XINTinfloat[#3]{#4}#1[#2]%
}%
-\def\XINT_FL_Div_b #1[#2]#3[#4]{\xintE{#3/#1}{#4-#2}}%
-\def\xintFloatPow {\romannumeral0\xintfloatpow}%
+\def\XINT_FL_div_b #1[#2]#3[#4]{\xintE{#3/#1}{#4-#2}}%
+\def\xintFloatPow {\romannumeral0\xintfloatpow}%
\def\xintfloatpow #1{\XINT_flpow_chkopt \xintfloat #1\xint_relax }%
\def\XINTinFloatPow {\romannumeral0\XINTinfloatpow }%
\def\XINTinfloatpow #1{\XINT_flpow_chkopt \XINTinfloat #1\xint_relax }%
@@ -2240,253 +2305,302 @@
\ifx [#2\expandafter\XINT_flpow_opt
\else\expandafter\XINT_flpow_noopt
\fi
- #1#2%
+ #1#2%
}%
\def\XINT_flpow_noopt #1#2\xint_relax #3%
{%
- \expandafter\XINT_flpow_checkB_start\expandafter
- {\the\numexpr #3\expandafter}\expandafter
- {\the\numexpr \XINTdigits}{#2}{#1[\XINTdigits]}%
+ \expandafter\XINT_flpow_checkB_a
+ \the\numexpr #3.\XINTdigits.{#2}{#1[\XINTdigits]}%
+}%
+\def\XINT_flpow_opt #1[\xint_relax #2]%
+{%
+ \expandafter\XINT_flpow_opt_a\the\numexpr #2.#1%
}%
-\def\XINT_flpow_opt #1[\xint_relax #2]#3#4%
+\def\XINT_flpow_opt_a #1.#2#3#4%
{%
- \expandafter\XINT_flpow_checkB_start\expandafter
- {\the\numexpr #4\expandafter}\expandafter
- {\the\numexpr #2}{#3}{#1[#2]}%
+ \expandafter\XINT_flpow_checkB_a\the\numexpr #4.#1.{#3}{#2[#1]}%
}%
-\def\XINT_flpow_checkB_start #1{\XINT_flpow_checkB_a #1\Z }%
\def\XINT_flpow_checkB_a #1%
{%
\xint_UDzerominusfork
#1-\XINT_flpow_BisZero
- 0#1{\XINT_flpow_checkB_b 1}%
- 0-{\XINT_flpow_checkB_b 0#1}%
+ 0#1{\XINT_flpow_checkB_b -}%
+ 0-{\XINT_flpow_checkB_b {}#1}%
\krof
}%
-\def\XINT_flpow_BisZero \Z #1#2#3{#3{1/1[0]}}%
-\def\XINT_flpow_checkB_b #1#2\Z #3%
+\def\XINT_flpow_BisZero .#1.#2#3{#3{1[0]}}%
+\def\XINT_flpow_checkB_b #1#2.#3.%
{%
- \expandafter\XINT_flpow_checkB_c \expandafter
- {\romannumeral0\xintlength{#2}}{#3}{#2}#1%
+ \expandafter\XINT_flpow_checkB_c
+ \the\numexpr\xintLength{#2}+\xint_c_iii.#3.#2.{#1}%
}%
-\def\XINT_flpow_checkB_c #1#2%
+\def\XINT_flpow_checkB_c #1.#2.%
{%
- \expandafter\XINT_flpow_checkB_d \expandafter
- {\the\numexpr \expandafter\xintLength\expandafter
- {\the\numexpr #1*20/\xint_c_iii }+#1+#2+\xint_c_i }%
+ \expandafter\XINT_flpow_checkB_d\the\numexpr#1+#2.#1.#2.%
}%
-\def\XINT_flpow_checkB_d #1#2#3#4%
+\def\XINT_flpow_checkB_d #1.#2.#3.#4.#5#6%
{%
- \expandafter \XINT_flpow_a
- \romannumeral0\XINTinfloat [#1]{#4}{#1}{#2}#3%
+ \expandafter \XINT_flpow_aa
+ \romannumeral0\XINTinfloat [#3]{#6}{#2}{#1}{#4}{#5}%
}%
+\def\XINT_flpow_aa #1[#2]#3%
+{%
+ \expandafter\XINT_flpow_ab\the\numexpr #2-#3\expandafter.%
+ \romannumeral0\XINT_dsx_addzerosnofuss {#3}{}.#1.%
+}%
+\def\XINT_flpow_ab #1.#2.#3.{\XINT_flpow_a #3#2[#1]}%
\def\XINT_flpow_a #1%
{%
\xint_UDzerominusfork
#1-\XINT_flpow_zero
- 0#1{\XINT_flpow_b 1}%
- 0-{\XINT_flpow_b 0#1}%
+ 0#1{\XINT_flpow_b \iftrue}%
+ 0-{\XINT_flpow_b \iffalse#1}%
\krof
}%
+\def\XINT_flpow_zero #1[#2]#3#4#5#6%
+{%
+ \if 1#51\xint_afterfi {#6{0[0]}}\else
+ \xint_afterfi {\xintError:DivisionByZero #6{1[2147483648]}}\fi
+}%
\def\XINT_flpow_b #1#2[#3]#4#5%
{%
- \XINT_flpow_loopI {#5}{#2[#3]}{\romannumeral0\XINTinfloatmul [#4]}%
- {#1*\ifodd #5 1\else 0\fi}%
+ \XINT_flpow_loopI #5.#3.#2.#4.{#1\ifodd #5 \xint_c_i\fi\fi}%
}%
-\def\XINT_flpow_zero [#1]#2#3#4#5%
+\def\XINT_flpow_truncate #1.#2.#3.%
{%
- \if #41\xint_afterfi {\xintError:DivisionByZero #5{1[2147483648]}}%
- \else \xint_afterfi {#5{0[0]}}\fi
+ \expandafter\XINT_flpow_truncate_a
+ \romannumeral0\XINT_split_fromleft_loop #3.{}#2\W\W\W\W\W\W\W\W\Z
+ #1.#3.%
}%
-\def\XINT_flpow_loopI #1%
+\def\XINT_flpow_truncate_a #1.#2.#3.{#3+\xintLength{#2}.#1.}%
+\def\XINT_flpow_loopI #1.%
{%
- \ifnum #1=\xint_c_i\XINT_flpow_ItoIII\fi
+ \ifnum #1=\xint_c_i\expandafter\XINT_flpow_ItoIII\fi
\ifodd #1
\expandafter\XINT_flpow_loopI_odd
\else
\expandafter\XINT_flpow_loopI_even
\fi
- {#1}%
+ #1.%
}%
-\def\XINT_flpow_ItoIII\fi #1\fi #2#3#4#5%
+\def\XINT_flpow_ItoIII\ifodd #1\fi #2.#3.#4.#5.#6%
{%
- \fi\expandafter\XINT_flpow_III\the\numexpr #5\relax #3%
+ \expandafter\XINT_flpow_III\the\numexpr #6+\xint_c_.#3.#4.#5.%
}%
-\def\XINT_flpow_loopI_even #1#2#3%
+\def\XINT_flpow_loopI_even #1.#2.#3.%#4.%
{%
- \expandafter\XINT_flpow_loopI\expandafter
- {\the\numexpr #1/\xint_c_ii\expandafter}\expandafter
- {#3{#2}{#2}}{#3}%
+ \expandafter\XINT_flpow_loopI
+ \the\numexpr #1/\xint_c_ii\expandafter.%
+ \the\numexpr\expandafter\XINT_flpow_truncate
+ \the\numexpr\xint_c_ii*#2\expandafter.\romannumeral0\xintiisqr{#3}.%
}%
-\def\XINT_flpow_loopI_odd #1#2#3%
+\def\XINT_flpow_loopI_odd #1.#2.#3.#4.%
{%
- \expandafter\XINT_flpow_loopII\expandafter
- {\the\numexpr #1/\xint_c_ii-\xint_c_i\expandafter}\expandafter
- {#3{#2}{#2}}{#3}{#2}%
+ \expandafter\XINT_flpow_loopII
+ \the\numexpr #1/\xint_c_ii-\xint_c_i\expandafter.%
+ \the\numexpr\expandafter\XINT_flpow_truncate
+ \the\numexpr\xint_c_ii*#2\expandafter.\romannumeral0\xintiisqr{#3}.#4.#2.#3.%
}%
-\def\XINT_flpow_loopII #1%
+\def\XINT_flpow_loopII #1.%
{%
- \ifnum #1 = \xint_c_i\XINT_flpow_IItoIII\fi
+ \ifnum #1 = \xint_c_i\expandafter\XINT_flpow_IItoIII\fi
\ifodd #1
\expandafter\XINT_flpow_loopII_odd
\else
\expandafter\XINT_flpow_loopII_even
\fi
- {#1}%
+ #1.%
}%
-\def\XINT_flpow_loopII_even #1#2#3%
+\def\XINT_flpow_loopII_even #1.#2.#3.%#4.%
{%
- \expandafter\XINT_flpow_loopII\expandafter
- {\the\numexpr #1/\xint_c_ii\expandafter}\expandafter
- {#3{#2}{#2}}{#3}%
+ \expandafter\XINT_flpow_loopII
+ \the\numexpr #1/\xint_c_ii\expandafter.%
+ \the\numexpr\expandafter\XINT_flpow_truncate
+ \the\numexpr\xint_c_ii*#2\expandafter.\romannumeral0\xintiisqr{#3}.%
}%
-\def\XINT_flpow_loopII_odd #1#2#3#4%
+\def\XINT_flpow_loopII_odd #1.#2.#3.#4.#5.#6.%
{%
- \expandafter\XINT_flpow_loopII_odda\expandafter
- {#3{#2}{#4}}{#1}{#2}{#3}%
+ \expandafter\XINT_flpow_loopII_odda
+ \the\numexpr\expandafter\XINT_flpow_truncate
+ \the\numexpr#2+#5\expandafter.\romannumeral0\xintiimul{#3}{#6}.#4.%
+ #1.#2.#3.%
}%
-\def\XINT_flpow_loopII_odda #1#2#3#4%
+\def\XINT_flpow_loopII_odda #1.#2.#3.#4.#5.#6.%
{%
- \expandafter\XINT_flpow_loopII\expandafter
- {\the\numexpr #2/\xint_c_ii-\xint_c_i\expandafter}\expandafter
- {#4{#3}{#3}}{#4}{#1}%
+ \expandafter\XINT_flpow_loopII
+ \the\numexpr #4/\xint_c_ii-\xint_c_i\expandafter.%
+ \the\numexpr\expandafter\XINT_flpow_truncate
+ \the\numexpr\xint_c_ii*#5\expandafter.\romannumeral0\xintiisqr{#6}.#3.%
+ #1.#2.%
}%
-\def\XINT_flpow_IItoIII\fi #1\fi #2#3#4#5#6%
+\def\XINT_flpow_IItoIII\ifodd #1\fi #2.#3.#4.#5.#6.#7.#8%
{%
- \fi\expandafter\XINT_flpow_III\the\numexpr #6\expandafter\relax
- #4{#3}{#5}%
+ \expandafter\XINT_flpow_III\the\numexpr #8+\xint_c_\expandafter.%
+ \the\numexpr\expandafter\XINT_flpow_truncate
+ \the\numexpr#3+#6\expandafter.\romannumeral0\xintiimul{#4}{#7}.#5.%
}%
-\def\XINT_flpow_III #1#2[#3]#4%
+\def\XINT_flpow_III #1.#2.#3.#4.#5%
{%
- \expandafter\XINT_flpow_IIIend\expandafter
- {\the\numexpr\if #41-\fi#3\expandafter}%
- \xint_UDzerofork
- #4{{#2}}%
- 0{{1/#2}}%
+ \expandafter\XINT_flpow_IIIend
+ \xint_UDsignfork
+ #5{{\xintNum{1/#3[\xint_c_ii*#4-\xint_c_i]}[\xint_c_i-\xint_c_ii*#4-#2]}}%
+ -{{#3[#2]}}%
\krof #1%
}%
-\def\XINT_flpow_IIIend #1#2#3#4%
-{%
- \xint_UDzerofork
- #3{#4{#2[#1]}}%
- 0{#4{-#2[#1]}}%
- \krof
-}%
-\def\xintFloatPower {\romannumeral0\xintfloatpower}%
+\def\XINT_flpow_IIIend #1#2#3%
+ {#3{\if#21\xint_afterfi{\expandafter-\romannumeral`&&@}\fi#1}}%
+\def\xintFloatPower {\romannumeral0\xintfloatpower}%
\def\xintfloatpower #1{\XINT_flpower_chkopt \xintfloat #1\xint_relax }%
-\def\XINTinFloatPower {\romannumeral0\XINTinfloatpower}%
+\def\XINTinFloatPower {\romannumeral0\XINTinfloatpower }%
\def\XINTinfloatpower #1{\XINT_flpower_chkopt \XINTinfloat #1\xint_relax }%
+\def\XINTinFloatPowerH {\romannumeral0\XINTinfloatpowerH }%
+\def\XINTinfloatpowerH #1#2%
+ {\expandafter\XINT_flpowerh_a \romannumeral0\xinttrunc 1{#2}.0;%
+ \XINTdigits.{#1}{\XINTinfloat[\XINTdigits]}}%
+\def\XINT_flpowerh_a #1.#2%
+{%
+ \ifnum#2>\xint_c_iv\xint_dothis\XINT_flpowerh_b\fi
+ \xint_orthat\XINT_flpowerh_i #1.#2%
+}%
+\def\XINT_flpowerh_i #1.#2;%
+ {\expandafter\XINT_flpower_checkB_a\romannumeral0\xintinum{#1}.}%
+\def\XINT_flpowerh_b #1%
+{%
+ \if#1-\xint_dothis\XINT_flpowerh_bneg\fi
+ \xint_orthat{\XINT_flpowerh_bpos #1}%
+}%
+\def\XINT_flpowerh_bpos #1.#2;\XINTdigits.#3#4%
+{%
+ \expandafter\XINT_flpower_checkB_a
+ \romannumeral0\xintinc{\xintDouble{#1}}.%
+ \XINTdigits.{#3}{\XINTinfloatsqrt[\XINTdigits]}%
+}%
+\def\XINT_flpowerh_bneg #1.#2;\XINTdigits.#3#4%
+{%
+ \expandafter\XINT_flpower_checkB_a
+ \expandafter-\romannumeral0\xintinc{\xintDouble{#1}}.%
+ \XINTdigits.{#3}{\XINTinfloatsqrt[\XINTdigits]}%
+}%
\def\XINT_flpower_chkopt #1#2%
{%
\ifx [#2\expandafter\XINT_flpower_opt
\else\expandafter\XINT_flpower_noopt
\fi
- #1#2%
+ #1#2%
}%
\def\XINT_flpower_noopt #1#2\xint_relax #3%
{%
- \expandafter\XINT_flpower_checkB_start\expandafter
- {\the\numexpr \XINTdigits\expandafter}\expandafter
- {\romannumeral0\xintnum{#3}}{#2}{#1[\XINTdigits]}%
+ \expandafter\XINT_flpower_checkB_a
+ \romannumeral0\xintnum{#3}.\XINTdigits.{#2}{#1[\XINTdigits]}%
}%
-\def\XINT_flpower_opt #1[\xint_relax #2]#3#4%
+\def\XINT_flpower_opt #1[\xint_relax #2]%
{%
- \expandafter\XINT_flpower_checkB_start\expandafter
- {\the\numexpr #2\expandafter}\expandafter
- {\romannumeral0\xintnum{#4}}{#3}{#1[#2]}%
+ \expandafter\XINT_flpower_opt_a\the\numexpr #2.#1%
+}%
+\def\XINT_flpower_opt_a #1.#2#3#4%
+{%
+ \expandafter\XINT_flpower_checkB_a
+ \romannumeral0\xintnum{#4}.#1.{#3}{#2[#1]}%
}%
-\def\XINT_flpower_checkB_start #1#2{\XINT_flpower_checkB_a #2\Z {#1}}%
\def\XINT_flpower_checkB_a #1%
{%
\xint_UDzerominusfork
#1-\XINT_flpower_BisZero
- 0#1{\XINT_flpower_checkB_b 1}%
- 0-{\XINT_flpower_checkB_b 0#1}%
+ 0#1{\XINT_flpower_checkB_b -}%
+ 0-{\XINT_flpower_checkB_b {}#1}%
\krof
}%
-\def\XINT_flpower_BisZero \Z #1#2#3{#3{1/1[0]}}%
-\def\XINT_flpower_checkB_b #1#2\Z #3%
+\def\XINT_flpower_BisZero .#1.#2#3{#3{1[0]}}%
+\def\XINT_flpower_checkB_b #1#2.#3.%
+{%
+ \expandafter\XINT_flpower_checkB_c
+ \the\numexpr\xintLength{#2}+\xint_c_iii.#3.#2.{#1}%
+}%
+\def\XINT_flpower_checkB_c #1.#2.%
{%
- \expandafter\XINT_flpower_checkB_c \expandafter
- {\romannumeral0\xintlength{#2}}{#3}{#2}#1%
+ \expandafter\XINT_flpower_checkB_d\the\numexpr#1+#2.#1.#2.%
}%
-\def\XINT_flpower_checkB_c #1#2%
+\def\XINT_flpower_checkB_d #1.#2.#3.#4.#5#6%
{%
- \expandafter\XINT_flpower_checkB_d \expandafter
- {\the\numexpr \expandafter\xintLength\expandafter
- {\the\numexpr #1*20/\xint_c_iii }+#1+#2+\xint_c_i }%
+ \expandafter \XINT_flpower_aa
+ \romannumeral0\XINTinfloat [#3]{#6}{#2}{#1}{#4}{#5}%
}%
-\def\XINT_flpower_checkB_d #1#2#3#4%
+\def\XINT_flpower_aa #1[#2]#3%
{%
- \expandafter \XINT_flpower_a
- \romannumeral0\XINTinfloat [#1]{#4}{#1}{#2}#3%
+ \expandafter\XINT_flpower_ab\the\numexpr #2-#3\expandafter.%
+ \romannumeral0\XINT_dsx_addzerosnofuss {#3}{}.#1.%
}%
+\def\XINT_flpower_ab #1.#2.#3.{\XINT_flpower_a #3#2[#1]}%
\def\XINT_flpower_a #1%
{%
\xint_UDzerominusfork
#1-\XINT_flpow_zero
- 0#1{\XINT_flpower_b 1}%
- 0-{\XINT_flpower_b 0#1}%
+ 0#1{\XINT_flpower_b \iftrue}%
+ 0-{\XINT_flpower_b \iffalse#1}%
\krof
}%
\def\XINT_flpower_b #1#2[#3]#4#5%
{%
- \XINT_flpower_loopI {#5}{#2[#3]}{\romannumeral0\XINTinfloatmul [#4]}%
- {#1*\xintiiOdd {#5}}%
+ \XINT_flpower_loopI #5.#3.#2.#4.{#1\xintiiOdd{#5}\fi}%
}%
-\def\XINT_flpower_loopI #1%
+\def\XINT_flpower_loopI #1.%
{%
- \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}}%
+ \if1\XINT_isOne {#1}\xint_dothis\XINT_flpower_ItoIII\fi
+ \if1\xintiiOdd {#1}\xint_dothis{\expandafter\XINT_flpower_loopI_odd}\fi
+ \xint_orthat{\expandafter\XINT_flpower_loopI_even}%
+ \romannumeral0\xinthalf{#1}.%
}%
-\def\XINT_flpower_ItoIII\fi #1\fi\expandafter #2#3#4#5%
+\def\XINT_flpower_ItoIII #1.#2.#3.#4.#5%
{%
- \fi\expandafter\XINT_flpow_III \the\numexpr #5\relax #3%
+ \expandafter\XINT_flpow_III\the\numexpr #5+\xint_c_.#2.#3.#4.%
}%
-\def\XINT_flpower_loopI_even #1#2#3%
+\def\XINT_flpower_loopI_even #1.#2.#3.#4.%
{%
- \expandafter\XINT_flpower_toI\expandafter {#3{#2}{#2}}{#1}{#3}%
+ \expandafter\XINT_flpower_toloopI
+ \the\numexpr\expandafter\XINT_flpow_truncate
+ \the\numexpr\xint_c_ii*#2\expandafter.\romannumeral0\xintiisqr{#3}.#4.#1.%
}%
-\def\XINT_flpower_loopI_odd #1#2#3%
+\def\XINT_flpower_toloopI #1.#2.#3.#4.{\XINT_flpower_loopI #4.#1.#2.#3.}%
+\def\XINT_flpower_loopI_odd #1.#2.#3.#4.%
{%
- \expandafter\XINT_flpower_toII\expandafter {#3{#2}{#2}}{#1}{#3}{#2}%
+ \expandafter\XINT_flpower_toloopII
+ \the\numexpr\expandafter\XINT_flpow_truncate
+ \the\numexpr\xint_c_ii*#2\expandafter.\romannumeral0\xintiisqr{#3}.#4.%
+ #1.#2.#3.%
}%
-\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%
+\def\XINT_flpower_toloopII #1.#2.#3.#4.{\XINT_flpower_loopII #4.#1.#2.#3.}%
+\def\XINT_flpower_loopII #1.%
{%
- \if1\XINT_isOne {#1}\XINT_flpower_IItoIII\fi
- \if1\xintiiOdd{#1}%
- \expandafter\expandafter\expandafter\XINT_flpower_loopII_odd
- \else
- \expandafter\expandafter\expandafter\XINT_flpower_loopII_even
- \fi
- \expandafter {\romannumeral0\xinthalf{#1}}%
+ \if1\XINT_isOne{#1}\xint_dothis\XINT_flpower_IItoIII\fi
+ \if1\xintiiOdd{#1}\xint_dothis{\expandafter\XINT_flpower_loopII_odd}\fi
+ \xint_orthat{\expandafter\XINT_flpower_loopII_even}%
+ \romannumeral0\xinthalf{#1}.%
}%
-\def\XINT_flpower_loopII_even #1#2#3%
+\def\XINT_flpower_loopII_even #1.#2.#3.#4.%
{%
- \expandafter\XINT_flpower_toII\expandafter
- {#3{#2}{#2}}{#1}{#3}%
+ \expandafter\XINT_flpower_toloopII
+ \the\numexpr\expandafter\XINT_flpow_truncate
+ \the\numexpr\xint_c_ii*#2\expandafter.\romannumeral0\xintiisqr{#3}.#4.#1.%
}%
-\def\XINT_flpower_loopII_odd #1#2#3#4%
+\def\XINT_flpower_loopII_odd #1.#2.#3.#4.#5.#6.%
{%
- \expandafter\XINT_flpower_loopII_odda\expandafter
- {#3{#2}{#4}}{#2}{#3}{#1}%
+ \expandafter\XINT_flpower_loopII_odda
+ \the\numexpr\expandafter\XINT_flpow_truncate
+ \the\numexpr#2+#5\expandafter.\romannumeral0\xintiimul{#3}{#6}.#4.%
+ #1.#2.#3.%
}%
-\def\XINT_flpower_loopII_odda #1#2#3#4%
+\def\XINT_flpower_loopII_odda #1.#2.#3.#4.#5.#6.%
{%
- \expandafter\XINT_flpower_toII\expandafter
- {#3{#2}{#2}}{#4}{#3}{#1}%
+ \expandafter\XINT_flpower_toloopII
+ \the\numexpr\expandafter\XINT_flpow_truncate
+ \the\numexpr\xint_c_ii*#5\expandafter.\romannumeral0\xintiisqr{#6}.#3.%
+ #4.#1.#2.%
}%
-\def\XINT_flpower_IItoIII\fi #1\fi\expandafter #2#3#4#5#6%
+\def\XINT_flpower_IItoIII #1.#2.#3.#4.#5.#6.#7%
{%
- \fi\expandafter\XINT_flpow_III\the\numexpr #6\expandafter\relax
- #4{#3}{#5}%
+ \expandafter\XINT_flpow_III\the\numexpr #7+\xint_c_\expandafter.%
+ \the\numexpr\expandafter\XINT_flpow_truncate
+ \the\numexpr#2+#5\expandafter.\romannumeral0\xintiimul{#3}{#6}.#4.%
}%
\def\xintFloatFac {\romannumeral0\xintfloatfac}%
\def\xintfloatfac #1{\XINT_flfac_chkopt \xintfloat #1\xint_relax }%
@@ -2501,53 +2615,63 @@
}%
\def\XINT_flfac_noopt #1#2\xint_relax
{%
- \expandafter\XINT_FL_fac_start\expandafter
- {\the\numexpr \xintNum{#2}}{\XINTdigits}{#1[\XINTdigits]}%
+ \expandafter\XINT_FL_fac_fork_a
+ \the\numexpr \xintNum{#2}.\xint_c_i \XINTdigits\XINT_FL_fac_out{#1[\XINTdigits]}%
}%
-\def\XINT_flfac_opt #1[\xint_relax #2]#3%
+\def\XINT_flfac_opt #1[\xint_relax #2]%
{%
- \expandafter\XINT_FL_fac_start\expandafter
- {\the\numexpr \xintNum{#3}\expandafter}\expandafter{\the\numexpr#2}{#1[#2]}%
+ \expandafter\XINT_flfac_opt_a\the\numexpr #2.#1%
}%
-\def\XINT_FL_fac_start #1%
+\def\XINT_flfac_opt_a #1.#2#3%
{%
- \ifcase\XINT_cntSgn #1\Z
- \expandafter\XINT_FL_fac_iszero
- \or
- \expandafter\XINT_FL_fac_increaseP
- \else
- \expandafter\XINT_FL_fac_isneg
- \fi {#1}%
+ \expandafter\XINT_FL_fac_fork_a\the\numexpr \xintNum{#3}.\xint_c_i {#1}\XINT_FL_fac_out{#2[#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%
+\def\XINT_FL_fac_fork_a #1%
{%
- \expandafter\XINT_FL_fac_fork
- \the\numexpr \xint_c_viii*%
- ((\xint_c_v+#2+\XINT_FL_fac_extradigits #187654321\Z)/\xint_c_viii).%
- #1.%
+ \xint_UDzerominusfork
+ #1-\XINT_FL_fac_iszero
+ 0#1\XINT_FL_fac_isneg
+ 0-{\XINT_FL_fac_fork_b #1}%
+ \krof
}%
-\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%
+\def\XINT_FL_fac_iszero #1.#2#3#4#5{#5{1/1[0]}}%
+\def\XINT_FL_fac_isneg #1.#2#3#4#5{\expandafter\xintError:FactorialOfNegative #5{0/1[0]}}%
+\def\XINT_FL_fac_fork_b #1.%
{%
- \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}%
+ \ifnum #1>\xint_c_x^viii_mone\xint_dothis\XINT_FL_fac_toobig\fi
+ \ifnum #1>\xint_c_x^iv\xint_dothis\XINT_FL_fac_vbig \fi
+ \ifnum #1>465 \xint_dothis\XINT_FL_fac_big\fi
+ \ifnum #1>101 \xint_dothis\XINT_FL_fac_med\fi
+ \xint_orthat\XINT_FL_fac_small
+ #1.%
}%
-\def\XINT_FL_fac_toobig #1.#2.#3#4%
- {\expandafter\xintError:FactorialOfTooBigNumber #4{1/1[0]}}%
+\def\XINT_FL_fac_toobig #1.#2#3#4#5{\expandafter\xintError:TooBigFactorial #5{1/1[0]}}%
+\def\XINT_FL_fac_vbig
+ {\expandafter\XINT_FL_fac_vbigloop_a
+ \the\numexpr \XINT_FL_fac_increaseP \xint_c_i }%
+\def\XINT_FL_fac_big
+ {\expandafter\XINT_FL_fac_bigloop_a
+ \the\numexpr \XINT_FL_fac_increaseP \xint_c_ii }%
+\def\XINT_FL_fac_med
+ {\expandafter\XINT_FL_fac_medloop_a
+ \the\numexpr \XINT_FL_fac_increaseP \xint_c_iii }%
+\def\XINT_FL_fac_small
+ {\expandafter\XINT_FL_fac_smallloop_a
+ \the\numexpr \XINT_FL_fac_increaseP \xint_c_iv }%
+\def\XINT_FL_fac_increaseP #1#2.#3#4%
+{%
+ #2\expandafter.\the\numexpr\xint_c_viii*%
+ ((\xint_c_iv+#4+\expandafter\XINT_FL_fac_countdigits
+ \the\numexpr #2/(#1*#3)\relax 87654321\Z)/\xint_c_viii).%
+}%
+\def\XINT_FL_fac_countdigits #1#2#3#4#5#6#7#8{\XINT_FL_fac_countdone }%
+\def\XINT_FL_fac_countdone #1#2\Z {#1}%
\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.%
+ \XINT_FL_fac_bigloop_a \xint_c_x^iv.#2.%
+ {\expandafter\XINT_FL_fac_vbigloop_loop\the\numexpr 100010001\expandafter.%
\the\numexpr \xint_c_x^viii+#1.}%
}%
\def\XINT_FL_fac_vbigloop_loop #1.#2.%
@@ -2629,8 +2753,7 @@
\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_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
@@ -2691,183 +2814,346 @@
{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 }%
-\def\XINTinfloatsqrt #1{\XINT_flsqrt_chkopt \XINTinfloat #1\xint_relax }%
-\def\XINT_flsqrt_chkopt #1#2%
+\def\xintFloatPFactorial {\romannumeral0\xintfloatpfactorial}%
+\def\xintfloatpfactorial #1{\XINT_flpfac_chkopt \xintfloat #1\xint_relax }%
+\def\XINTinFloatPFactorial {\romannumeral0\XINTinfloatpfactorial }%
+\def\XINTinfloatpfactorial #1{\XINT_flpfac_chkopt \XINTinfloat #1\xint_relax }%
+\def\XINT_flpfac_chkopt #1#2%
{%
- \ifx [#2\expandafter\XINT_flsqrt_opt
- \else\expandafter\XINT_flsqrt_noopt
- \fi #1#2%
+ \ifx [#2\expandafter\XINT_flpfac_opt
+ \else\expandafter\XINT_flpfac_noopt
+ \fi
+ #1#2%
}%
-\def\XINT_flsqrt_noopt #1#2\xint_relax
+\def\XINT_flpfac_noopt #1#2\xint_relax #3%
{%
- #1[\XINTdigits]{\XINT_FL_sqrt \XINTdigits {#2}}%
+ \expandafter\XINT_FL_pfac_fork
+ \the\numexpr \xintNum{#2}\expandafter.%
+ \the\numexpr \xintNum{#3}.\xint_c_i{\XINTdigits}{#1[\XINTdigits]}%
}%
-\def\XINT_flsqrt_opt #1[\xint_relax #2]#3%
+\def\XINT_flpfac_opt #1[\xint_relax #2]%
{%
- #1[#2]{\XINT_FL_sqrt {#2}{#3}}%
+ \expandafter\XINT_flpfac_opt_b\the\numexpr #2.#1%
}%
-\def\XINT_FL_sqrt #1%
+\def\XINT_flpfac_opt_b #1.#2#3#4%
{%
- \ifnum\numexpr #1<\xint_c_xviii
- \xint_afterfi {\XINT_FL_sqrt_a\xint_c_xviii}%
- \else
- \xint_afterfi {\XINT_FL_sqrt_a {#1+\xint_c_i}}%
- \fi
+ \expandafter\XINT_FL_pfac_fork
+ \the\numexpr \xintNum{#3}\expandafter.%
+ \the\numexpr \xintNum{#4}.\xint_c_i{#1}{#2[#1]}%
}%
-\def\XINT_FL_sqrt_a #1#2%
+\def\XINT_FL_pfac_fork #1#2.#3.%
{%
- \expandafter\XINT_FL_sqrt_checkifzeroorneg
- \romannumeral0\XINTinfloat [#1]{#2}%
+ \if-#1\xint_dothis\XINT_FL_pfac_outofrange\fi
+ \ifnum #1#2=#3 \xint_dothis\XINT_FL_pfac_one\fi
+ \ifnum #1#2>#3 \xint_dothis\XINT_FL_pfac_outofrange\fi
+ \ifnum #3>\xint_c_x^viii_mone
+ \xint_dothis\XINT_FL_pfac_outofrange\fi
+ \xint_orthat \XINT_FL_pfac_increaseP #1#2.#3.%
}%
-\def\XINT_FL_sqrt_checkifzeroorneg #1%
+\def\XINT_FL_pfac_outofrange #1.#2.#3#4#5{\xintError:OutOfRangePFac #5{0/1[0]}}%
+\def\XINT_FL_pfac_one #1.#2.#3#4#5{#5{1/1[0]}}%
+\def\XINT_FL_pfac_increaseP #1.#2.#3#4%
{%
- \xint_UDzerominusfork
- #1-\XINT_FL_sqrt_iszero
- 0#1\XINT_FL_sqrt_isneg
- 0-{\XINT_FL_sqrt_b #1}%
- \krof
+ \expandafter\XINT_FL_pfac_a
+ \the\numexpr \xint_c_viii*((\xint_c_iv+#4+\expandafter
+ \XINT_FL_fac_countdigits\the\numexpr (#2-#1-\xint_c_i)%
+ /\ifnum #2>\xint_c_x^iv #3\else(#3*\xint_c_ii)\fi\relax
+ 87654321\Z)/\xint_c_viii).#1.#2.%
}%
-\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]%
+\def\XINT_FL_pfac_a #1.#2.#3.%
{%
- \ifodd #2
- \xint_afterfi{\XINT_FL_sqrt_c 01}%
- \else
- \xint_afterfi{\XINT_FL_sqrt_c {}0}%
- \fi
- {#1}{#2}%
+ \expandafter\XINT_FL_pfac_b\the\numexpr \xint_c_i+#2\expandafter.%
+ \the\numexpr#3\expandafter.%
+ \romannumeral0\XINT_FL_pfac_addzeroes #1.100000001!1\Z![-#1]%
}%
-\def\XINT_FL_sqrt_c #1#2#3#4%
+\def\XINT_FL_pfac_addzeroes #1.%
{%
- \expandafter\XINT_flsqrt\expandafter {\the\numexpr #4-#2}{#3#1}%
+ \ifnum #1=\xint_c_viii \expandafter\XINT_FL_pfac_addzeroes_exit\fi
+ \expandafter\XINT_FL_pfac_addzeroes\the\numexpr #1-\xint_c_viii.100000000!%
}%
-\def\XINT_flsqrt #1#2%
+\def\XINT_FL_pfac_addzeroes_exit #1.{ }%
+\def\XINT_FL_pfac_b #1.%
{%
- \expandafter\XINT_sqrt_a
- \expandafter{\romannumeral0\xintlength {#2}}\XINT_flsqrt_big_d {#2}{#1}%
+ \ifnum #1>9999 \xint_dothis\XINT_FL_pfac_vbigloop \fi
+ \ifnum #1>463 \xint_dothis\XINT_FL_pfac_bigloop \fi
+ \ifnum #1>98 \xint_dothis\XINT_FL_pfac_medloop \fi
+ \xint_orthat\XINT_FL_pfac_smallloop #1.%
}%
-\def\XINT_flsqrt_big_d #1#2%
+\def\XINT_FL_pfac_smallloop #1.#2.%
{%
- \ifodd #2
- \expandafter\expandafter\expandafter\XINT_flsqrt_big_eB
- \else
- \expandafter\expandafter\expandafter\XINT_flsqrt_big_eA
- \fi
- \expandafter {\the\numexpr (#2-\xint_c_i)/\xint_c_ii }{#1}%
+ \ifcase\numexpr #2-#1\relax
+ \expandafter\XINT_FL_pfac_end_
+ \or \expandafter\XINT_FL_pfac_end_i
+ \or \expandafter\XINT_FL_pfac_end_ii
+ \or \expandafter\XINT_FL_pfac_end_iii
+ \else\expandafter\XINT_FL_pfac_smallloop_a
+ \fi #1.#2.%
}%
-\def\XINT_flsqrt_big_eA #1#2#3%
+\def\XINT_FL_pfac_smallloop_a #1.#2.%
{%
- \XINT_flsqrt_big_eA_a #3\Z {#2}{#1}{#3}%
+ \expandafter\XINT_FL_pfac_smallloop_b
+ \the\numexpr #1+\xint_c_iv\expandafter.%
+ \the\numexpr #2\expandafter.%
+ \romannumeral0\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_flsqrt_big_eA_a #1#2#3#4#5#6#7#8#9\Z
+\def\XINT_FL_pfac_smallloop_b #1.%
{%
- \XINT_flsqrt_big_eA_b {#1#2#3#4#5#6#7#8}%
+ \ifnum #1>98 \expandafter\XINT_FL_pfac_medloop \else
+ \expandafter\XINT_FL_pfac_smallloop \fi #1.%
}%
-\def\XINT_flsqrt_big_eA_b #1#2%
+\def\XINT_FL_pfac_medloop #1.#2.%
{%
- \expandafter\XINT_flsqrt_big_f
- \romannumeral0\XINT_flsqrt_small_e {#2001}{#1}%
+ \ifcase\numexpr #2-#1\relax
+ \expandafter\XINT_FL_pfac_end_
+ \or \expandafter\XINT_FL_pfac_end_i
+ \or \expandafter\XINT_FL_pfac_end_ii
+ \else\expandafter\XINT_FL_pfac_medloop_a
+ \fi #1.#2.%
}%
-\def\XINT_flsqrt_big_eB #1#2#3%
+\def\XINT_FL_pfac_medloop_a #1.#2.%
{%
- \XINT_flsqrt_big_eB_a #3\Z {#2}{#1}{#3}%
+ \expandafter\XINT_FL_pfac_medloop_b
+ \the\numexpr #1+\xint_c_iii\expandafter.%
+ \the\numexpr #2\expandafter.%
+ \romannumeral0\expandafter\XINT_FL_fac_mul
+ \the\numexpr \xint_c_x^viii+#1*(#1+\xint_c_i)*(#1+\xint_c_ii)!%
}%
-\def\XINT_flsqrt_big_eB_a #1#2#3#4#5#6#7#8#9%
+\def\XINT_FL_pfac_medloop_b #1.%
{%
- \XINT_flsqrt_big_eB_b {#1#2#3#4#5#6#7#8#9}%
+ \ifnum #1>463 \expandafter\XINT_FL_pfac_bigloop \else
+ \expandafter\XINT_FL_pfac_medloop \fi #1.%
}%
-\def\XINT_flsqrt_big_eB_b #1#2\Z #3%
+\def\XINT_FL_pfac_bigloop #1.#2.%
{%
- \expandafter\XINT_flsqrt_big_f
- \romannumeral0\XINT_flsqrt_small_e {#30001}{#1}%
+ \ifcase\numexpr #2-#1\relax
+ \expandafter\XINT_FL_pfac_end_
+ \or \expandafter\XINT_FL_pfac_end_i
+ \else\expandafter\XINT_FL_pfac_bigloop_a
+ \fi #1.#2.%
}%
-\def\XINT_flsqrt_small_e #1#2%
+\def\XINT_FL_pfac_bigloop_a #1.#2.%
{%
- \expandafter\XINT_flsqrt_small_f\expandafter
- {\the\numexpr #1*#1-#2-\xint_c_i}{#1}%
+ \expandafter\XINT_FL_pfac_bigloop_b
+ \the\numexpr #1+\xint_c_ii\expandafter.%
+ \the\numexpr #2\expandafter.%
+ \romannumeral0\expandafter\XINT_FL_fac_mul
+ \the\numexpr \xint_c_x^viii+#1*(#1+\xint_c_i)!%
}%
-\def\XINT_flsqrt_small_f #1#2%
+\def\XINT_FL_pfac_bigloop_b #1.%
{%
- \expandafter\XINT_flsqrt_small_g\expandafter
- {\the\numexpr (#1+#2)/(2*#2)-\xint_c_i }{#1}{#2}%
+ \ifnum #1>9999 \expandafter\XINT_FL_pfac_vbigloop \else
+ \expandafter\XINT_FL_pfac_bigloop \fi #1.%
}%
-\def\XINT_flsqrt_small_g #1%
+\def\XINT_FL_pfac_vbigloop #1.#2.%
{%
- \ifnum #1>\xint_c_
- \expandafter\XINT_flsqrt_small_h
- \else
- \expandafter\XINT_flsqrt_small_end
- \fi
- {#1}%
+ \ifnum #2=#1
+ \expandafter\XINT_FL_pfac_end_
+ \else\expandafter\XINT_FL_pfac_vbigloop_a
+ \fi #1.#2.%
+}%
+\def\XINT_FL_pfac_vbigloop_a #1.#2.%
+{%
+ \expandafter\XINT_FL_pfac_vbigloop
+ \the\numexpr #1+\xint_c_i\expandafter.%
+ \the\numexpr #2\expandafter.%
+ \romannumeral0\expandafter\XINT_FL_fac_mul
+ \the\numexpr\xint_c_x^viii+#1!%
}%
-\def\XINT_flsqrt_small_h #1#2#3%
+\def\XINT_FL_pfac_end_iii #1.#2.%
{%
- \expandafter\XINT_flsqrt_small_f\expandafter
- {\the\numexpr #2-\xint_c_ii*#1*#3+#1*#1\expandafter}\expandafter
- {\the\numexpr #3-#1}%
+ \expandafter\XINT_FL_fac_out
+ \romannumeral0\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_flsqrt_small_end #1#2#3%
+\def\XINT_FL_pfac_end_ii #1.#2.%
{%
- \expandafter\space\expandafter
- {\the\numexpr \xint_c_i+#3*\xint_c_x^iv-
- (#2*\xint_c_x^iv+#3)/(\xint_c_ii*#3)}%
+ \expandafter\XINT_FL_fac_out
+ \romannumeral0\expandafter\XINT_FL_fac_mul
+ \the\numexpr \xint_c_x^viii+#1*(#1+\xint_c_i)*(#1+\xint_c_ii)!%
}%
-\def\XINT_flsqrt_big_f #1%
+\def\XINT_FL_pfac_end_i #1.#2.%
{%
- \expandafter\XINT_flsqrt_big_fa\expandafter
- {\romannumeral0\xintiisqr {#1}}{#1}%
+ \expandafter\XINT_FL_fac_out
+ \romannumeral0\expandafter\XINT_FL_fac_mul
+ \the\numexpr \xint_c_x^viii+#1*(#1+\xint_c_i)!%
}%
-\def\XINT_flsqrt_big_fa #1#2#3#4%
+\def\XINT_FL_pfac_end_ #1.#2.%
{%
- \expandafter\XINT_flsqrt_big_fb\expandafter
- {\romannumeral0\XINT_dsx_addzerosnofuss
- {\numexpr #3-\xint_c_viii\relax}{#2}}%
- {\romannumeral0\xintiisub
- {\XINT_dsx_addzerosnofuss
- {\numexpr \xint_c_ii*(#3-\xint_c_viii)\relax}{#1}}{#4}}%
- {#3}%
+ \expandafter\XINT_FL_fac_out
+ \romannumeral0\expandafter\XINT_FL_fac_mul
+ \the\numexpr \xint_c_x^viii+#1!%
}%
-\def\XINT_flsqrt_big_fb #1#2%
+\def\xintFloatBinomial {\romannumeral0\xintfloatbinomial}%
+\def\xintfloatbinomial #1{\XINT_flbinom_chkopt \xintfloat #1\xint_relax }%
+\def\XINTinFloatBinomial {\romannumeral0\XINTinfloatbinomial }%
+\def\XINTinfloatbinomial #1{\XINT_flbinom_chkopt \XINTinfloat #1\xint_relax }%
+\def\XINT_flbinom_chkopt #1#2%
{%
- \expandafter\XINT_flsqrt_big_g\expandafter {#2}{#1}%
+ \ifx [#2\expandafter\XINT_flbinom_opt
+ \else\expandafter\XINT_flbinom_noopt
+ \fi #1#2%
}%
-\def\XINT_flsqrt_big_g #1#2%
+\def\XINT_flbinom_noopt #1#2\xint_relax #3%
{%
- \expandafter\XINT_flsqrt_big_j
- \romannumeral0\xintiidivision
- {#1}{\romannumeral0\XINT_dbl_pos #2\Z}{#2}%
+ \expandafter\XINT_FL_binom_a
+ \the\numexpr\xintNum{#2}\expandafter.\the\numexpr\xintNum{#3}.\XINTdigits.#1%
}%
-\def\XINT_flsqrt_big_j #1%
+\def\XINT_flbinom_opt #1[\xint_relax #2]#3#4%
{%
- \if0\XINT_Sgn #1\Z
- \expandafter \XINT_flsqrt_big_end_a
- \else \expandafter \XINT_flsqrt_big_k
- \fi {#1}%
+ \expandafter\XINT_FL_binom_a
+ \the\numexpr\xintNum{#3}\expandafter.\the\numexpr\xintNum{#4}\expandafter.%
+ \the\numexpr #2.#1%
+}%
+\def\XINT_FL_binom_a #1.#2.%
+{%
+ \expandafter\XINT_FL_binom_fork \the\numexpr #1-#2.#2.#1.%
+}%
+\def\XINT_FL_binom_fork #1#2.#3#4.#5.%
+{%
+ \if-#1\xint_dothis \XINT_FL_binom_outofrange\fi
+ \if-#3\xint_dothis \XINT_FL_binom_outofrange\fi
+ \if0#1\xint_dothis \XINT_FL_binom_one\fi
+ \if0#3\xint_dothis \XINT_FL_binom_one\fi
+ \ifnum #5>\xint_c_x^viii_mone \xint_dothis\XINT_FL_binom_outofrange\fi
+ \ifnum #1#2>#3#4 \xint_dothis\XINT_FL_binom_ab \fi
+ \xint_orthat\XINT_FL_binom_aa
+ #1#2.#3#4.#5.%
+}%
+\def\XINT_FL_binom_outofrange #1.#2.#3.#4.#5%
+ {\xintError:OutOfRangeBinomial #5[#4]{0/1[0]}}%
+\def\XINT_FL_binom_one #1.#2.#3.#4.#5{#5[#4]{1/1[0]}}%
+\def\XINT_FL_binom_aa #1.#2.#3.#4.#5%
+{%
+ #5[#4]{\xintDiv{\XINT_FL_pfac_increaseP
+ #2.#3.\xint_c_iv{#4+\xint_c_i}{\XINTinfloat[#4+\xint_c_iii]}}%
+ {\XINT_FL_fac_fork_b
+ #1.\xint_c_iv{#4+\xint_c_i}\XINT_FL_fac_out{\XINTinfloat[#4+\xint_c_iii]}}}%
+}%
+\def\XINT_FL_binom_ab #1.#2.#3.#4.#5%
+{%
+ #5[#4]{\xintDiv{\XINT_FL_pfac_increaseP
+ #1.#3.\xint_c_iv{#4+\xint_c_i}{\XINTinfloat[#4+\xint_c_iii]}}%
+ {\XINT_FL_fac_fork_b
+ #2.\xint_c_iv{#4+\xint_c_i}\XINT_FL_fac_out{\XINTinfloat[#4+\xint_c_iii]}}}%
+}%
+\def\xintFloatSqrt {\romannumeral0\xintfloatsqrt }%
+\def\xintfloatsqrt #1{\XINT_flsqrt_chkopt \xintfloat #1\xint_relax }%
+\def\XINTinFloatSqrt {\romannumeral0\XINTinfloatsqrt }%
+\def\XINTinfloatsqrt #1{\XINT_flsqrt_chkopt \XINTinfloat #1\xint_relax }%
+\def\XINT_flsqrt_chkopt #1#2%
+{%
+ \ifx [#2\expandafter\XINT_flsqrt_opt
+ \else\expandafter\XINT_flsqrt_noopt
+ \fi #1#2%
+}%
+\def\XINT_flsqrt_noopt #1#2\xint_relax
+{%
+ \expandafter\XINT_FL_sqrt_a
+ \romannumeral0\XINTinfloat[\XINTdigits]{#2}\XINTdigits.#1%
+}%
+\def\XINT_flsqrt_opt #1[\xint_relax #2]%#3%
+{%
+ \expandafter\XINT_flsqrt_opt_a\the\numexpr #2.#1%
+}%
+\def\XINT_flsqrt_opt_a #1.#2#3%
+{%
+ \expandafter\XINT_FL_sqrt_a\romannumeral0\XINTinfloat[#1]{#3}#1.#2%
+}%
+\def\XINT_FL_sqrt_a #1%
+{%
+ \xint_UDzerominusfork
+ #1-\XINT_FL_sqrt_iszero
+ 0#1\XINT_FL_sqrt_isneg
+ 0-{\XINT_FL_sqrt_pos #1}%
+ \krof
+}%[
+\def\XINT_FL_sqrt_iszero #1]#2.#3{#3[#2]{0[0]}}%
+\def\XINT_FL_sqrt_isneg #1]#2.#3{\xintError:RootOfNegative #3[#2]{0[0]}}%
+\def\XINT_FL_sqrt_pos #1[#2]#3.%
+{%
+ \expandafter\XINT_flsqrt
+ \the\numexpr #3\ifodd #2 \xint_dothis {+\xint_c_iii.(#2+\xint_c_i).0}\fi
+ \xint_orthat {+\xint_c_ii.#2.{}}#100.#3.%
}%
-\def\XINT_flsqrt_big_k #1#2#3%
+\def\XINT_flsqrt #1.#2.%
{%
- \expandafter\XINT_flsqrt_big_l\expandafter
- {\romannumeral0\xintiisub {#3}{#1}}%
- {\romannumeral0\xintiiadd {#2}{\romannumeral0\XINT_sqr #1\Z}}%
+ \expandafter\XINT_flsqrt_a
+ \the\numexpr #2/\xint_c_ii-(#1-\xint_c_i)/\xint_c_ii.#1.%
}%
-\def\XINT_flsqrt_big_l #1#2%
+\def\XINT_flsqrt_a #1.#2.#3#4.#5.%
{%
- \expandafter\XINT_flsqrt_big_g\expandafter
- {#2}{#1}%
+ \expandafter\XINT_flsqrt_b
+ \the\numexpr (#2-\xint_c_i)/\xint_c_ii\expandafter.%
+ \romannumeral0\XINT_sqrt_start #2.#4#3.#5.#2.#4#3.#5.#1.%
}%
-\def\XINT_flsqrt_big_end_a #1#2#3#4#5%
+\def\XINT_flsqrt_b #1.#2#3%
{%
- \expandafter\XINT_flsqrt_big_end_b\expandafter
- {\the\numexpr -#4+#5/\xint_c_ii\expandafter}\expandafter
- {\romannumeral0\xintiisub
- {\XINT_dsx_addzerosnofuss {#4}{#3}}%
- {\xintHalf{\xintiiQuo{\XINT_dsx_addzerosnofuss {#4}{#2}}{#3}}}}%
+ \expandafter\XINT_flsqrt_c
+ \romannumeral0\xintiisub
+ {\XINT_dsx_addzerosnofuss {#1}{#2}}%
+ {\xintiiDivRound{\XINT_dsx_addzerosnofuss {#1}{#3}}{\XINT_dbl_pos#2\Z}}.%
}%
-\def\XINT_flsqrt_big_end_b #1#2{#2[#1]}%
+\def\XINT_flsqrt_c #1.#2.%
+{%
+ \expandafter\XINT_flsqrt_d
+ \romannumeral0\XINT_split_fromleft_loop #2.{}#1\W\W\W\W\W\W\W\W\Z
+}%
+\def\XINT_flsqrt_d #1.#2#3.%
+{%
+ \ifnum #2=\xint_c_v
+ \expandafter\XINT_flsqrt_f\else\expandafter\XINT_flsqrt_finish\fi
+ #2#3.#1.%
+}%
+\def\XINT_flsqrt_finish #1#2.#3.#4.#5.#6.#7.#8{#8[#6]{#3#1[#7]}}%
+\def\XINT_flsqrt_f 5#1.%
+ {\xintiiifGt{\xintiNum{#1}}{2}{\XINT_flsqrt_finish 5.}{\XINT_flsqrt_again}}%
+\def\XINT_flsqrt_again #1.#2.%
+{%
+ \expandafter\XINT_flsqrt_again_a\the\numexpr #2+\xint_c_viii.%
+}%
+\def\XINT_flsqrt_again_a #1.#2.#3.%
+{%
+ \expandafter\XINT_flsqrt_b
+ \the\numexpr (#1-\xint_c_i)/\xint_c_ii\expandafter.%
+ \romannumeral0\XINT_sqrt_start #1.#200000000.#3.%
+ #1.#200000000.#3.%
+}%
+\def\xintFloatE {\romannumeral0\xintfloate }%
+\def\xintfloate #1{\XINT_floate_chkopt #1\xint_relax }%
+\def\XINT_floate_chkopt #1%
+{%
+ \ifx [#1\expandafter\XINT_floate_opt
+ \else\expandafter\XINT_floate_noopt
+ \fi #1%
+}%
+\def\XINT_floate_noopt #1\xint_relax
+{%
+ \expandafter\XINT_floate_a\expandafter\XINTdigits
+ \romannumeral0\XINT_infrac {#1}%
+}%
+\def\XINT_floate_opt [\xint_relax #1]#2%
+{%
+ \expandafter\XINT_floate_a\expandafter
+ {\the\numexpr #1\expandafter}\romannumeral0\XINT_infrac {#2}%
+}%
+\def\XINT_floate_a #1#2#3#4#5%
+{%
+ \expandafter\XINT_float_a\the\numexpr#1\expandafter.%
+ \expandafter{\the\numexpr #2+#5}{#3}{#4}\XINT_float_Q
+}%
+\def\XINTinFloatE {\romannumeral0\XINTinfloate }%
+\def\XINTinfloate
+ {\expandafter\XINT_infloate\romannumeral0\XINTinfloat [\XINTdigits]}%
+\def\XINT_infloate #1[#2]#3%
+ {\expandafter\XINT_infloate_end\the\numexpr #3+#2.{#1}}%
+\def\XINT_infloate_end #1.#2{ #2[#1]}%
+\def\XINTinFloatMod {\romannumeral0\XINTinfloatmod [\XINTdigits]}%
+\def\XINTinfloatmod [#1]#2#3{\expandafter\XINT_infloatmod\expandafter
+ {\romannumeral0\XINTinfloat[#1]{#2}}%
+ {\romannumeral0\XINTinfloat[#1]{#3}}{#1}}%
+\def\XINT_infloatmod #1#2{\expandafter\XINT_infloatmod_a\expandafter {#2}{#1}}%
+\def\XINT_infloatmod_a #1#2#3{\XINTinfloat [#3]{\xintMod {#2}{#1}}}%
\XINT_restorecatcodes_endinput%
\endinput
%%