doc: use ASCII in .texi files where UTF-8 isn't needed
[gnulib.git] / lib / log10l.c
index ecaacb2..271d179 100644 (file)
@@ -1,5 +1,5 @@
 /* Base 10 logarithmic function.
-   Copyright (C) 2012 Free Software Foundation, Inc.
+   Copyright (C) 2012-2014 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -27,6 +27,29 @@ log10l (long double x)
   return log10 (x);
 }
 
+#elif HAVE_LOG10L
+
+# include <float.h>
+
+long double
+log10l (long double x)
+# undef log10l
+{
+  /* Work around the OSF/1 5.1 bug.  */
+  if (x == 0.0L)
+    /* Return -Infinity.  */
+    return -1.0L / 0.0L;
+  {
+    long double y = log10l (x);
+# ifdef __sgi
+    /* Normalize the +Infinity value.  */
+    if (y > LDBL_MAX)
+      y = 1.0L / 0.0L;
+# endif
+    return y;
+  }
+}
+
 #else
 
 /* 1 / log(10) */