Print this page
11175 libm should use signbit() correctly
11188 c99 math macros should return strictly backward compatible values

@@ -65,11 +65,12 @@
         small = 1.0e-10,
         big = 1.0e10;
 /* INDENT ON */
 
 double
-tanh(double x) {
+tanh(double x)
+{
         double t, y, z;
         int signx;
         volatile double dummy __unused;
 
         if (isnan(x))

@@ -92,9 +93,9 @@
                         return (x);
                 }
         } else if (!finite(t))
                 return (copysign(1.0, x));
         else
-                return (signx == 1 ? -z + small * small : z - small * small);
+                return ((signx != 0) ? -z + small * small : z - small * small);
 
-        return (signx == 1 ? -z : z);
+        return ((signx != 0) ? -z : z);
 }