diff options
author | Joseph Myers <joseph@codesourcery.com> | 2012-06-15 11:27:51 +0000 |
---|---|---|
committer | Joseph Myers <joseph@codesourcery.com> | 2012-06-15 11:27:51 +0000 |
commit | 10285c21134b280457094a6acaa9341862bc65ef (patch) | |
tree | 66569a906f5b11ca2d9bcb5f15c8f6d48e4019a5 /sysdeps/ieee754 | |
parent | 06c5abbdf81660d1ca99a3b4467f91fb9bca84dd (diff) | |
download | glibc-10285c21134b280457094a6acaa9341862bc65ef.tar.gz glibc-10285c21134b280457094a6acaa9341862bc65ef.tar.xz glibc-10285c21134b280457094a6acaa9341862bc65ef.zip |
Fix pow (0.0, -Inf) (bug 14241).
Diffstat (limited to 'sysdeps/ieee754')
-rw-r--r-- | sysdeps/ieee754/dbl-64/e_pow.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sysdeps/ieee754/dbl-64/e_pow.c b/sysdeps/ieee754/dbl-64/e_pow.c index 6c41af93ba..3fd5e6507f 100644 --- a/sysdeps/ieee754/dbl-64/e_pow.c +++ b/sysdeps/ieee754/dbl-64/e_pow.c @@ -112,12 +112,12 @@ __ieee754_pow(double x, double y) { if (((v.i[HIGH_HALF] & 0x7fffffff) == 0x7ff00000 && v.i[LOW_HALF] != 0) || (v.i[HIGH_HALF] & 0x7fffffff) > 0x7ff00000) return y; - if (ABS(y) > 1.0e20) return (y>0)?0:1.0/ABS(x); + if (ABS(y) > 1.0e20) return (y>0)?0:1.0/0.0; k = checkint(y); if (k == -1) return y < 0 ? 1.0/x : x; else - return y < 0 ? 1.0/ABS(x) : 0.0; /* return 0 */ + return y < 0 ? 1.0/0.0 : 0.0; /* return 0 */ } qx = u.i[HIGH_HALF]&0x7fffffff; /* no sign */ |