summaryrefslogtreecommitdiff
path: root/src/math/powl.c
diff options
context:
space:
mode:
authorSzabolcs Nagy <nsz@port70.net>2015-04-11 00:35:07 +0000
committerRich Felker <dalias@aerifal.cx>2015-04-18 00:18:52 -0400
commitcb5c057c87240a9534f8e0d9b7ff2560082f6218 (patch)
tree117ffb9451b09596e2cfff1c7a98513f55d39eab /src/math/powl.c
parent1b1cafa50c11d4c772a4f938b2feb7cbcc5f992a (diff)
downloadmusl-cb5c057c87240a9534f8e0d9b7ff2560082f6218.tar.gz
math: fix pow(+-0,-inf) not to raise divbyzero flag
this reverts the commit f29fea00b5bc72d4b8abccba2bb1e312684d1fce which was based on a bug in C99 and POSIX and did not match IEEE-754 http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1515.pdf
Diffstat (limited to 'src/math/powl.c')
-rw-r--r--src/math/powl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/math/powl.c b/src/math/powl.c
index a765706d..5b6da07b 100644
--- a/src/math/powl.c
+++ b/src/math/powl.c
@@ -227,7 +227,7 @@ long double powl(long double x, long double y)
if (y <= -LDBL_MAX) {
if (x > 1.0 || x < -1.0)
return 0.0;
- if (x != 0.0)
+ if (x != 0.0 || y == -INFINITY)
return INFINITY;
}
if (x >= LDBL_MAX) {