summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/l3kernel/l3fp-round.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3fp-round.dtx')
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3fp-round.dtx23
1 files changed, 20 insertions, 3 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-round.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-round.dtx
index cc6299b8dfd..899c1a3bd6b 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3fp-round.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-round.dtx
@@ -36,7 +36,7 @@
%
%<*driver>
\documentclass[full]{l3doc}
-\GetIdInfo$Id: l3fp-round.dtx 6441 2016-03-24 10:11:59Z joseph $
+\GetIdInfo$Id: l3fp-round.dtx 6750 2016-11-21 01:24:26Z bruno $
{L3 Floating-point rounding}
\begin{document}
\DocInput{\jobname.dtx}
@@ -350,6 +350,7 @@
%
% ^^A todo: This macro is intermingled with l3fp-parse.
% ^^A todo: Add explanations.
+% ^^A todo: This macro f-expands rather than o-expands after itself, is that an issue?
% \begin{macro}[aux,EXP]{\@@_round_o:Nw}
% The |trunc|, |ceil| and |floor| functions expect one or two
% arguments (the second is $0$ by default), and the |round| function
@@ -360,8 +361,9 @@
\cs_new:Npn \@@_round_o:Nw #1#2 @
{
\if_case:w
- \__int_eval:w \@@_array_count:n {#2} - \c_one \__int_eval_end:
- \@@_round:Nwn #1 #2 {0} \exp:w
+ \__int_eval:w \@@_array_count:n {#2} \__int_eval_end:
+ \@@_round_no_arg_o:Nw #1 \exp:w
+ \or: \@@_round:Nwn #1 #2 {0} \exp:w
\or: \@@_round:Nww #1 #2 \exp:w
\else: \@@_round:Nwww #1 #2 @ \exp:w
\fi:
@@ -370,6 +372,21 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}[aux, EXP]{\@@_round_no_arg_o:Nw}
+% \begin{macrocode}
+\cs_new:Npn \@@_round_no_arg_o:Nw #1
+ {
+ \cs_if_eq:NNTF #1 \@@_round_to_nearest:NNN
+ { \@@_error:nnnn { num-args } { round () } { 1 } { 3 } }
+ {
+ \@@_error:nffn { num-args }
+ { \@@_round_name_from_cs:N #1 () } { 1 } { 2 }
+ }
+ \exp_after:wN \c_nan_fp
+ }
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}[aux, EXP]{\@@_round:Nwww}
% Having three arguments is only allowed for |round|, not |trunc|,
% |ceil|, |floor|, so check for that case. If all is well, construct