Remove misleading statement about raising of FE_INVALID (bug 24078)

Message ID 20190109184223.32577-1-gabriel@inconstante.eti.br
State Dropped
Delegated to: Joseph Myers
Headers

Commit Message

Gabriel F. T. Gomes Jan. 9, 2019, 6:42 p.m. UTC
  See bugzilla entry for a longer description.

-- 8< --
In the floating-point comparisons `==' and `<', there is no difference
in behavior when it comes to the raising of FE_INVALID exceptions.  This
patch removes, from the manual, a sentence that states otherwise.

	[BZ #24078]
	* manual/arith.texi (Floating-Point Comparison Functions):
	Remove statement about `==' and `!=' not raising floating-point
	exceptions.
---
 manual/arith.texi | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
  

Comments

Joseph Myers Jan. 9, 2019, 9:20 p.m. UTC | #1
On Wed, 9 Jan 2019, Gabriel F. T. Gomes wrote:

> See bugzilla entry for a longer description.
> 
> -- 8< --
> In the floating-point comparisons `==' and `<', there is no difference
> in behavior when it comes to the raising of FE_INVALID exceptions.  This
> patch removes, from the manual, a sentence that states otherwise.

This change is incorrect.  == and != do not raise exceptions except for 
signaling NaNs; ordered comparisons raise exceptions for both quiet and 
signaling NaNs (you can use the is* macros from C99 to avoid exceptions 
for quiet NaNs for ordered comparisons, and iseqsig from TS 18661-1 to get 
exceptions for quiet NaNs for equality comparisons).
  

Patch

diff --git a/manual/arith.texi b/manual/arith.texi
index 6ca7902b3d..163ef7ef25 100644
--- a/manual/arith.texi
+++ b/manual/arith.texi
@@ -1947,9 +1947,7 @@  int v = a < 1.0;
 @end smallexample
 
 @noindent
-will raise an exception if @var{a} is NaN.  (This does @emph{not}
-happen with @code{==} and @code{!=}; those merely return false and true,
-respectively, when NaN is examined.)  Frequently this exception is
+will raise an exception if @var{a} is NaN.  Frequently this exception is
 undesirable.  @w{ISO C99} therefore defines comparison functions that
 do not raise exceptions when NaN is examined.  All of the functions are
 implemented as macros which allow their arguments to be of any