svn commit: r216222 - head/tools/regression/lib/msun

David Schultz das at FreeBSD.org
Mon Dec 6 00:02:49 UTC 2010


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));
 }
 
 /*


More information about the svn-src-head mailing list