From 4efb0e288e61307337a1593f83dead03178acc61 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 22 Nov 2013 00:05:28 +0000 Subject: l3 (19nov13) git-svn-id: svn://tug.org/texlive/trunk@32204 c570f23f-e606-0410-a88d-b1316a301751 --- .../source/latex/l3kernel/l3fp-basics.dtx | 38 ++++++++-------------- 1 file changed, 13 insertions(+), 25 deletions(-) (limited to 'Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx') diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx index cdc2e983983..104a118ca3b 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -%% File: l3fp-basics.dtx Copyright (C) 2011-2012 The LaTeX3 Project +%% File: l3fp-basics.dtx Copyright (C) 2011-2013 The LaTeX3 Project %% %% It may be distributed and/or modified under the conditions of the %% LaTeX Project Public License (LPPL), either version 1.3c of this @@ -36,7 +36,7 @@ % %<*driver> \RequirePackage{l3bootstrap} -\GetIdInfo$Id: l3fp-basics.dtx 4482 2013-04-24 21:05:12Z joseph $ +\GetIdInfo$Id: l3fp-basics.dtx 4601 2013-11-18 23:13:28Z bruno $ {L3 Floating-point arithmetic} \documentclass[full]{l3doc} \begin{document} @@ -1601,35 +1601,23 @@ % % \subsection{Unary operations} % -% \begin{macro}[int, EXP]{\@@_-_o:w} -% This function flips the sign of the \meta{floating point} and -% expands after it in the input stream, just like \cs{@@_+_o:ww} -% \emph{etc.} We add a hook used by \pkg{l3fp-expo}: anything before -% \cs{s_@@} is ignored. +% \begin{macro}[int, EXP]{\@@_set_sign_o:w} +% This function is used for the unary minus and for \texttt{abs}. It +% leaves the sign of \texttt{nan} invariant, turns negative numbers +% (sign~$2$) to positive numbers (sign~$0$) and positive numbers +% (sign~$0$) to positive or negative numbers depending on~|#1|. It +% also expands after itself in the input stream, just like +% \cs{@@_+_o:ww}. % \begin{macrocode} -\cs_new:cpn { @@_-_o:w } #1 \s_@@ \@@_chk:w #2 #3 +\cs_new:Npn \@@_set_sign_o:w #1 \s_@@ \@@_chk:w #2#3#4; @ { \exp_after:wN \@@_exp_after_o:w \exp_after:wN \s_@@ \exp_after:wN \@@_chk:w \exp_after:wN #2 - \int_use:N \__int_eval:w \c_two - #3 \__int_eval_end: - } -% \end{macrocode} -% \end{macro} -% -% \begin{macro}[int, EXP]{\@@_abs_o:w} -% This function sets the sign of the \meta{floating point} to be -% positive, and expands after itself in the input stream, just like -% \cs{@@_-_o:w}. We must leave the sign of \texttt{nan} invariant. -% \begin{macrocode} -\cs_new:Npn \@@_abs_o:w \s_@@ \@@_chk:w #1 #2 - { - \exp_after:wN \@@_exp_after_o:w - \exp_after:wN \s_@@ - \exp_after:wN \@@_chk:w - \exp_after:wN #1 - \__int_value:w \if_meaning:w 1 #2 1 \else: 0 \fi: \exp_stop_f: + \__int_value:w + \if_case:w #3 \exp_stop_f: #1 \or: 1 \or: 0 \fi: \exp_stop_f: + #4; } % \end{macrocode} % \end{macro} -- cgit v1.2.3