@@ -372,6 +372,7 @@ libm-test-funcs-auto-static = \
exp10 \
log2 \
log10 \
+ y0 \
# libm-test-funcs-auto-static
libm-test-funcs-noauto-static = \
copysign \
@@ -39,11 +39,19 @@ M_DECL_FUNC (__y0) (FLOAT x)
if (__glibc_unlikely (islessequal (x, M_LIT (0.0))))
{
if (x < 0)
- /* Domain error: y0(x<0). */
- __set_errno (EDOM);
+ {
+ /* Domain error: y0(x<0). */
+ __feraiseexcept (FE_INVALID);
+ __set_errno (EDOM);
+ return NAN;
+ }
else if (x == 0)
- /* Pole error: y0(0). */
- __set_errno (ERANGE);
+ {
+ /* Pole error: y0(0). */
+ __feraiseexcept (FE_DIVBYZERO);
+ __set_errno (ERANGE);
+ return -INFINITY;
+ }
}
return M_SUF (__ieee754_y0) (x);
}