Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Dec 2010 00:02:49 +0000 (UTC)
From:      David Schultz <das@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r216222 - head/tools/regression/lib/msun
Message-ID:  <201012060002.oB602nmC013758@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: das
Date: Mon Dec  6 00:02:49 2010
New Revision: 216222
URL: http://svn.freebsd.org/changeset/base/216222

Log:
  signbit() returns nonzero for negative arguments, but we shouldn't assume
  that it always returns the same nonzero value.

Modified:
  head/tools/regression/lib/msun/test-exponential.c
  head/tools/regression/lib/msun/test-fma.c
  head/tools/regression/lib/msun/test-fmaxmin.c
  head/tools/regression/lib/msun/test-invtrig.c
  head/tools/regression/lib/msun/test-logarithm.c
  head/tools/regression/lib/msun/test-trig.c

Modified: head/tools/regression/lib/msun/test-exponential.c
==============================================================================
--- head/tools/regression/lib/msun/test-exponential.c	Sun Dec  5 23:50:49 2010	(r216221)
+++ head/tools/regression/lib/msun/test-exponential.c	Mon Dec  6 00:02:49 2010	(r216222)
@@ -89,7 +89,7 @@ __FBSDID("$FreeBSD$");
 int
 fpequal(long double x, long double y)
 {
-	return ((x == y && signbit(x) == signbit(y)) || isnan(x) && isnan(y));
+	return ((x == y && !signbit(x) == !signbit(y)) || isnan(x) && isnan(y));
 }
 
 void

Modified: head/tools/regression/lib/msun/test-fma.c
==============================================================================
--- head/tools/regression/lib/msun/test-fma.c	Sun Dec  5 23:50:49 2010	(r216221)
+++ head/tools/regression/lib/msun/test-fma.c	Mon Dec  6 00:02:49 2010	(r216222)
@@ -85,7 +85,8 @@ int
 fpequal(long double x, long double y)
 {
 
-	return ((x == y && signbit(x) == signbit(y)) || (isnan(x) && isnan(y)));
+	return ((x == y && !signbit(x) == !signbit(y))
+		|| (isnan(x) && isnan(y)));
 }
 
 static void

Modified: head/tools/regression/lib/msun/test-fmaxmin.c
==============================================================================
--- head/tools/regression/lib/msun/test-fmaxmin.c	Sun Dec  5 23:50:49 2010	(r216221)
+++ head/tools/regression/lib/msun/test-fmaxmin.c	Mon Dec  6 00:02:49 2010	(r216222)
@@ -50,7 +50,8 @@ static inline int
 fpequal(long double x, long double y)
 {
 
-	return ((x == y && signbit(x) == signbit(y)) || (isnan(x) && isnan(y)));
+	return ((x == y && !signbit(x) == !signbit(y))
+		|| (isnan(x) && isnan(y)));
 }
 
 /*

Modified: head/tools/regression/lib/msun/test-invtrig.c
==============================================================================
--- head/tools/regression/lib/msun/test-invtrig.c	Sun Dec  5 23:50:49 2010	(r216221)
+++ head/tools/regression/lib/msun/test-invtrig.c	Mon Dec  6 00:02:49 2010	(r216222)
@@ -118,7 +118,7 @@ fpequal(long double x, long double y, lo
 
 	if (isnan(x) && isnan(y))
 		return (1);
-	if (signbit(x) != signbit(y))
+	if (!signbit(x) != !signbit(y))
 		return (0);
 	if (x == y)
 		return (1);

Modified: head/tools/regression/lib/msun/test-logarithm.c
==============================================================================
--- head/tools/regression/lib/msun/test-logarithm.c	Sun Dec  5 23:50:49 2010	(r216221)
+++ head/tools/regression/lib/msun/test-logarithm.c	Mon Dec  6 00:02:49 2010	(r216222)
@@ -90,7 +90,7 @@ __FBSDID("$FreeBSD$");
 int
 fpequal(long double x, long double y)
 {
-	return ((x == y && signbit(x) == signbit(y)) || isnan(x) && isnan(y));
+	return ((x == y && !signbit(x) == !signbit(y)) || isnan(x) && isnan(y));
 }
 
 void

Modified: head/tools/regression/lib/msun/test-trig.c
==============================================================================
--- head/tools/regression/lib/msun/test-trig.c	Sun Dec  5 23:50:49 2010	(r216221)
+++ head/tools/regression/lib/msun/test-trig.c	Mon Dec  6 00:02:49 2010	(r216222)
@@ -90,7 +90,7 @@ __FBSDID("$FreeBSD$");
 int
 fpequal(long double x, long double y)
 {
-	return ((x == y && signbit(x) == signbit(y)) || isnan(x) && isnan(y));
+	return ((x == y && !signbit(x) == !signbit(y)) || isnan(x) && isnan(y));
 }
 
 /*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201012060002.oB602nmC013758>