libm/math: Set errno to ERANGE for pow(0, -y)

POSIX says that the errno for pow(0, -y) should be ERANGE instead of
EDOM.

https://pubs.opengroup.org/onlinepubs/9699919799/functions/pow.html

Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
Keith Packard via Newlib 2020-08-04 15:22:22 -07:00 committed by Corinna Vinschen
parent 2eafcc78df
commit 98a4f8de47
2 changed files with 2 additions and 4 deletions

View File

@ -84,8 +84,7 @@ PORTABILITY
}
if(finite(y)&&y<0.0) {
/* 0**neg */
errno = EDOM;
return -HUGE_VAL;
errno = ERANGE;
}
return z;
}

View File

@ -50,8 +50,7 @@
}
if(finitef(y)&&y<0.0f) {
/* 0**neg */
errno = EDOM;
return -HUGE_VALF;
errno = ERANGE;
}
return z;
}