strtoimax: port to HP-UX 11.11
[gnulib.git] / lib / cbrtl.c
index fe635f8..56219fb 100644 (file)
@@ -1,5 +1,5 @@
 /* Compute cubic root of long double value.
-   Copyright (C) 2012 Free Software Foundation, Inc.
+   Copyright (C) 2012-2013 Free Software Foundation, Inc.
    Cephes Math Library Release 2.2: January, 1991
    Copyright 1984, 1991 by Stephen L. Moshier
    Adapted for glibc October, 2001.
@@ -140,7 +140,13 @@ cbrtl (long double x)
       return x;
     }
   else
-    return x + x;
+    {
+# ifdef __sgi /* so that when x == -0.0L, the result is -0.0L not +0.0L */
+      return x;
+# else
+      return x + x;
+# endif
+    }
 }
 
 #endif