summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/l3kernel/l3fp-aux.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3fp-aux.dtx')
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3fp-aux.dtx56
1 files changed, 29 insertions, 27 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-aux.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-aux.dtx
index ee40577fbe8..03708beff6f 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3fp-aux.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-aux.dtx
@@ -36,7 +36,7 @@
%
%<*driver>
\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3fp-aux.dtx 4601 2013-11-18 23:13:28Z bruno $
+\GetIdInfo$Id: l3fp-aux.dtx 4622 2013-12-14 13:05:45Z bruno $
{L3 Floating-point support functions}
\documentclass[full]{l3doc}
\begin{document}
@@ -211,7 +211,6 @@
% (typically digits).
% \begin{macrocode}
\cs_new:Npn \@@_use_s:n #1 { #1; }
-\cs_new:Npn \@@_use_braced_s:n #1 { {#1} ; }
\cs_new:Npn \@@_use_s:nn #1#2 { #1#2; }
% \end{macrocode}
% \end{macro}
@@ -244,11 +243,12 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[int, EXP]{\@@_use_i:ww}
+% \begin{macro}[int, EXP]{\@@_use_i:ww, \@@_use_i:www}
% Many internal functions take arguments delimited by semicolons, and
-% it is occasionally useful to remove one such argument.
+% it is occasionally useful to remove one or two such arguments.
% \begin{macrocode}
\cs_new:Npn \@@_use_i:ww #1; #2; { #1; }
+\cs_new:Npn \@@_use_i:www #1; #2; #3; { #1; }
% \end{macrocode}
% \end{macro}
%
@@ -591,7 +591,7 @@
% provide different sets of packing functions and shifts, depending on
% ranges of input.
%
-% \begin{macro}[int, EXP]{\@@_pack:NNNNNw, \@@_pack:NNNNNwn}
+% \begin{macro}[int, EXP]{\@@_pack:NNNNNw}
% \begin{variable}[int]
% {
% \c_@@_trailing_shift_int ,
@@ -600,20 +600,17 @@
% }
% This set of shifts allows for computations involving results in the
% range $[-4\cdot 10^{8}, 5\cdot 10^{8}-1]$. Shifted values all have
-% exactly $9$ digits. The \cs{@@_pack:NNNNNwn} function brings a
-% braced \meta{continuation} up through the levels of expansion.
+% exactly $9$ digits.
% \begin{macrocode}
\int_const:Nn \c_@@_leading_shift_int { - 5 0000 }
\int_const:Nn \c_@@_middle_shift_int { 5 0000 * 9999 }
\int_const:Nn \c_@@_trailing_shift_int { 5 0000 * 10000 }
\cs_new:Npn \@@_pack:NNNNNw #1 #2#3#4#5 #6; { + #1#2#3#4#5 ; {#6} }
-\cs_new:Npn \@@_pack:NNNNNwn #1 #2#3#4#5 #6; #7
- { + #1#2#3#4#5 ; {#7} {#6} }
% \end{macrocode}
% \end{variable}
% \end{macro}
%
-% \begin{macro}[int, EXP]{\@@_pack_big:NNNNNNw, \@@_pack_big:NNNNNNwn}
+% \begin{macro}[int, EXP]{\@@_pack_big:NNNNNNw}
% \begin{variable}[int]
% {
% \c_@@_big_trailing_shift_int ,
@@ -632,8 +629,6 @@
\int_const:Nn \c_@@_big_trailing_shift_int { 15 2374 * 10000 }
\cs_new:Npn \@@_pack_big:NNNNNNw #1#2 #3#4#5#6 #7;
{ + #1#2#3#4#5#6 ; {#7} }
-\cs_new:Npn \@@_pack_big:NNNNNNwn #1#2 #3#4#5#6 #7; #8
- { + #1#2#3#4#5#6 ; {#8} {#7} }
% \end{macrocode}
% \end{variable}
% \end{macro}
@@ -949,9 +944,9 @@
% \@@_small_int_normal:NnwTF,
% \@@_small_int_test:NnnwNTF
% }
-% This function tests if its floating point argument is an integer in
-% the range $[-99999999,99999999]$. If it is, the result of the
-% conversion is fed as a braced argument to the \meta{true code}.
+% Tests if the floating point argument is an integer or $\pm\infty$.
+% If so, it is converted to an integer in the range $[-10^{8},10^{8}]$
+% and fed as a braced argument to the \meta{true code}.
% Otherwise, the \meta{false code} is performed. First filter special
% cases: neither \texttt{nan} nor infinities are integers. Normal
% numbers with a non-positive exponent are never integers. When the
@@ -967,38 +962,45 @@
% coming from \cs{@@_small_int_normal:NnwTF}, hence will call the
% \cs{use_iii:nnn} which follows, taking the false branch.
% \begin{macrocode}
-\cs_new:Npn \@@_small_int:wTF \s_@@ \@@_chk:w #1
+\cs_new:Npn \@@_small_int:wTF \s_@@ \@@_chk:w #1#2
{
\if_case:w #1 \exp_stop_f:
\@@_case_return:nw { \@@_small_int_true:wTF 0 ; }
\or: \exp_after:wN \@@_small_int_normal:NnwTF
+ \or:
+ \@@_case_return:nw
+ {
+ \exp_after:wN \@@_small_int_true:wTF \__int_value:w
+ \if_meaning:w 2 #2 - \fi: 1 0000 0000 ;
+ }
\else: \@@_case_return:nw \use_ii:nn
\fi:
+ #2
}
\cs_new:Npn \@@_small_int_true:wTF #1; #2#3 { #2 {#1} }
\cs_new:Npn \@@_small_int_normal:NnwTF #1#2#3;
{
\if_int_compare:w #2 > \c_zero
- \if_int_compare:w #2 > \c_eight
- \exp_after:wN \exp_after:wN
- \exp_after:wN \use_iii:nnn
- \else:
- \@@_decimate:nNnnnn { \c_sixteen - #2 }
- \@@_small_int_test:NnnwNTF
- #3 #1
- \fi:
+ \@@_decimate:nNnnnn { \c_sixteen - #2 }
+ \@@_small_int_test:NnnwNnw
+ #3 #1 {#2}
\else:
\exp_after:wN \use_iii:nnn
\fi:
;
}
-\cs_new:Npn \@@_small_int_test:NnnwNTF #1#2#3#4; #5
+\cs_new:Npn \@@_small_int_test:NnnwNnw #1#2#3#4; #5#6
{
\if_meaning:w 0 #1
\exp_after:wN \@@_small_int_true:wTF
- \__int_value:w \if_meaning:w 2 #5 - \fi: #3
+ \__int_value:w \if_meaning:w 2 #5 - \fi:
+ \if_int_compare:w #6 > \c_eight
+ 1 0000 0000
+ \else:
+ #3
+ \fi:
\else:
- \exp_after:wN \use_i:nn
+ \use_i:nn
\fi:
}
% \end{macrocode}