summaryrefslogtreecommitdiff
path: root/libc/sysdeps/ieee754/dbl-64
diff options
context:
space:
mode:
authorjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2012-11-09 22:50:35 +0000
committerjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2012-11-09 22:50:35 +0000
commit5134213014448b459864d05ba6f556344c7b079f (patch)
tree95c6888a9704245ace6cfe82a457bc01b6bc1a6e /libc/sysdeps/ieee754/dbl-64
parent5c8ae23aecdb14ee22ba06684c488cfe0306ff0e (diff)
Merge changes between r21563 and r21628 from /fsf/trunk.
git-svn-id: svn://svn.eglibc.org/trunk@21629 7b3dc134-2b1b-0410-93df-9e9f96275f8d
Diffstat (limited to 'libc/sysdeps/ieee754/dbl-64')
-rw-r--r--libc/sysdeps/ieee754/dbl-64/e_pow.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libc/sysdeps/ieee754/dbl-64/e_pow.c b/libc/sysdeps/ieee754/dbl-64/e_pow.c
index 3fd5e6507..513171891 100644
--- a/libc/sysdeps/ieee754/dbl-64/e_pow.c
+++ b/libc/sysdeps/ieee754/dbl-64/e_pow.c
@@ -90,6 +90,10 @@ __ieee754_pow(double x, double y) {
SET_RESTORE_ROUND (FE_TONEAREST);
+ /* Avoid internal underflow for tiny y. The exact value of y does
+ not matter if |y| <= 2**-64. */
+ if (ABS (y) < 0x1p-64)
+ y = y < 0 ? -0x1p-64 : 0x1p-64;
z = log1(x,&aa,&error); /* x^y =e^(y log (X)) */
t = y*134217729.0;
y1 = t - (t-y);