diff options
author | Karl Berry <karl@freefriends.org> | 2012-09-05 22:58:18 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2012-09-05 22:58:18 +0000 |
commit | c556c94cbf233fa607dc3ac6a664f23efba92c07 (patch) | |
tree | fd6e97db5854a06159dea563eff175ea9e588a7c /Master/texmf-dist/source/latex/l3kernel/l3fp-aux.dtx | |
parent | e5a6b18348ead0cec45f680a2bacf024120cfdec (diff) |
latex3
git-svn-id: svn://tug.org/texlive/trunk@27600 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3fp-aux.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/l3kernel/l3fp-aux.dtx | 60 |
1 files changed, 56 insertions, 4 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-aux.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-aux.dtx index 74bacd5d9d8..53a6456c5ac 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 4151 2012-08-28 11:51:52Z bruno $ +\GetIdInfo$Id: l3fp-aux.dtx 4181 2012-08-31 17:33:08Z bruno $ {L3 Floating-point support functions} \documentclass[full]{l3doc} \begin{document} @@ -162,7 +162,7 @@ \cs_new_protected:Npn \@@_chk:w #1 ; { \__msg_kernel_error:nnx { kernel } { misused-fp } - { \@@_to_tl:w \s_@@ \@@_chk:w #1 ; } + { \fp_to_tl:n { \s_@@ \@@_chk:w #1 ; } } } % \end{macrocode} % \end{macro} @@ -404,6 +404,27 @@ % \end{macrocode} % \end{macro} % +% \begin{macro}[int, EXP]{\@@_exp_after_array_f:w} +% \begin{macro}[aux, EXP]{\@@_exp_after_stop_f:nw} +% \begin{syntax} +% \cs{@@_exp_after_array_f:w} +% \meta{fp_1} |;| +% \ldots{} +% \meta{fp_n} |;| +% \cs{s_@@_stop} +% \end{syntax} +% \begin{macrocode} +\cs_new:Npn \@@_exp_after_array_f:w #1 + { + \cs:w @@_exp_after \@@_type_from_scan:N #1 _f:nw \cs_end: + { \@@_exp_after_array_f:w } + #1 + } +\cs_new_eq:NN \@@_exp_after_stop_f:nw \use_none:nn +% \end{macrocode} +% \end{macro} +% \end{macro} +% % \subsection{Packing digits} % % When a positive integer |#1| is known to be less than $10^8$, the @@ -879,14 +900,14 @@ % % \subsection{Length of a floating point array} % -% \begin{macro}[int, EXP]{\@@_array_count:w} +% \begin{macro}[int, EXP]{\@@_array_count:n} % \begin{macro}[aux, EXP]{\@@_array_count_loop:Nw} % Count the number of items in an array of floating points. The % technique is very similar to \cs{tl_count:n}, but with the loop % built-in. Checking for the end of the loop is done with the % |\use_none:n #1| construction. % \begin{macrocode} -\cs_new:Npn \@@_array_count:w #1 @ +\cs_new:Npn \@@_array_count:n #1 { \int_use:N \__int_eval:w \c_zero \@@_array_count_loop:Nw #1 { ? \__prg_break: } ; @@ -899,6 +920,37 @@ % \end{macro} % \end{macro} % +% \subsection{\texttt{x}-like expansion expandably} +% +% \begin{macro}[int, EXP]{\@@_expand:n} +% \begin{macro}[aux, EXP]{\@@_expand_loop:nwnN} +% This expandable function behaves in a way somewhat similar to +% \cs{use:x}, but much less robust. The argument is +% \texttt{f}-expanded, then the leading item (often a single character +% token) is moved to a storage area after \cs{s_@@_mark}, and +% \texttt{f}-expansion is applied again, repeating until the argument +% is empty. The result built one piece at a time is then inserted in +% the input stream. Note that spaces are ignored by this procedure, +% unless surrounded with braces. Multiple tokens which do not need +% expansion can be inserted within braces. +% \begin{macrocode} +\cs_new:Npn \@@_expand:n #1 + { + \@@_expand_loop:nwnN { } + #1 \prg_do_nothing: + \s_@@_mark { } \@@_expand_loop:nwnN + \s_@@_mark { } \@@_use_i_until_s:nw ; + } +\cs_new:Npn \@@_expand_loop:nwnN #1#2 \s_@@_mark #3 #4 + { + \exp_after:wN #4 \tex_romannumeral:D -`0 + #2 + \s_@@_mark { #3 #1 } #4 + } +% \end{macrocode} +% \end{macro} +% \end{macro} +% % \subsection{Messages} % % Using a floating point directly is an error. |