summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-04-30 22:39:09 +0000
committerKarl Berry <karl@freefriends.org>2018-04-30 22:39:09 +0000
commita28e1bfccd6fe522fcd296426e4d89c7fb4f19b6 (patch)
treeb72347e08575b56fcfed87c4d837b48dcfd1e02a /Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx
parentb40c37a9e22b8235ff9c0bc256d00f7af94304c3 (diff)
l3 (30apr18)
git-svn-id: svn://tug.org/texlive/trunk@47516 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx')
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx234
1 files changed, 119 insertions, 115 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx
index 347172c2a1f..76948f5a45c 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx
@@ -38,7 +38,7 @@
% {latex-team@latex-project.org}^^A
% }^^A
% }
-% \date{Released 2018/03/05}
+% \date{Released 2018-04-30}
%
% \maketitle
%
@@ -110,7 +110,7 @@
% opposite signs, shift the significand of the smaller one to match the
% bigger one, perform the addition or subtraction of significands,
% check for a carry, round, and pack using the
-% \cs[no-index]{__fp_basics_pack_\ldots{}} functions.
+% \cs[no-index]{@@_basics_pack_\ldots{}} functions.
% \end{itemize}
% The trickiest part is to round correctly when adding or subtracting
% normal floating point numbers.
@@ -139,7 +139,7 @@
% the second operand's sign should be changed. If the
% \meta{types} |#2| and |#4| are the same, dispatch to case |#2| ($0$,
% $1$, $2$, or $3$), where we call specialized functions: thanks to
-% \cs{__int_value:w}, those receive the tweaked \meta{sign_2}
+% \cs{int_value:w}, those receive the tweaked \meta{sign_2}
% (expansion of |#1#5|) as an argument. If the \meta{types} are
% distinct, the result is simply the floating point number with the
% highest \meta{type}. Since case $3$ (used for two \texttt{nan})
@@ -162,11 +162,11 @@
\fi:
\fi:
\exp_stop_f:
- \exp_after:wN \@@_add_zeros_o:Nww \__int_value:w
- \or: \exp_after:wN \@@_add_normal_o:Nww \__int_value:w
- \or: \exp_after:wN \@@_add_inf_o:Nww \__int_value:w
+ \exp_after:wN \@@_add_zeros_o:Nww \int_value:w
+ \or: \exp_after:wN \@@_add_normal_o:Nww \int_value:w
+ \or: \exp_after:wN \@@_add_inf_o:Nww \int_value:w
\or: \@@_case_return_i_o:ww
- \else: \exp_after:wN \@@_add_return_ii_o:Nww \__int_value:w
+ \else: \exp_after:wN \@@_add_return_ii_o:Nww \int_value:w
\fi:
#1 #5
\s_@@ \@@_chk:w #2 #3 ;
@@ -261,7 +261,7 @@
% \meta{body_2} |;|
% \end{quote}
% Since we are doing an addition, the final sign is \meta{sign_1}.
-% Start an \cs{__int_eval:w}, responsible for computing the exponent:
+% Start an \cs{@@_int_eval:w}, responsible for computing the exponent:
% the result, and the \meta{final sign} are then given to
% \cs{@@_sanitize:Nw} which checks for overflow. The exponent is
% computed as the largest exponent |#2| or |#5|, incremented if there
@@ -275,15 +275,15 @@
{
\exp_after:wN \@@_sanitize:Nw
\exp_after:wN #1
- \__int_value:w \__int_eval:w
+ \int_value:w \@@_int_eval:w
\if_int_compare:w #2 > #5 \exp_stop_f:
#2
- \exp_after:wN \@@_add_big_i_o:wNww \__int_value:w -
+ \exp_after:wN \@@_add_big_i_o:wNww \int_value:w -
\else:
#5
- \exp_after:wN \@@_add_big_ii_o:wNww \__int_value:w
+ \exp_after:wN \@@_add_big_ii_o:wNww \int_value:w
\fi:
- \__int_eval:w #5 - #2 ; #1 #3;
+ \@@_int_eval:w #5 - #2 ; #1 #3;
}
% \end{macrocode}
% \end{macro}
@@ -340,9 +340,9 @@
\cs_new:Npn \@@_add_significand_o:NnnwnnnnN #1 #2#3 #4; #5#6#7#8
{
\exp_after:wN \@@_add_significand_test_o:N
- \__int_value:w \__int_eval:w 1#5#6 + #2
+ \int_value:w \@@_int_eval:w 1#5#6 + #2
\exp_after:wN \@@_add_significand_pack:NNNNNNN
- \__int_value:w \__int_eval:w 1#7#8 + #3 ; #1
+ \int_value:w \@@_int_eval:w 1#7#8 + #3 ; #1
}
\cs_new:Npn \@@_add_significand_pack:NNNNNNN #1 #2#3#4#5#6#7
{
@@ -377,9 +377,9 @@
#1; #2; #3#4 ; #5#6
{
\exp_after:wN \@@_basics_pack_high:NNNNNw
- \__int_value:w \__int_eval:w 1 #1
+ \int_value:w \@@_int_eval:w 1 #1
\exp_after:wN \@@_basics_pack_low:NNNNNw
- \__int_value:w \__int_eval:w 1 #2 #3#4
+ \int_value:w \@@_int_eval:w 1 #2 #3#4
+ \@@_round:NNN #6 #4 #5
\exp_after:wN ;
}
@@ -400,13 +400,13 @@
{
+ 1
\exp_after:wN \@@_basics_pack_weird_high:NNNNNNNNw
- \__int_value:w \__int_eval:w 1 1 #1
+ \int_value:w \@@_int_eval:w 1 1 #1
\exp_after:wN \@@_basics_pack_weird_low:NNNNw
- \__int_value:w \__int_eval:w 1 #2#3 +
+ \int_value:w \@@_int_eval:w 1 #2#3 +
\exp_after:wN \@@_round:NNN
\exp_after:wN #6
\exp_after:wN #3
- \__int_value:w \@@_round_digit:Nw #4 #5 ;
+ \int_value:w \@@_round_digit:Nw #4 #5 ;
\exp_after:wN ;
}
% \end{macrocode}
@@ -443,7 +443,7 @@
\cs_new:Npn \@@_sub_npos_ii_o:Nnwnw #1 #2; #3;
{
\exp_after:wN \@@_sub_npos_i_o:Nnwnw
- \__int_value:w \@@_neg_sign:N #1
+ \int_value:w \@@_neg_sign:N #1
#3; #2;
}
% \end{macrocode}
@@ -465,13 +465,13 @@
{
\exp_after:wN \@@_sanitize:Nw
\exp_after:wN #1
- \__int_value:w \__int_eval:w
+ \int_value:w \@@_int_eval:w
#2
\if_int_compare:w #2 = #4 \exp_stop_f:
\exp_after:wN \@@_sub_back_near_o:nnnnnnnnN
\else:
\exp_after:wN \@@_decimate:nNnnnn \exp_after:wN
- { \__int_value:w \__int_eval:w #2 - #4 - 1 \exp_after:wN }
+ { \int_value:w \@@_int_eval:w #2 - #4 - 1 \exp_after:wN }
\exp_after:wN \@@_sub_back_far_o:NnnwnnnnN
\fi:
#5
@@ -500,9 +500,9 @@
\cs_new:Npn \@@_sub_back_near_o:nnnnnnnnN #1#2#3#4 #5#6#7#8 #9
{
\exp_after:wN \@@_sub_back_near_after:wNNNNw
- \__int_value:w \__int_eval:w 10#5#6 - #1#2 - 11
+ \int_value:w \@@_int_eval:w 10#5#6 - #1#2 - 11
\exp_after:wN \@@_sub_back_near_pack:NNNNNNw
- \__int_value:w \__int_eval:w 11#7#8 - #3#4 \exp_after:wN ;
+ \int_value:w \@@_int_eval:w 11#7#8 - #3#4 \exp_after:wN ;
}
\cs_new:Npn \@@_sub_back_near_pack:NNNNNNw #1#2#3#4#5#6#7 ;
{ + #1#2 ; {#3#4#5#6} {#7} ; }
@@ -543,7 +543,7 @@
\cs_new:Npn \@@_sub_back_shift:wnnnn ; #1#2
{
\exp_after:wN \@@_sub_back_shift_ii:ww
- \__int_value:w #1 #2 0 ;
+ \int_value:w #1 #2 0 ;
}
\cs_new:Npn \@@_sub_back_shift_ii:ww #1 0 ; #2#3 ;
{
@@ -551,7 +551,7 @@
- 7
- \exp_after:wN \use_i:nnn
\exp_after:wN \@@_sub_back_shift_iii:NNNNNNNNw
- \__int_value:w #2#3 0 ~ 123456789;
+ \int_value:w #2#3 0 ~ 123456789;
\else:
- \@@_sub_back_shift_iii:NNNNNNNNw #1 123456789;
\fi:
@@ -559,7 +559,7 @@
\exp_after:wN \@@_pack_twice_four:wNNNNNNNN
\exp_after:wN \@@_sub_back_shift_iv:nnnnw
\exp_after:wN ;
- \__int_value:w
+ \int_value:w
#1 ~ #2#3 0 ~ 0000 0000 0000 000 ;
}
\cs_new:Npn \@@_sub_back_shift_iii:NNNNNNNNw #1#2#3#4#5#6#7#8#9; {#8}
@@ -658,9 +658,9 @@
{
- 1
\exp_after:wN \@@_sub_back_near_after:wNNNNw
- \__int_value:w \__int_eval:w 1#30 - #1 - 11
+ \int_value:w \@@_int_eval:w 1#30 - #1 - 11
\exp_after:wN \@@_sub_back_near_pack:NNNNNNw
- \__int_value:w \__int_eval:w 11 0000 0000 + #40 - #2
+ \int_value:w \@@_int_eval:w 11 0000 0000 + #40 - #2
- \exp_after:wN \@@_round_neg:NNN
\exp_after:wN #6
\use_none:nnnnnnn #2 #5
@@ -678,7 +678,7 @@
% complicated: we have two \meta{rounding} digits |#3| and |#6| (from
% the decimation, and from the new shift) to take into account, and
% getting the parity of the main result requires a computation. The
-% first \cs{__int_value:w} triggers the second one because the number
+% first \cs{int_value:w} triggers the second one because the number
% is unfinished; we can thus not use $0$ in place of $2$ there.
% \begin{macrocode}
\cs_new:Npn \@@_sub_back_very_far_o:wwwwNN #1#2#3#4#5#6#7
@@ -691,15 +691,15 @@
\cs_new:Npn \@@_sub_back_very_far_ii_o:nnNwwNN #1#2 ; #3 ; #4 ~ #5; #6#7
{
\exp_after:wN \@@_basics_pack_high:NNNNNw
- \__int_value:w \__int_eval:w 1#4 - #1 - 1
+ \int_value:w \@@_int_eval:w 1#4 - #1 - 1
\exp_after:wN \@@_basics_pack_low:NNNNNw
- \__int_value:w \__int_eval:w 2#5 - #2
+ \int_value:w \@@_int_eval:w 2#5 - #2
- \exp_after:wN \@@_round_neg:NNN
\exp_after:wN #7
- \__int_value:w
- \if_int_odd:w \__int_eval:w #5 - #2 \__int_eval_end:
+ \int_value:w
+ \if_int_odd:w \@@_int_eval:w #5 - #2 \@@_int_eval_end:
1 \else: 2 \fi:
- \__int_value:w \@@_round_digit:Nw #3 #6 ;
+ \int_value:w \@@_round_digit:Nw #3 #6 ;
\exp_after:wN ;
}
% \end{macrocode}
@@ -752,7 +752,7 @@
\cs_new:Npn \@@_mul_cases_o:NnNnww
#1#2#3#4 \s_@@ \@@_chk:w #5#6#7; \s_@@ \@@_chk:w #8#9
{
- \if_case:w \__int_eval:w
+ \if_case:w \@@_int_eval:w
\if_int_compare:w #5 #8 = 11 ~
1
\else:
@@ -771,7 +771,7 @@
\fi:
\fi:
\if_meaning:w #6 #9 - 1 \fi:
- \__int_eval_end:
+ \@@_int_eval_end:
\@@_case_use:nw { #3 0 }
\or: \@@_case_use:nw { #3 2 }
\or: \@@_case_return_i_o:ww
@@ -802,7 +802,7 @@
% \cs{s_@@} \cs{@@_chk:w} |1| \meta{sign_2} \Arg{exp_2} \meta{body_2} |;|
% \end{quote}
% After the computation, \cs{@@_sanitize:Nw} checks for overflow or
-% underflow. As we did for addition, \cs{__int_eval:w} computes the
+% underflow. As we did for addition, \cs{@@_int_eval:w} computes the
% exponent, catching any shift coming from the computation in the
% significand. The \meta{final sign} is needed to do the rounding
% properly in the significand computation. We setup the post-expansion
@@ -815,7 +815,7 @@
{
\exp_after:wN \@@_sanitize:Nw
\exp_after:wN #1
- \__int_value:w \__int_eval:w
+ \int_value:w \@@_int_eval:w
#4 + #8
\@@_mul_significand_o:nnnnNnnnn #5 #1 #9
}
@@ -834,7 +834,7 @@
% the last \cs{@@_mul_significand_drop:NNNNNw}; one is for
% \cs{@@_round_digit:Nw} later on; and one, preceded by
% \cs{exp_after:wN}, which is correctly expanded (within an
-% \cs{__int_eval:w}), is used by \cs{@@_basics_pack_low:NNNNNw}.
+% \cs{@@_int_eval:w}), is used by \cs{@@_basics_pack_low:NNNNNw}.
%
% The product of two $16$ digit integers has $31$ or $32$ digits,
% but it is impossible to know which one before computing. The place
@@ -844,25 +844,27 @@
% is between $100$ and $9999$ inclusive), and a compact version of
% the remaining $3$ blocks. Afterwards, the number of digits is
% known, and we can do the rounding within yet another set of
-% \cs{__int_eval:w}.
+% \cs{@@_int_eval:w}.
% \begin{macrocode}
\cs_new:Npn \@@_mul_significand_o:nnnnNnnnn #1#2#3#4 #5 #6#7#8#9
{
\exp_after:wN \@@_mul_significand_test_f:NNN
\exp_after:wN #5
- \__int_value:w \__int_eval:w 99990000 + #1*#6 +
+ \int_value:w \@@_int_eval:w 99990000 + #1*#6 +
\exp_after:wN \@@_mul_significand_keep:NNNNNw
- \__int_value:w \__int_eval:w 99990000 + #1*#7 + #2*#6 +
+ \int_value:w \@@_int_eval:w 99990000 + #1*#7 + #2*#6 +
\exp_after:wN \@@_mul_significand_keep:NNNNNw
- \__int_value:w \__int_eval:w 99990000 + #1*#8 + #2*#7 + #3*#6 +
+ \int_value:w \@@_int_eval:w 99990000 + #1*#8 + #2*#7 + #3*#6 +
\exp_after:wN \@@_mul_significand_drop:NNNNNw
- \__int_value:w \__int_eval:w 99990000 + #1*#9 + #2*#8 + #3*#7 + #4*#6 +
+ \int_value:w \@@_int_eval:w 99990000 + #1*#9 + #2*#8 +
+ #3*#7 + #4*#6 +
\exp_after:wN \@@_mul_significand_drop:NNNNNw
- \__int_value:w \__int_eval:w 99990000 + #2*#9 + #3*#8 + #4*#7 +
+ \int_value:w \@@_int_eval:w 99990000 + #2*#9 + #3*#8 +
+ #4*#7 +
\exp_after:wN \@@_mul_significand_drop:NNNNNw
- \__int_value:w \__int_eval:w 99990000 + #3*#9 + #4*#8 +
+ \int_value:w \@@_int_eval:w 99990000 + #3*#9 + #4*#8 +
\exp_after:wN \@@_mul_significand_drop:NNNNNw
- \__int_value:w \__int_eval:w 100000000 + #4*#9 ;
+ \int_value:w \@@_int_eval:w 100000000 + #4*#9 ;
; \exp_after:wN ;
}
\cs_new:Npn \@@_mul_significand_drop:NNNNNw #1#2#3#4#5 #6;
@@ -910,13 +912,13 @@
\cs_new:Npn \@@_mul_significand_large_f:NwwNNNN #1 #2; #3; #4#5#6#7; +
{
\exp_after:wN \@@_basics_pack_high:NNNNNw
- \__int_value:w \__int_eval:w 1#2
+ \int_value:w \@@_int_eval:w 1#2
\exp_after:wN \@@_basics_pack_low:NNNNNw
- \__int_value:w \__int_eval:w 1#3#4#5#6#7
+ \int_value:w \@@_int_eval:w 1#3#4#5#6#7
+ \exp_after:wN \@@_round:NNN
\exp_after:wN #1
\exp_after:wN #7
- \__int_value:w \@@_round_digit:Nw
+ \int_value:w \@@_round_digit:Nw
}
% \end{macrocode}
% \end{macro}
@@ -933,13 +935,13 @@
{
- 1
\exp_after:wN \@@_basics_pack_high:NNNNNw
- \__int_value:w \__int_eval:w 1#3#4
+ \int_value:w \@@_int_eval:w 1#3#4
\exp_after:wN \@@_basics_pack_low:NNNNNw
- \__int_value:w \__int_eval:w 1#5#6#7
+ \int_value:w \@@_int_eval:w 1#5#6#7
+ \exp_after:wN \@@_round:NNN
\exp_after:wN #1
\exp_after:wN #7
- \__int_value:w \@@_round_digit:Nw
+ \int_value:w \@@_round_digit:Nw
}
% \end{macrocode}
% \end{macro}
@@ -1003,10 +1005,10 @@
{
\exp_after:wN \@@_sanitize:Nw
\exp_after:wN #1
- \__int_value:w \__int_eval:w
+ \int_value:w \@@_int_eval:w
#3 - #6
\exp_after:wN \@@_div_significand_i_o:wnnw
- \__int_value:w \__int_eval:w #7 \use_i:nnnn #8 + 1 ;
+ \int_value:w \@@_int_eval:w #7 \use_i:nnnn #8 + 1 ;
#4
{#7}{#8}#9 ;
#1
@@ -1052,7 +1054,7 @@
% \leq 10^{4} \frac{A}{Z}
% \end{equation*}
% Subtracting $1$ at the end takes care of the fact that \eTeX{}'s
-% \cs{__int_eval:w} rounds divisions instead of truncating (really,
+% \cs{@@_int_eval:w} rounds divisions instead of truncating (really,
% $1/2$ would be sufficient, but we work with integers). We add $1$ to
% $Z_{1}$ because $Z_{1} \leq 10^{4}Z < Z_{1}+1$ and we need $Q_{A}$ to
% be an underestimate. However, we are now underestimating $Q_{A}$ too
@@ -1196,21 +1198,21 @@
% \meta{continuation} arguments for $4$ consecutive calls to
% \cs{@@_div_significand_calc:wwnnnnnnn}. Each of these calls needs
% \meta{y} (|#1|), and it turns out that we need post-expansion there,
-% hence the \cs{__int_value:w}. Here, |#4| is six brace groups, which
+% hence the \cs{int_value:w}. Here, |#4| is six brace groups, which
% give the six first |n|-type arguments of the \texttt{calc} function.
% \begin{macrocode}
\cs_new:Npn \@@_div_significand_i_o:wnnw #1 ; #2#3 #4 ;
{
\exp_after:wN \@@_div_significand_test_o:w
- \__int_value:w \__int_eval:w
+ \int_value:w \@@_int_eval:w
\exp_after:wN \@@_div_significand_calc:wwnnnnnnn
- \__int_value:w \__int_eval:w 999999 + #2 #3 0 / #1 ;
+ \int_value:w \@@_int_eval:w 999999 + #2 #3 0 / #1 ;
#2 #3 ;
#4
- { \exp_after:wN \@@_div_significand_ii:wwn \__int_value:w #1 }
- { \exp_after:wN \@@_div_significand_ii:wwn \__int_value:w #1 }
- { \exp_after:wN \@@_div_significand_ii:wwn \__int_value:w #1 }
- { \exp_after:wN \@@_div_significand_iii:wwnnnnn \__int_value:w #1 }
+ { \exp_after:wN \@@_div_significand_ii:wwn \int_value:w #1 }
+ { \exp_after:wN \@@_div_significand_ii:wwn \int_value:w #1 }
+ { \exp_after:wN \@@_div_significand_ii:wwn \int_value:w #1 }
+ { \exp_after:wN \@@_div_significand_iii:wwnnnnn \int_value:w #1 }
}
% \end{macrocode}
% \end{macro}
@@ -1282,37 +1284,39 @@
\exp_after:wN \@@_div_significand_calc_ii:wwnnnnnnn
\fi:
}
-\cs_new:Npn \@@_div_significand_calc_i:wwnnnnnnn #1; #2;#3#4 #5#6#7#8 #9
+\cs_new:Npn \@@_div_significand_calc_i:wwnnnnnnn
+ #1; #2;#3#4 #5#6#7#8 #9
{
1 1 #1
#9 \exp_after:wN ;
- \__int_value:w \__int_eval:w \c_@@_Bigg_leading_shift_int
+ \int_value:w \@@_int_eval:w \c_@@_Bigg_leading_shift_int
+ #2 - #1 * #5 - #5#60
\exp_after:wN \@@_pack_Bigg:NNNNNNw
- \__int_value:w \__int_eval:w \c_@@_Bigg_middle_shift_int
+ \int_value:w \@@_int_eval:w \c_@@_Bigg_middle_shift_int
+ #3 - #1 * #6 - #70
\exp_after:wN \@@_pack_Bigg:NNNNNNw
- \__int_value:w \__int_eval:w \c_@@_Bigg_middle_shift_int
+ \int_value:w \@@_int_eval:w \c_@@_Bigg_middle_shift_int
+ #4 - #1 * #7 - #80
\exp_after:wN \@@_pack_Bigg:NNNNNNw
- \__int_value:w \__int_eval:w \c_@@_Bigg_trailing_shift_int
+ \int_value:w \@@_int_eval:w \c_@@_Bigg_trailing_shift_int
- #1 * #8 ;
{#5}{#6}{#7}{#8}
}
-\cs_new:Npn \@@_div_significand_calc_ii:wwnnnnnnn #1; #2;#3#4 #5#6#7#8 #9
+\cs_new:Npn \@@_div_significand_calc_ii:wwnnnnnnn
+ #1; #2;#3#4 #5#6#7#8 #9
{
1 0 #1
#9 \exp_after:wN ;
- \__int_value:w \__int_eval:w \c_@@_Bigg_leading_shift_int
+ \int_value:w \@@_int_eval:w \c_@@_Bigg_leading_shift_int
+ #2 - #1 * #5
\exp_after:wN \@@_pack_Bigg:NNNNNNw
- \__int_value:w \__int_eval:w \c_@@_Bigg_middle_shift_int
+ \int_value:w \@@_int_eval:w \c_@@_Bigg_middle_shift_int
+ #3 - #1 * #6
\exp_after:wN \@@_pack_Bigg:NNNNNNw
- \__int_value:w \__int_eval:w \c_@@_Bigg_middle_shift_int
+ \int_value:w \@@_int_eval:w \c_@@_Bigg_middle_shift_int
+ #4 - #1 * #7
\exp_after:wN \@@_pack_Bigg:NNNNNNw
- \__int_value:w \__int_eval:w \c_@@_Bigg_trailing_shift_int
+ \int_value:w \@@_int_eval:w \c_@@_Bigg_trailing_shift_int
- #1 * #8 ;
{#5}{#6}{#7}{#8}
}
@@ -1328,7 +1332,7 @@
% \meta{continuations} \meta{sign}
% \end{quote}
% Compute $Q_{B}$ by evaluating $\meta{B_1}\meta{B_2}0 / y - 1$. The
-% result is output to the left, in an \cs{__int_eval:w} which we
+% result is output to the left, in an \cs{@@_int_eval:w} which we
% start now. Once that is evaluated (and the other $Q_{i}$ also,
% since later expansions are triggered by this one), a packing
% auxiliary takes care of placing the digits of $Q_{B}$ in an
@@ -1339,9 +1343,9 @@
\cs_new:Npn \@@_div_significand_ii:wwn #1; #2;#3
{
\exp_after:wN \@@_div_significand_pack:NNN
- \__int_value:w \__int_eval:w
+ \int_value:w \@@_int_eval:w
\exp_after:wN \@@_div_significand_calc:wwnnnnnnn
- \__int_value:w \__int_eval:w 999999 + #2 #3 0 / #1 ; #2 #3 ;
+ \int_value:w \@@_int_eval:w 999999 + #2 #3 0 / #1 ; #2 #3 ;
}
% \end{macrocode}
% \end{macro}
@@ -1361,7 +1365,7 @@
{
0
\exp_after:wN \@@_div_significand_iv:wwnnnnnnn
- \__int_value:w \__int_eval:w ( 2 * #2 #3) / #6 #7 ; % <- P
+ \int_value:w \@@_int_eval:w ( 2 * #2 #3) / #6 #7 ; % <- P
#2 ; {#3} {#4} {#5}
{#6} {#7}
}
@@ -1420,17 +1424,17 @@
{
+ 5 * #1
\exp_after:wN \@@_div_significand_vi:Nw
- \__int_value:w \__int_eval:w -20 + 2*#2#3 - #1*#6#7 +
+ \int_value:w \@@_int_eval:w -20 + 2*#2#3 - #1*#6#7 +
\exp_after:wN \@@_div_significand_v:NN
- \__int_value:w \__int_eval:w 199980 + 2*#4 - #1*#8 +
+ \int_value:w \@@_int_eval:w 199980 + 2*#4 - #1*#8 +
\exp_after:wN \@@_div_significand_v:NN
- \__int_value:w \__int_eval:w 200000 + 2*#5 - #1*#9 ;
+ \int_value:w \@@_int_eval:w 200000 + 2*#5 - #1*#9 ;
}
-\cs_new:Npn \@@_div_significand_v:NN #1#2 { #1#2 \__int_eval_end: + }
+\cs_new:Npn \@@_div_significand_v:NN #1#2 { #1#2 \@@_int_eval_end: + }
\cs_new:Npn \@@_div_significand_vi:Nw #1#2;
{
\if_meaning:w 0 #1
- \if_int_compare:w \__int_eval:w #2 > 0 + 1 \fi:
+ \if_int_compare:w \@@_int_eval:w #2 > 0 + 1 \fi:
\else:
\if_meaning:w - #1 - \else: + \fi: 1
\fi:
@@ -1500,9 +1504,9 @@
0 #1; #2; #3; #4#5#6#7#8; #9
{
\exp_after:wN \@@_basics_pack_high:NNNNNw
- \__int_value:w \__int_eval:w 1 #1#2
+ \int_value:w \@@_int_eval:w 1 #1#2
\exp_after:wN \@@_basics_pack_low:NNNNNw
- \__int_value:w \__int_eval:w 1 #3#4#5#6#7
+ \int_value:w \@@_int_eval:w 1 #3#4#5#6#7
+ \@@_round:NNN #9 #7 #8
\exp_after:wN ;
}
@@ -1524,13 +1528,13 @@
{
+ 1
\exp_after:wN \@@_basics_pack_weird_high:NNNNNNNNw
- \__int_value:w \__int_eval:w 1 #1 #2
+ \int_value:w \@@_int_eval:w 1 #1 #2
\exp_after:wN \@@_basics_pack_weird_low:NNNNw
- \__int_value:w \__int_eval:w 1 #3 #4 #5 #6 +
+ \int_value:w \@@_int_eval:w 1 #3 #4 #5 #6 +
\exp_after:wN \@@_round:NNN
\exp_after:wN #9
\exp_after:wN #6
- \__int_value:w \@@_round_digit:Nw #7 #8 ;
+ \int_value:w \@@_round_digit:Nw #7 #8 ;
\exp_after:wN ;
}
% \end{macrocode}
@@ -1574,7 +1578,7 @@
{
\exp_after:wN \@@_sanitize:Nw
\exp_after:wN 0
- \__int_value:w \__int_eval:w
+ \int_value:w \@@_int_eval:w
\if_int_odd:w #1 \exp_stop_f:
\exp_after:wN \@@_sqrt_npos_auxi_o:wwnnN
\fi:
@@ -1663,11 +1667,11 @@
{
\if_int_compare:w #1 = #2 \exp_stop_f:
\exp_after:wN \@@_sqrt_auxi_o:NNNNwnnN
- \__int_value:w \__int_eval:w 9999 9999 +
+ \int_value:w \@@_int_eval:w 9999 9999 +
\exp_after:wN \@@_use_none_until_s:w
\fi:
\exp_after:wN \@@_sqrt_Newton_o:wwn
- \__int_value:w \__int_eval:w (#1 + #3 * 1 0000 0000 / #1) / 2 ;
+ \int_value:w \@@_int_eval:w (#1 + #3 * 1 0000 0000 / #1) / 2 ;
#1; {#3}
}
% \end{macrocode}
@@ -1756,32 +1760,32 @@
\cs_new:Npn \@@_sqrt_auxii_o:NnnnnnnnN #1 #2#3#4#5#6 #7#8#9
{
\exp_after:wN #1
- \__int_value:w \__int_eval:w \c_@@_big_leading_shift_int
+ \int_value:w \@@_int_eval:w \c_@@_big_leading_shift_int
+ #7 - #2 * #2
\exp_after:wN \@@_pack_big:NNNNNNw
- \__int_value:w \__int_eval:w \c_@@_big_middle_shift_int
+ \int_value:w \@@_int_eval:w \c_@@_big_middle_shift_int
- 2 * #2 * #3
\exp_after:wN \@@_pack_big:NNNNNNw
- \__int_value:w \__int_eval:w \c_@@_big_middle_shift_int
+ \int_value:w \@@_int_eval:w \c_@@_big_middle_shift_int
+ #8 - #3 * #3 - 2 * #2 * #4
\exp_after:wN \@@_pack_big:NNNNNNw
- \__int_value:w \__int_eval:w \c_@@_big_middle_shift_int
+ \int_value:w \@@_int_eval:w \c_@@_big_middle_shift_int
- 2 * #3 * #4 - 2 * #2 * #5
\exp_after:wN \@@_pack_big:NNNNNNw
- \__int_value:w \__int_eval:w \c_@@_big_middle_shift_int
+ \int_value:w \@@_int_eval:w \c_@@_big_middle_shift_int
+ #9 000 0000 - #4 * #4 - 2 * #3 * #5 - 2 * #2 * #6
\exp_after:wN \@@_pack_big:NNNNNNw
- \__int_value:w \__int_eval:w \c_@@_big_middle_shift_int
+ \int_value:w \@@_int_eval:w \c_@@_big_middle_shift_int
- 2 * #4 * #5 - 2 * #3 * #6
\exp_after:wN \@@_pack_big:NNNNNNw
- \__int_value:w \__int_eval:w \c_@@_big_middle_shift_int
+ \int_value:w \@@_int_eval:w \c_@@_big_middle_shift_int
- #5 * #5 - 2 * #4 * #6
\exp_after:wN \@@_pack_big:NNNNNNw
- \__int_value:w \__int_eval:w
+ \int_value:w \@@_int_eval:w
\c_@@_big_middle_shift_int
- 2 * #5 * #6
\exp_after:wN \@@_pack_big:NNNNNNw
- \__int_value:w \__int_eval:w
+ \int_value:w \@@_int_eval:w
\c_@@_big_trailing_shift_int
- #6 * #6 ;
% (
@@ -1839,18 +1843,18 @@
{
\if_int_compare:w #1 > 1 \exp_stop_f:
\exp_after:wN \@@_sqrt_auxiv_o:NNNNNw
- \__int_value:w \__int_eval:w (#1#2 %)
+ \int_value:w \@@_int_eval:w (#1#2 %)
\else:
\if_int_compare:w #1#2 > 1 \exp_stop_f:
\exp_after:wN \@@_sqrt_auxv_o:NNNNNw
- \__int_value:w \__int_eval:w (#1#2#3 %)
+ \int_value:w \@@_int_eval:w (#1#2#3 %)
\else:
\if_int_compare:w #1#2#3 > 1 \exp_stop_f:
\exp_after:wN \@@_sqrt_auxvi_o:NNNNNw
- \__int_value:w \__int_eval:w (#1#2#3#4 %)
+ \int_value:w \@@_int_eval:w (#1#2#3#4 %)
\else:
\exp_after:wN \@@_sqrt_auxvii_o:NNNNNw
- \__int_value:w \__int_eval:w (#1#2#3#4#5 %)
+ \int_value:w \@@_int_eval:w (#1#2#3#4#5 %)
\fi:
\fi:
\fi:
@@ -1880,11 +1884,11 @@
\cs_new:Npn \@@_sqrt_auxviii_o:nnnnnnn #1#2 #3#4#5#6#7
{
\exp_after:wN \@@_sqrt_auxix_o:wnwnw
- \__int_value:w \__int_eval:w #3
+ \int_value:w \@@_int_eval:w #3
\exp_after:wN \@@_basics_pack_low:NNNNNw
- \__int_value:w \__int_eval:w #1 + 1#4#5
+ \int_value:w \@@_int_eval:w #1 + 1#4#5
\exp_after:wN \@@_basics_pack_low:NNNNNw
- \__int_value:w \__int_eval:w #2 + 1#6#7 ;
+ \int_value:w \@@_int_eval:w #2 + 1#6#7 ;
}
\cs_new:Npn \@@_sqrt_auxix_o:wnwnw #1; #2#3; #4#5;
{
@@ -1930,7 +1934,7 @@
\cs_new:Npn \@@_sqrt_auxx_o:Nnnnnnnn #1#2#3 #4#5#6#7#8
{
\exp_after:wN \@@_sqrt_auxxi_o:wwnnN
- \__int_value:w \__int_eval:w
+ \int_value:w \@@_int_eval:w
(#8 + 2499) / 5000 * 5000 ;
{#4} {#5} {#6} {#7} ;
}
@@ -1969,10 +1973,10 @@
\fi:
\fi:
\exp_after:wN \@@_sqrt_auxxiv_o:wnnnnnnnN
- \__int_value:w 9998
+ \int_value:w 9998
\else:
\exp_after:wN \@@_sqrt_auxxiv_o:wnnnnnnnN
- \__int_value:w 10000
+ \int_value:w 10000
\fi:
;
}
@@ -2008,18 +2012,18 @@
\cs_new:Npn \@@_sqrt_auxxiv_o:wnnnnnnnN #1; #2#3#4#5#6 #7#8#9
{
\exp_after:wN \@@_basics_pack_high:NNNNNw
- \__int_value:w \__int_eval:w 1 0000 0000 + #2#3
+ \int_value:w \@@_int_eval:w 1 0000 0000 + #2#3
\exp_after:wN \@@_basics_pack_low:NNNNNw
- \__int_value:w \__int_eval:w 1 0000 0000
+ \int_value:w \@@_int_eval:w 1 0000 0000
+ #4#5
\if_int_compare:w #6 > #1 \exp_stop_f: + 1 \fi:
+ \exp_after:wN \@@_round:NNN
\exp_after:wN 0
\exp_after:wN 0
- \__int_value:w
+ \int_value:w
\exp_after:wN \use_i:nn
\exp_after:wN \@@_round_digit:Nw
- \__int_value:w \__int_eval:w #6 + 19999 - #1 ;
+ \int_value:w \@@_int_eval:w #6 + 19999 - #1 ;
\exp_after:wN ;
}
% \end{macrocode}
@@ -2061,7 +2065,7 @@
\exp_after:wN \s_@@
\exp_after:wN \@@_chk:w
\exp_after:wN #2
- \__int_value:w
+ \int_value:w
\if_case:w #3 \exp_stop_f: #1 \or: 1 \or: 0 \fi: \exp_stop_f:
#4;
}