diff options
author | Joseph Myers <joseph@codesourcery.com> | 2012-04-09 09:43:18 +0000 |
---|---|---|
committer | Joseph Myers <joseph@codesourcery.com> | 2012-04-09 09:43:18 +0000 |
commit | d7dd94539899466a9a4e38c61ab846ffcb314dad (patch) | |
tree | 30a319648bb4afe4e4296d2e77cb7bbf8084893d /sysdeps | |
parent | c483f6b4a4277bc209820efc1ae35d976af57b4e (diff) | |
download | glibc-d7dd94539899466a9a4e38c61ab846ffcb314dad.zip glibc-d7dd94539899466a9a4e38c61ab846ffcb314dad.tar.gz glibc-d7dd94539899466a9a4e38c61ab846ffcb314dad.tar.bz2 |
Fix missing overflow exceptions from pow (bug 13873).
Diffstat (limited to 'sysdeps')
-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 26ffaad..6c41af9 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; |