@@ -370,6 +370,7 @@ $(libm-test-c-narrow-obj): $(objpfx)libm-test%.c: libm-test%.inc \
libm-test-funcs-auto-static = \
acos \
exp10 \
+ log10 \
# libm-test-funcs-auto-static
libm-test-funcs-noauto-static = \
copysign \
@@ -32,11 +32,19 @@ M_DECL_FUNC (__log10) (FLOAT x)
if (__glibc_unlikely (islessequal (x, M_LIT (0.0))))
{
if (x == 0)
- /* Pole error: log10(0). */
- __set_errno (ERANGE);
+ {
+ /* Pole error: log10(0). */
+ __feraiseexcept (FE_DIVBYZERO);
+ __set_errno (ERANGE);
+ return -INFINITY;
+ }
else
- /* Domain error: log10(<0). */
- __set_errno (EDOM);
+ {
+ /* Domain error: log10(<0). */
+ __feraiseexcept (FE_INVALID);
+ __set_errno (EDOM);
+ return NAN;
+ }
}
return M_SUF (__ieee754_log10) (x);
}