diff options
author | Szabolcs Nagy <nsz@port70.net> | 2015-04-11 00:35:07 +0000 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2015-04-18 00:18:52 -0400 |
commit | cb5c057c87240a9534f8e0d9b7ff2560082f6218 (patch) | |
tree | 117ffb9451b09596e2cfff1c7a98513f55d39eab /src/math/pow.c | |
parent | 1b1cafa50c11d4c772a4f938b2feb7cbcc5f992a (diff) | |
download | musl-cb5c057c87240a9534f8e0d9b7ff2560082f6218.tar.gz musl-cb5c057c87240a9534f8e0d9b7ff2560082f6218.tar.xz musl-cb5c057c87240a9534f8e0d9b7ff2560082f6218.zip |
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/pow.c')
-rw-r--r-- | src/math/pow.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/math/pow.c b/src/math/pow.c index 82f684bd..b66f632d 100644 --- a/src/math/pow.c +++ b/src/math/pow.c @@ -143,7 +143,7 @@ double pow(double x, double y) return 1.0; else if (ix >= 0x3ff00000) /* (|x|>1)**+-inf = inf,0 */ return hy >= 0 ? y : 0.0; - else if ((ix|lx) != 0) /* (|x|<1)**+-inf = 0,inf if x!=0 */ + else /* (|x|<1)**+-inf = 0,inf */ return hy >= 0 ? 0.0 : -y; } if (iy == 0x3ff00000) { /* y is +-1 */ |