diff options
author | Karl Berry <karl@freefriends.org> | 2016-11-22 22:50:16 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2016-11-22 22:50:16 +0000 |
commit | f476e2547d6f421f3f59e812adb855596f668eb5 (patch) | |
tree | 859e615afe313dc934f3ca679cd4ea760e356f98 /Master/texmf-dist/source/latex/l3kernel/l3fp-round.dtx | |
parent | 4061b69b7a85fc322821dbfc8beb83b498542e45 (diff) |
l3 (22nov16)
git-svn-id: svn://tug.org/texlive/trunk@42556 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3fp-round.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/l3kernel/l3fp-round.dtx | 23 |
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 |