summaryrefslogtreecommitdiff
path: root/libm/e_log10.c
diff options
context:
space:
mode:
Diffstat (limited to 'libm/e_log10.c')
-rw-r--r--libm/e_log10.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/libm/e_log10.c b/libm/e_log10.c
index 6cf3ea4ee..ff2241e56 100644
--- a/libm/e_log10.c
+++ b/libm/e_log10.c
@@ -78,3 +78,24 @@ double attribute_hidden __ieee754_log10(double x)
z = y*log10_2lo + ivln10*__ieee754_log(x);
return z+y*log10_2hi;
}
+
+/*
+ * wrapper log10(X)
+ */
+#ifndef _IEEE_LIBM
+double log10(double x)
+{
+ double z = __ieee754_log10(x);
+ if (_LIB_VERSION == _IEEE_ || isnan(x))
+ return z;
+ if (x <= 0.0) {
+ if(x == 0.0)
+ return __kernel_standard(x, x, 18); /* log10(0) */
+ return __kernel_standard(x, x, 19); /* log10(x<0) */
+ }
+ return z;
+}
+#else
+strong_alias(__ieee754_log10, log10)
+#endif
+libm_hidden_def(log10)