logf: Work around OSF/1 5.1 bug.
[gnulib.git] / lib / logf.c
index 51696e5..3bf0f13 100644 (file)
 
 float
 logf (float x)
+#undef logf
 {
+#if HAVE_LOGF
+  /* Work around the OSF/1 5.1 bug.  */
+  if (x == 0.0f)
+    /* Return -Infinity.  */
+    return -1.0f / 0.0f;
+  return logf (x);
+#else
   return (float) log ((double) x);
+#endif
 }