[latex3-commits] [l3svn] r6923 - Move l3fp-traps to using l3flag. See #336
noreply at latex-project.org
noreply at latex-project.org
Tue Feb 14 04:07:25 CET 2017
Author: bruno
Date: 2017-02-14 04:07:25 +0100 (Tue, 14 Feb 2017)
New Revision: 6923
Modified:
trunk/l3kernel/l3fp-traps.dtx
trunk/l3kernel/l3fp.dtx
trunk/l3kernel/testfiles/m3expl001.luatex.tlg
trunk/l3kernel/testfiles/m3expl001.ptex.tlg
trunk/l3kernel/testfiles/m3expl001.tlg
trunk/l3kernel/testfiles/m3expl001.uptex.tlg
trunk/l3kernel/testfiles/m3expl001.xetex.tlg
trunk/l3kernel/testfiles/m3expl003.luatex.tlg
trunk/l3kernel/testfiles/m3expl003.ptex.tlg
trunk/l3kernel/testfiles/m3expl003.tlg
trunk/l3kernel/testfiles/m3expl003.uptex.tlg
trunk/l3kernel/testfiles/m3expl003.xetex.tlg
trunk/l3kernel/testfiles/m3fp-traps001.lvt
Log:
Move l3fp-traps to using l3flag. See #336
This almost closes the issue, with the caveat that a
naming question is still open.
Modified: trunk/l3kernel/l3fp-traps.dtx
===================================================================
--- trunk/l3kernel/l3fp-traps.dtx 2017-02-14 01:41:06 UTC (rev 6922)
+++ trunk/l3kernel/l3fp-traps.dtx 2017-02-14 03:07:25 UTC (rev 6923)
@@ -72,51 +72,19 @@
%
% \subsection{Flags}
%
-% \begin{macro}{\fp_flag_off:n}
-% Function to turn a flag off. Simply undefine it.
-% \begin{macrocode}
-\cs_new_protected:Npn \fp_flag_off:n #1
- { \cs_set_eq:cN { l_@@_ #1 _flag_token } \tex_undefined:D }
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}[EXP]{\fp_flag_on:n}
-% Function to turn a flag on expandably: use \TeX{}'s automatic
-% assignment to \cs{scan_stop:}.
-% \begin{macrocode}
-\cs_new:Npn \fp_flag_on:n #1
- { \exp_args:Nc \use_none:n { l_@@_ #1 _flag_token } }
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}[EXP,pTF]{\fp_if_flag_on:n}
-% Returns true if the flag is on, false otherwise.
-% \begin{macrocode}
-\prg_new_conditional:Npnn \fp_if_flag_on:n #1 { p , T , F , TF }
- {
- \if_cs_exist:w l_@@_ #1 _flag_token \cs_end:
- \prg_return_true:
- \else:
- \prg_return_false:
- \fi:
- }
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{variable}[aux]
+% \begin{variable}
% {
-% \l_@@_invalid_operation_flag_token ,
-% \l_@@_division_by_zero_flag_token ,
-% \l_@@_overflow_flag_token ,
-% \l_@@_underflow_flag_token ,
+% flag fp_invalid_operation,
+% flag fp_division_by_zero,
+% flag fp_overflow,
+% flag fp_underflow
% }
-% The \textsc{ieee} standard defines five exceptions. We currently
-% don't support the \enquote{inexact} exception.
+% Flags to denote exceptions.
% \begin{macrocode}
-\cs_new_eq:NN \l_@@_invalid_operation_flag_token \tex_undefined:D
-\cs_new_eq:NN \l_@@_division_by_zero_flag_token \tex_undefined:D
-\cs_new_eq:NN \l_@@_overflow_flag_token \tex_undefined:D
-\cs_new_eq:NN \l_@@_underflow_flag_token \tex_undefined:D
+\flag_new:n { fp_invalid_operation }
+\flag_new:n { fp_division_by_zero }
+\flag_new:n { fp_overflow }
+\flag_new:n { fp_underflow }
% \end{macrocode}
% \end{variable}
%
@@ -124,7 +92,7 @@
%
% Exceptions can be trapped to obtain custom behaviour. When an invalid
% operation or a division by zero is trapped, the trap receives as
-% arguments the result as an $N$-type floating point number, the
+% arguments the result as an |N|-type floating point number, the
% function name (multiple letters for prefix operations, or a single
% symbol for infix operations), and the operand(s). When an overflow or
% underflow is trapped, the trap receives the resulting overly large or
@@ -199,7 +167,7 @@
{
#1
\@@_error:nnfn { invalid } {##2} { \fp_to_tl:n { ##3; } } { }
- \fp_flag_on:n { invalid_operation }
+ \flag_raise:n { fp_invalid_operation }
##1
}
\exp_args:Nno \use:n
@@ -208,7 +176,7 @@
#1
\@@_error:nffn { invalid-ii }
{ \fp_to_tl:n { ##2; } } { \fp_to_tl:n { ##3; } } {##1}
- \fp_flag_on:n { invalid_operation }
+ \flag_raise:n { fp_invalid_operation }
\exp_after:wN \c_nan_fp
}
\exp_args:Nno \use:n
@@ -216,7 +184,7 @@
{
#1
\@@_error:nffn { invalid } {##1} {##2} { }
- \fp_flag_on:n { invalid_operation }
+ \flag_raise:n { fp_invalid_operation }
\exp_after:wN \c_nan_fp
}
}
@@ -249,7 +217,7 @@
{
#1
\@@_error:nnfn { zero-div } {##2} { \fp_to_tl:n { ##3; } } { }
- \fp_flag_on:n { division_by_zero }
+ \flag_raise:n { fp_division_by_zero }
\exp_after:wN ##1
}
\exp_args:Nno \use:n
@@ -258,7 +226,7 @@
#1
\@@_error:nffn { zero-div-ii }
{ \fp_to_tl:n { ##3; } } { \fp_to_tl:n { ##4; } } {##2}
- \fp_flag_on:n { division_by_zero }
+ \flag_raise:n { fp_division_by_zero }
\exp_after:wN ##1
}
}
@@ -321,7 +289,7 @@
{ \fp_to_tl:n { \s_@@ \@@_chk:w ##1##2##3; } }
{ \token_if_eq_meaning:NNF 0 ##2 { - } #4 }
{#2}
- \fp_flag_on:n {#2}
+ \flag_raise:n { fp_#2 }
#3 ##2
}
}
@@ -337,7 +305,7 @@
% \@@_division_by_zero_o:Nnw, \@@_division_by_zero_o:NNww,
% \@@_overflow:w , \@@_underflow:w
% }
-% Initialize the two control sequences (to log properly their
+% Initialize the control sequences (to log properly their
% existence). Then set invalid operations to trigger an error, and
% division by zero, overflow, and underflow to act silently on their
% flag.
Modified: trunk/l3kernel/l3fp.dtx
===================================================================
--- trunk/l3kernel/l3fp.dtx 2017-02-14 01:41:06 UTC (rev 6922)
+++ trunk/l3kernel/l3fp.dtx 2017-02-14 03:07:25 UTC (rev 6923)
@@ -656,57 +656,27 @@
% a computation is not exact, in other words, almost always. At the
% moment, this exception is entirely ignored in \LaTeX3.
% \end{itemize}
-% To each exception is associated a \enquote{flag}, which can be either
-% \emph{on} or \emph{off}. By default, the \enquote{invalid operation}
-% exception triggers an (expandable) error, and raises the corresponding
-% flag. Other exceptions only raise the corresponding flag. The state
-% of the flag can be tested
-% and modified. The behaviour when an exception occurs can be modified
-% (using \cs{fp_trap:nn}) to either produce an error and turn the flag
-% on, or only turn the flag on, or do nothing at all.
+% To each exception we associate a \enquote{flag}: \texttt{fp_overflow},
+% \texttt{fp_underflow}, \texttt{fp_invalid_operation} and
+% \texttt{fp_division_by_zero}. The state of these flags can be tested
+% and modified with commands from \pkg{l3flag}
%
-% \begin{function}[EXP, pTF, added = 2012-08-08, tested = m3fp-traps001]
-% {\fp_if_flag_on:n}
-% \begin{syntax}
-% \cs{fp_if_flag_on_p:n} \Arg{exception}
-% \cs{fp_if_flag_on:nTF} \Arg{exception} \Arg{true code} \Arg{false code}
-% \end{syntax}
-% Tests if the flag for the \meta{exception} is on, which normally
-% means the given \meta{exception} has occurred.
-% \emph{This function is experimental, and may be altered or removed.}
-% \end{function}
+% By default, the \enquote{invalid operation} exception triggers an
+% (expandable) error, and raises the corresponding flag. Other
+% exceptions raise the corresponding flag but do not trigger an error.
+% The behaviour when an exception occurs can be modified (using
+% \cs{fp_trap:nn}) to either produce an error and raise the flag, or
+% only raise the flag, or do nothing at all.
%
-% \begin{function}[added = 2012-08-08, tested = m3fp-traps001]
-% {\fp_flag_off:n}
-% \begin{syntax}
-% \cs{fp_flag_off:n} \Arg{exception}
-% \end{syntax}
-% Locally turns off the flag which indicates whether the
-% \meta{exception} has occurred.
-% \emph{This function is experimental, and may be altered or removed.}
-% \end{function}
-%
-% \begin{function}[EXP, added = 2012-08-08, tested = m3fp-traps001]
-% {\fp_flag_on:n}
-% \begin{syntax}
-% \cs{fp_flag_on:n} \Arg{exception}
-% \end{syntax}
-% Locally turns on the flag to indicate (or pretend) that the
-% \meta{exception} has occurred. Note that this function is
-% expandable: it is used internally by \pkg{l3fp} to signal when
-% exceptions do occur.
-% \emph{This function is experimental, and may be altered or removed.}
-% \end{function}
-%
-% \begin{function}[added = 2012-07-19, updated = 2012-08-08,
+% \begin{function}[added = 2012-07-19, updated = 2017-02-13,
% tested = m3fp-traps001]{\fp_trap:nn}
% \begin{syntax}
% \cs{fp_trap:nn} \Arg{exception} \Arg{trap type}
% \end{syntax}
-% All occurrences of the \meta{exception} (\texttt{invalid_operation},
-% \texttt{division_by_zero}, \texttt{overflow}, or \texttt{underflow})
-% within the current group are treated as \meta{trap type}, which can
-% be
+% All occurrences of the \meta{exception} (\texttt{overflow},
+% \texttt{underflow}, \texttt{invalid_operation} or
+% \texttt{division_by_zero}) within the current
+% group are treated as \meta{trap type}, which can be
% \begin{itemize}
% \item \texttt{none}: the \meta{exception} will be entirely
% ignored, and leave no trace;
@@ -719,6 +689,16 @@
% \emph{This function is experimental, and may be altered or removed.}
% \end{function}
%
+% \begin{variable}
+% {
+% flag fp_overflow,
+% flag fp_underflow,
+% flag fp_invalid_operation,
+% flag fp_division_by_zero
+% }
+% Flags denoting the occurrence of various floating-point exceptions.
+% \end{variable}
+%
% \section{Viewing floating points}
%
% \begin{function}[added = 2012-05-08, updated = 2015-08-07,
Modified: trunk/l3kernel/testfiles/m3expl001.luatex.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3expl001.luatex.tlg 2017-02-14 01:41:06 UTC (rev 6922)
+++ trunk/l3kernel/testfiles/m3expl001.luatex.tlg 2017-02-14 03:07:25 UTC (rev 6923)
@@ -3525,16 +3525,10 @@
Defining \__fp_expand:n on line ...
Defining \__fp_expand_loop:nwnN on line ...
Defining message LaTeX/kernel/misused-fp on line ...
-Defining \fp_flag_off:n on line ...
-Defining \fp_flag_on:n on line ...
-Defining \fp_if_flag_on_p:n on line ...
-Defining \fp_if_flag_on:nT on line ...
-Defining \fp_if_flag_on:nF on line ...
-Defining \fp_if_flag_on:nTF on line ...
-Defining \l__fp_invalid_operation_flag_token on line ...
-Defining \l__fp_division_by_zero_flag_token on line ...
-Defining \l__fp_overflow_flag_token on line ...
-Defining \l__fp_underflow_flag_token on line ...
+Defining \flag fp_invalid_operation on line ...
+Defining \flag fp_division_by_zero on line ...
+Defining \flag fp_overflow on line ...
+Defining \flag fp_underflow on line ...
Defining \fp_trap:nn on line ...
Defining \__fp_trap_invalid_operation_set_error: on line ...
Defining \__fp_trap_invalid_operation_set_flag: on line ...
Modified: trunk/l3kernel/testfiles/m3expl001.ptex.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3expl001.ptex.tlg 2017-02-14 01:41:06 UTC (rev 6922)
+++ trunk/l3kernel/testfiles/m3expl001.ptex.tlg 2017-02-14 03:07:25 UTC (rev 6923)
@@ -3513,16 +3513,10 @@
Defining \__fp_expand:n on line ...
Defining \__fp_expand_loop:nwnN on line ...
Defining message LaTeX/kernel/misused-fp on line ...
-Defining \fp_flag_off:n on line ...
-Defining \fp_flag_on:n on line ...
-Defining \fp_if_flag_on_p:n on line ...
-Defining \fp_if_flag_on:nT on line ...
-Defining \fp_if_flag_on:nF on line ...
-Defining \fp_if_flag_on:nTF on line ...
-Defining \l__fp_invalid_operation_flag_token on line ...
-Defining \l__fp_division_by_zero_flag_token on line ...
-Defining \l__fp_overflow_flag_token on line ...
-Defining \l__fp_underflow_flag_token on line ...
+Defining \flag fp_invalid_operation on line ...
+Defining \flag fp_division_by_zero on line ...
+Defining \flag fp_overflow on line ...
+Defining \flag fp_underflow on line ...
Defining \fp_trap:nn on line ...
Defining \__fp_trap_invalid_operation_set_error: on line ...
Defining \__fp_trap_invalid_operation_set_flag: on line ...
Modified: trunk/l3kernel/testfiles/m3expl001.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3expl001.tlg 2017-02-14 01:41:06 UTC (rev 6922)
+++ trunk/l3kernel/testfiles/m3expl001.tlg 2017-02-14 03:07:25 UTC (rev 6923)
@@ -3513,16 +3513,10 @@
Defining \__fp_expand:n on line ...
Defining \__fp_expand_loop:nwnN on line ...
Defining message LaTeX/kernel/misused-fp on line ...
-Defining \fp_flag_off:n on line ...
-Defining \fp_flag_on:n on line ...
-Defining \fp_if_flag_on_p:n on line ...
-Defining \fp_if_flag_on:nT on line ...
-Defining \fp_if_flag_on:nF on line ...
-Defining \fp_if_flag_on:nTF on line ...
-Defining \l__fp_invalid_operation_flag_token on line ...
-Defining \l__fp_division_by_zero_flag_token on line ...
-Defining \l__fp_overflow_flag_token on line ...
-Defining \l__fp_underflow_flag_token on line ...
+Defining \flag fp_invalid_operation on line ...
+Defining \flag fp_division_by_zero on line ...
+Defining \flag fp_overflow on line ...
+Defining \flag fp_underflow on line ...
Defining \fp_trap:nn on line ...
Defining \__fp_trap_invalid_operation_set_error: on line ...
Defining \__fp_trap_invalid_operation_set_flag: on line ...
Modified: trunk/l3kernel/testfiles/m3expl001.uptex.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3expl001.uptex.tlg 2017-02-14 01:41:06 UTC (rev 6922)
+++ trunk/l3kernel/testfiles/m3expl001.uptex.tlg 2017-02-14 03:07:25 UTC (rev 6923)
@@ -3513,16 +3513,10 @@
Defining \__fp_expand:n on line ...
Defining \__fp_expand_loop:nwnN on line ...
Defining message LaTeX/kernel/misused-fp on line ...
-Defining \fp_flag_off:n on line ...
-Defining \fp_flag_on:n on line ...
-Defining \fp_if_flag_on_p:n on line ...
-Defining \fp_if_flag_on:nT on line ...
-Defining \fp_if_flag_on:nF on line ...
-Defining \fp_if_flag_on:nTF on line ...
-Defining \l__fp_invalid_operation_flag_token on line ...
-Defining \l__fp_division_by_zero_flag_token on line ...
-Defining \l__fp_overflow_flag_token on line ...
-Defining \l__fp_underflow_flag_token on line ...
+Defining \flag fp_invalid_operation on line ...
+Defining \flag fp_division_by_zero on line ...
+Defining \flag fp_overflow on line ...
+Defining \flag fp_underflow on line ...
Defining \fp_trap:nn on line ...
Defining \__fp_trap_invalid_operation_set_error: on line ...
Defining \__fp_trap_invalid_operation_set_flag: on line ...
Modified: trunk/l3kernel/testfiles/m3expl001.xetex.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3expl001.xetex.tlg 2017-02-14 01:41:06 UTC (rev 6922)
+++ trunk/l3kernel/testfiles/m3expl001.xetex.tlg 2017-02-14 03:07:25 UTC (rev 6923)
@@ -3523,16 +3523,10 @@
Defining \__fp_expand:n on line ...
Defining \__fp_expand_loop:nwnN on line ...
Defining message LaTeX/kernel/misused-fp on line ...
-Defining \fp_flag_off:n on line ...
-Defining \fp_flag_on:n on line ...
-Defining \fp_if_flag_on_p:n on line ...
-Defining \fp_if_flag_on:nT on line ...
-Defining \fp_if_flag_on:nF on line ...
-Defining \fp_if_flag_on:nTF on line ...
-Defining \l__fp_invalid_operation_flag_token on line ...
-Defining \l__fp_division_by_zero_flag_token on line ...
-Defining \l__fp_overflow_flag_token on line ...
-Defining \l__fp_underflow_flag_token on line ...
+Defining \flag fp_invalid_operation on line ...
+Defining \flag fp_division_by_zero on line ...
+Defining \flag fp_overflow on line ...
+Defining \flag fp_underflow on line ...
Defining \fp_trap:nn on line ...
Defining \__fp_trap_invalid_operation_set_error: on line ...
Defining \__fp_trap_invalid_operation_set_flag: on line ...
Modified: trunk/l3kernel/testfiles/m3expl003.luatex.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3expl003.luatex.tlg 2017-02-14 01:41:06 UTC (rev 6922)
+++ trunk/l3kernel/testfiles/m3expl003.luatex.tlg 2017-02-14 03:07:25 UTC (rev 6923)
@@ -3526,16 +3526,10 @@
Defining \__fp_expand:n on line ...
Defining \__fp_expand_loop:nwnN on line ...
Defining message LaTeX/kernel/misused-fp on line ...
-Defining \fp_flag_off:n on line ...
-Defining \fp_flag_on:n on line ...
-Defining \fp_if_flag_on_p:n on line ...
-Defining \fp_if_flag_on:nT on line ...
-Defining \fp_if_flag_on:nF on line ...
-Defining \fp_if_flag_on:nTF on line ...
-Defining \l__fp_invalid_operation_flag_token on line ...
-Defining \l__fp_division_by_zero_flag_token on line ...
-Defining \l__fp_overflow_flag_token on line ...
-Defining \l__fp_underflow_flag_token on line ...
+Defining \flag fp_invalid_operation on line ...
+Defining \flag fp_division_by_zero on line ...
+Defining \flag fp_overflow on line ...
+Defining \flag fp_underflow on line ...
Defining \fp_trap:nn on line ...
Defining \__fp_trap_invalid_operation_set_error: on line ...
Defining \__fp_trap_invalid_operation_set_flag: on line ...
Modified: trunk/l3kernel/testfiles/m3expl003.ptex.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3expl003.ptex.tlg 2017-02-14 01:41:06 UTC (rev 6922)
+++ trunk/l3kernel/testfiles/m3expl003.ptex.tlg 2017-02-14 03:07:25 UTC (rev 6923)
@@ -3514,16 +3514,10 @@
Defining \__fp_expand:n on line ...
Defining \__fp_expand_loop:nwnN on line ...
Defining message LaTeX/kernel/misused-fp on line ...
-Defining \fp_flag_off:n on line ...
-Defining \fp_flag_on:n on line ...
-Defining \fp_if_flag_on_p:n on line ...
-Defining \fp_if_flag_on:nT on line ...
-Defining \fp_if_flag_on:nF on line ...
-Defining \fp_if_flag_on:nTF on line ...
-Defining \l__fp_invalid_operation_flag_token on line ...
-Defining \l__fp_division_by_zero_flag_token on line ...
-Defining \l__fp_overflow_flag_token on line ...
-Defining \l__fp_underflow_flag_token on line ...
+Defining \flag fp_invalid_operation on line ...
+Defining \flag fp_division_by_zero on line ...
+Defining \flag fp_overflow on line ...
+Defining \flag fp_underflow on line ...
Defining \fp_trap:nn on line ...
Defining \__fp_trap_invalid_operation_set_error: on line ...
Defining \__fp_trap_invalid_operation_set_flag: on line ...
Modified: trunk/l3kernel/testfiles/m3expl003.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3expl003.tlg 2017-02-14 01:41:06 UTC (rev 6922)
+++ trunk/l3kernel/testfiles/m3expl003.tlg 2017-02-14 03:07:25 UTC (rev 6923)
@@ -3514,16 +3514,10 @@
Defining \__fp_expand:n on line ...
Defining \__fp_expand_loop:nwnN on line ...
Defining message LaTeX/kernel/misused-fp on line ...
-Defining \fp_flag_off:n on line ...
-Defining \fp_flag_on:n on line ...
-Defining \fp_if_flag_on_p:n on line ...
-Defining \fp_if_flag_on:nT on line ...
-Defining \fp_if_flag_on:nF on line ...
-Defining \fp_if_flag_on:nTF on line ...
-Defining \l__fp_invalid_operation_flag_token on line ...
-Defining \l__fp_division_by_zero_flag_token on line ...
-Defining \l__fp_overflow_flag_token on line ...
-Defining \l__fp_underflow_flag_token on line ...
+Defining \flag fp_invalid_operation on line ...
+Defining \flag fp_division_by_zero on line ...
+Defining \flag fp_overflow on line ...
+Defining \flag fp_underflow on line ...
Defining \fp_trap:nn on line ...
Defining \__fp_trap_invalid_operation_set_error: on line ...
Defining \__fp_trap_invalid_operation_set_flag: on line ...
Modified: trunk/l3kernel/testfiles/m3expl003.uptex.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3expl003.uptex.tlg 2017-02-14 01:41:06 UTC (rev 6922)
+++ trunk/l3kernel/testfiles/m3expl003.uptex.tlg 2017-02-14 03:07:25 UTC (rev 6923)
@@ -3514,16 +3514,10 @@
Defining \__fp_expand:n on line ...
Defining \__fp_expand_loop:nwnN on line ...
Defining message LaTeX/kernel/misused-fp on line ...
-Defining \fp_flag_off:n on line ...
-Defining \fp_flag_on:n on line ...
-Defining \fp_if_flag_on_p:n on line ...
-Defining \fp_if_flag_on:nT on line ...
-Defining \fp_if_flag_on:nF on line ...
-Defining \fp_if_flag_on:nTF on line ...
-Defining \l__fp_invalid_operation_flag_token on line ...
-Defining \l__fp_division_by_zero_flag_token on line ...
-Defining \l__fp_overflow_flag_token on line ...
-Defining \l__fp_underflow_flag_token on line ...
+Defining \flag fp_invalid_operation on line ...
+Defining \flag fp_division_by_zero on line ...
+Defining \flag fp_overflow on line ...
+Defining \flag fp_underflow on line ...
Defining \fp_trap:nn on line ...
Defining \__fp_trap_invalid_operation_set_error: on line ...
Defining \__fp_trap_invalid_operation_set_flag: on line ...
Modified: trunk/l3kernel/testfiles/m3expl003.xetex.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3expl003.xetex.tlg 2017-02-14 01:41:06 UTC (rev 6922)
+++ trunk/l3kernel/testfiles/m3expl003.xetex.tlg 2017-02-14 03:07:25 UTC (rev 6923)
@@ -3524,16 +3524,10 @@
Defining \__fp_expand:n on line ...
Defining \__fp_expand_loop:nwnN on line ...
Defining message LaTeX/kernel/misused-fp on line ...
-Defining \fp_flag_off:n on line ...
-Defining \fp_flag_on:n on line ...
-Defining \fp_if_flag_on_p:n on line ...
-Defining \fp_if_flag_on:nT on line ...
-Defining \fp_if_flag_on:nF on line ...
-Defining \fp_if_flag_on:nTF on line ...
-Defining \l__fp_invalid_operation_flag_token on line ...
-Defining \l__fp_division_by_zero_flag_token on line ...
-Defining \l__fp_overflow_flag_token on line ...
-Defining \l__fp_underflow_flag_token on line ...
+Defining \flag fp_invalid_operation on line ...
+Defining \flag fp_division_by_zero on line ...
+Defining \flag fp_overflow on line ...
+Defining \flag fp_underflow on line ...
Defining \fp_trap:nn on line ...
Defining \__fp_trap_invalid_operation_set_error: on line ...
Defining \__fp_trap_invalid_operation_set_flag: on line ...
Modified: trunk/l3kernel/testfiles/m3fp-traps001.lvt
===================================================================
--- trunk/l3kernel/testfiles/m3fp-traps001.lvt 2017-02-14 01:41:06 UTC (rev 6922)
+++ trunk/l3kernel/testfiles/m3fp-traps001.lvt 2017-02-14 03:07:25 UTC (rev 6923)
@@ -12,23 +12,23 @@
\AUTHOR{Bruno Le Floch}
\ExplSyntaxOn
% In this test file we use \iow_term:x because \TYPE produces a group
-% which hides all flag_on operations.
+% which hides all flag_raise operations.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\TEST { fp ~ flags }
{
- \fp_if_flag_on:nTF { invalid_operation } { \ERROR } { \FALSE }
- \exp_args:Nx \use_none:n { \fp_flag_on:n { invalid_operation } }
- \fp_if_flag_on:nTF { invalid_operation } { \TRUE } { \ERROR }
- \fp_flag_off:n { invalid_operation }
- \fp_if_flag_on:nTF { invalid_operation } { \ERROR } { \FALSE }
+ \flag_if_raised:nTF { fp_invalid_operation } { \ERROR } { \FALSE }
+ \exp_args:Nx \use_none:n { \flag_raise:n { fp_invalid_operation } }
+ \flag_if_raised:nTF { fp_invalid_operation } { \TRUE } { \ERROR }
+ \flag_zero:n { fp_invalid_operation }
+ \flag_if_raised:nTF { fp_invalid_operation } { \ERROR } { \FALSE }
{
\iow_term:x { \fp_to_tl:n { 0 * inf } }
- \fp_if_flag_on:nTF { invalid_operation } { \TRUE } { \ERROR }
+ \flag_if_raised:nTF { fp_invalid_operation } { \TRUE } { \ERROR }
}
- \fp_if_flag_on:nTF { invalid_operation } { \ERROR } { \FALSE }
+ \flag_if_raised:nTF { fp_invalid_operation } { \ERROR } { \FALSE }
\iow_term:x { \fp_to_decimal:n { nan } }
- \fp_if_flag_on:nTF { invalid_operation } { \TRUE } { \ERROR }
+ \flag_if_raised:nTF { fp_invalid_operation } { \TRUE } { \ERROR }
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -41,125 +41,125 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\TEST { fp_trap:nn ~ invalid ~ operation }
{
- \fp_if_flag_on:nTF { invalid_operation } { \ERROR } { \FALSE }
+ \flag_if_raised:nTF { fp_invalid_operation } { \ERROR } { \FALSE }
\iow_term:x { \fp_to_tl:n { 0 * inf } }
- \fp_if_flag_on:nTF { invalid_operation } { \TRUE } { \ERROR }
- \fp_flag_off:n { invalid_operation }
+ \flag_if_raised:nTF { fp_invalid_operation } { \TRUE } { \ERROR }
+ \flag_zero:n { fp_invalid_operation }
{
\fp_trap:nn { invalid_operation } { error }
\iow_term:x { \fp_to_tl:n { 0 * inf } }
- \fp_if_flag_on:nTF { invalid_operation } { \TRUE } { \ERROR }
+ \flag_if_raised:nTF { fp_invalid_operation } { \TRUE } { \ERROR }
}
{
\fp_trap:nn { invalid_operation } { flag }
\iow_term:x { \fp_to_tl:n { 0 * inf } }
- \fp_if_flag_on:nTF { invalid_operation } { \TRUE } { \ERROR }
+ \flag_if_raised:nTF { fp_invalid_operation } { \TRUE } { \ERROR }
}
{
\fp_trap:nn { invalid_operation } { none }
\iow_term:x { \fp_to_tl:n { 0 * inf } }
- \fp_if_flag_on:nTF { invalid_operation } { \ERROR } { \FALSE }
+ \flag_if_raised:nTF { fp_invalid_operation } { \ERROR } { \FALSE }
}
\iow_term:x { \fp_to_tl:n { 0 * inf } }
- \fp_if_flag_on:nTF { invalid_operation } { \TRUE } { \ERROR }
+ \flag_if_raised:nTF { fp_invalid_operation } { \TRUE } { \ERROR }
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\TEST { fp_trap:nn ~ division ~ by ~ zero }
{
- \fp_if_flag_on:nTF { division_by_zero } { \ERROR } { \FALSE }
+ \flag_if_raised:nTF { fp_division_by_zero } { \ERROR } { \FALSE }
\iow_term:x { \fp_to_tl:n { 1 / 0 } }
- \fp_if_flag_on:nTF { division_by_zero } { \TRUE } { \ERROR }
- \fp_flag_off:n { division_by_zero }
+ \flag_if_raised:nTF { fp_division_by_zero } { \TRUE } { \ERROR }
+ \flag_zero:n { fp_division_by_zero }
{
\fp_trap:nn { division_by_zero } { error }
\iow_term:x { \fp_to_tl:n { 1 / 0 } }
- \fp_if_flag_on:nTF { division_by_zero } { \TRUE } { \ERROR }
+ \flag_if_raised:nTF { fp_division_by_zero } { \TRUE } { \ERROR }
}
{
\fp_trap:nn { division_by_zero } { flag }
\iow_term:x { \fp_to_tl:n { 1 / 0 } }
- \fp_if_flag_on:nTF { division_by_zero } { \TRUE } { \ERROR }
+ \flag_if_raised:nTF { fp_division_by_zero } { \TRUE } { \ERROR }
}
{
\fp_trap:nn { division_by_zero } { none }
\iow_term:x { \fp_to_tl:n { 1 / 0 } }
- \fp_if_flag_on:nTF { division_by_zero } { \ERROR } { \FALSE }
+ \flag_if_raised:nTF { fp_division_by_zero } { \ERROR } { \FALSE }
}
\iow_term:x { \fp_to_tl:n { 1 / 0 } }
- \fp_if_flag_on:nTF { division_by_zero } { \TRUE } { \ERROR }
+ \flag_if_raised:nTF { fp_division_by_zero } { \TRUE } { \ERROR }
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\TEST { fp_trap:nn ~ overflow }
{
\iow_term:x { \fp_to_tl:n { 1e9999 * 1e9999 } }
- \fp_if_flag_on:nTF { overflow } { \TRUE } { \ERROR }
- \fp_flag_off:n { overflow }
+ \flag_if_raised:nTF { fp_overflow } { \TRUE } { \ERROR }
+ \flag_zero:n { fp_overflow }
{
\fp_trap:nn { overflow } { none }
\iow_term:x { \fp_to_tl:n { 1e9999 * 1e9999 } }
- \fp_if_flag_on:nTF { overflow } { \ERROR } { \FALSE }
+ \flag_if_raised:nTF { fp_overflow } { \ERROR } { \FALSE }
}
{
\fp_trap:nn { overflow } { flag }
\iow_term:x { \fp_to_tl:n { 1e9999 * 1e9999 } }
- \fp_if_flag_on:nTF { overflow } { \TRUE } { \ERROR }
+ \flag_if_raised:nTF { fp_overflow } { \TRUE } { \ERROR }
}
{
\fp_trap:nn { overflow } { error }
\iow_term:x { \fp_to_tl:n { 1e9999 * 1e9999 } }
- \fp_if_flag_on:nTF { overflow } { \TRUE } { \ERROR }
+ \flag_if_raised:nTF { fp_overflow } { \TRUE } { \ERROR }
}
- \fp_flag_off:n { overflow }
+ \flag_zero:n { fp_overflow }
\iow_term:x { \fp_to_tl:n { 1e9999 * 1e9999 } }
- \fp_if_flag_on:nTF { overflow } { \TRUE } { \ERROR }
- \fp_flag_off:n { overflow }
+ \flag_if_raised:nTF { fp_overflow } { \TRUE } { \ERROR }
+ \flag_zero:n { fp_overflow }
\iow_term:x { \fp_to_tl:n { exp(1e5678) } }
- \fp_if_flag_on:nTF { overflow } { \TRUE } { \ERROR }
+ \flag_if_raised:nTF { fp_overflow } { \TRUE } { \ERROR }
\fp_trap:nn { overflow } { error }
- \fp_flag_off:n { overflow }
+ \flag_zero:n { fp_overflow }
\iow_term:x { \fp_to_tl:n { 1e9999 * 1e9999 } }
- \fp_if_flag_on:nTF { overflow } { \TRUE } { \ERROR }
- \fp_flag_off:n { overflow }
+ \flag_if_raised:nTF { fp_overflow } { \TRUE } { \ERROR }
+ \flag_zero:n { fp_overflow }
\iow_term:x { \fp_to_tl:n { exp(1e5678) } }
- \fp_if_flag_on:nTF { overflow } { \TRUE } { \ERROR }
+ \flag_if_raised:nTF { fp_overflow } { \TRUE } { \ERROR }
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\TEST { fp_trap:nn ~ underflow }
{
\iow_term:x { \fp_to_tl:n { 1e-9999 * 1e-9999 } }
- \fp_if_flag_on:nTF { underflow } { \TRUE } { \ERROR }
- \fp_flag_off:n { underflow }
+ \flag_if_raised:nTF { fp_underflow } { \TRUE } { \ERROR }
+ \flag_zero:n { fp_underflow }
{
\fp_trap:nn { underflow } { none }
\iow_term:x { \fp_to_tl:n { 1e-9999 * 1e-9999 } }
- \fp_if_flag_on:nTF { underflow } { \ERROR } { \FALSE }
+ \flag_if_raised:nTF { fp_underflow } { \ERROR } { \FALSE }
}
{
\fp_trap:nn { underflow } { flag }
\iow_term:x { \fp_to_tl:n { 1e-9999 * 1e-9999 } }
- \fp_if_flag_on:nTF { underflow } { \TRUE } { \ERROR }
+ \flag_if_raised:nTF { fp_underflow } { \TRUE } { \ERROR }
}
{
\fp_trap:nn { underflow } { error }
\iow_term:x { \fp_to_tl:n { 1e-9999 * 1e-9999 } }
- \fp_if_flag_on:nTF { underflow } { \TRUE } { \ERROR }
+ \flag_if_raised:nTF { fp_underflow } { \TRUE } { \ERROR }
}
- \fp_flag_off:n { underflow }
+ \flag_zero:n { fp_underflow }
\iow_term:x { \fp_to_tl:n { 1e-9999 * 1e-9999 } }
- \fp_if_flag_on:nTF { underflow } { \TRUE } { \ERROR }
- \fp_flag_off:n { underflow }
+ \flag_if_raised:nTF { fp_underflow } { \TRUE } { \ERROR }
+ \flag_zero:n { fp_underflow }
\iow_term:x { \fp_to_tl:n { exp(-1e5678) } }
- \fp_if_flag_on:nTF { underflow } { \TRUE } { \ERROR }
+ \flag_if_raised:nTF { fp_underflow } { \TRUE } { \ERROR }
\fp_trap:nn { underflow } { error }
- \fp_flag_off:n { underflow }
+ \flag_zero:n { fp_underflow }
\iow_term:x { \fp_to_tl:n { 1e-9999 * 1e-9999 } }
- \fp_if_flag_on:nTF { underflow } { \TRUE } { \ERROR }
- \fp_flag_off:n { underflow }
+ \flag_if_raised:nTF { fp_underflow } { \TRUE } { \ERROR }
+ \flag_zero:n { fp_underflow }
\iow_term:x { \fp_to_tl:n { exp(-1e5678) } }
- \fp_if_flag_on:nTF { underflow } { \TRUE } { \ERROR }
+ \flag_if_raised:nTF { fp_underflow } { \TRUE } { \ERROR }
}
\END
More information about the latex3-commits
mailing list