aboutsummaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2001-02-19 23:16:05 +0000
committerUlrich Drepper <drepper@redhat.com>2001-02-19 23:16:05 +0000
commitf14bd805a73308dd187d9fc768358a07a8efc54a (patch)
tree3cd722357ad98e9af17ba75e95603bce20c067f6 /sysdeps
parentd210ca02ec8a5ba034946c57b85c2f3e503a6017 (diff)
downloadglibc-f14bd805a73308dd187d9fc768358a07a8efc54a.tar
glibc-f14bd805a73308dd187d9fc768358a07a8efc54a.tar.gz
glibc-f14bd805a73308dd187d9fc768358a07a8efc54a.tar.bz2
glibc-f14bd805a73308dd187d9fc768358a07a8efc54a.zip
Update.
* sysdeps/ieee754/flt-32/e_powf.c: Handle x == +-1 correctly. * sysdeps/ieee754/dbl-64/e_pow.c: Likewise.
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/ieee754/dbl-64/e_pow.c4
-rw-r--r--sysdeps/ieee754/flt-32/e_powf.c4
2 files changed, 8 insertions, 0 deletions
diff --git a/sysdeps/ieee754/dbl-64/e_pow.c b/sysdeps/ieee754/dbl-64/e_pow.c
index 1e1496f00d..73e8f471f6 100644
--- a/sysdeps/ieee754/dbl-64/e_pow.c
+++ b/sysdeps/ieee754/dbl-64/e_pow.c
@@ -149,6 +149,10 @@ C[] = {
/* y==zero: x**0 = 1 */
if((iy|ly)==0) return C[1];
+ /* x==+-1 */
+ if(x == 1.0) return C[1];
+ if(x == -1.0 && isinf(y)) return C[1];
+
/* +-NaN return x+y */
if(ix > 0x7ff00000 || ((ix==0x7ff00000)&&(lx!=0)) ||
iy > 0x7ff00000 || ((iy==0x7ff00000)&&(ly!=0)))
diff --git a/sysdeps/ieee754/flt-32/e_powf.c b/sysdeps/ieee754/flt-32/e_powf.c
index 4798340c84..9f520804a4 100644
--- a/sysdeps/ieee754/flt-32/e_powf.c
+++ b/sysdeps/ieee754/flt-32/e_powf.c
@@ -76,6 +76,10 @@ ivln2_l = 7.0526075433e-06; /* 0x36eca570 =1/ln2 tail*/
/* y==zero: x**0 = 1 */
if(iy==0) return one;
+ /* x==+-1 */
+ if(x == 1.0) return one;
+ if(x == -1.0 && isinf(y)) return one;
+
/* +-NaN return x+y */
if(ix > 0x7f800000 ||
iy > 0x7f800000)