/* 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
#elif HAVE_LOG10L
+# include <float.h>
+
long double
log10l (long double x)
# undef log10l
if (x == 0.0L)
/* Return -Infinity. */
return -1.0L / 0.0L;
- return log10l (x);
+ {
+ long double y = log10l (x);
+# ifdef __sgi
+ /* Normalize the +Infinity value. */
+ if (y > LDBL_MAX)
+ y = 1.0L / 0.0L;
+# endif
+ return y;
+ }
}
#else