mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-02-02 04:20:28 +08:00
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:
parent
bd14299346
commit
e39f26c0ba
@ -84,8 +84,7 @@ PORTABILITY
|
|||||||
}
|
}
|
||||||
if(finite(y)&&y<0.0) {
|
if(finite(y)&&y<0.0) {
|
||||||
/* 0**neg */
|
/* 0**neg */
|
||||||
errno = EDOM;
|
errno = ERANGE;
|
||||||
return -HUGE_VAL;
|
|
||||||
}
|
}
|
||||||
return z;
|
return z;
|
||||||
}
|
}
|
||||||
|
@ -50,8 +50,7 @@
|
|||||||
}
|
}
|
||||||
if(finitef(y)&&y<0.0f) {
|
if(finitef(y)&&y<0.0f) {
|
||||||
/* 0**neg */
|
/* 0**neg */
|
||||||
errno = EDOM;
|
errno = ERANGE;
|
||||||
return -HUGE_VALF;
|
|
||||||
}
|
}
|
||||||
return z;
|
return z;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user