From 10285c21134b280457094a6acaa9341862bc65ef Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Fri, 15 Jun 2012 11:27:51 +0000 Subject: Fix pow (0.0, -Inf) (bug 14241). --- sysdeps/ieee754/dbl-64/e_pow.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sysdeps') 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 */ -- cgit v1.2.3-70-g09d2