From d7dd94539899466a9a4e38c61ab846ffcb314dad Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Mon, 9 Apr 2012 09:43:18 +0000 Subject: Fix missing overflow exceptions from pow (bug 13873). --- sysdeps/ieee754/dbl-64/e_pow.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sysdeps/ieee754/dbl-64/e_pow.c') diff --git a/sysdeps/ieee754/dbl-64/e_pow.c b/sysdeps/ieee754/dbl-64/e_pow.c index 26ffaaddc6..6c41af93ba 100644 --- a/sysdeps/ieee754/dbl-64/e_pow.c +++ b/sysdeps/ieee754/dbl-64/e_pow.c @@ -47,6 +47,7 @@ # define SECTION #endif +static const double huge = 1.0e300, tiny = 1.0e-300; double __exp1(double x, double xx, double error); static double log1(double x, double *delta, double *error); @@ -156,8 +157,8 @@ __ieee754_pow(double x, double y) { if (qy > 0x45f00000 && qy < 0x7ff00000) { if (x == 1.0) return 1.0; - if (y>0) return (x>1.0)?INF.x:0; - if (y<0) return (x<1.0)?INF.x:0; + if (y>0) return (x>1.0)?huge*huge:tiny*tiny; + if (y<0) return (x<1.0)?huge*huge:tiny*tiny; } if (x == 1.0) return 1.0; -- cgit 1.4.1