diff options
Diffstat (limited to 'sysdeps/ieee754/dbl-64/e_pow.c')
-rw-r--r-- | sysdeps/ieee754/dbl-64/e_pow.c | 5 |
1 files changed, 3 insertions, 2 deletions
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; |