]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Fix ldbl-128ibm powl spurious underflows.
authorJoseph Myers <joseph@codesourcery.com>
Thu, 22 Nov 2012 14:59:45 +0000 (14:59 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Thu, 22 Nov 2012 14:59:45 +0000 (14:59 +0000)
ChangeLog
sysdeps/ieee754/ldbl-128ibm/e_powl.c

index 34e93e53c4f34afd961332a1eaf429c8a2877589..ff04e57a4e3e2c54b950cc96d708df66a2f7309a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2012-11-22  Joseph Myers  <joseph@codesourcery.com>
 
+       [BZ #14811]
+       * sysdeps/ieee754/ldbl-128ibm/e_powl.c (__ieee754_powl): Saturate
+       nonzero exponents with absolute value below 0x1p-117 to +/-
+       0x1p-117.
+
        [BZ #14869]
        * sysdeps/ieee754/ldbl-128ibm/e_hypotl.c (__ieee754_hypotl): Scale
        up arguments below 2**-450, not just those below 2**-500.
index 0fd4820e4ec509ca910867de8c01b39e639be9af..8216c4906b74c85bc8bcc0eb231fe6591802b1aa 100644 (file)
@@ -149,7 +149,7 @@ __ieee754_powl (long double x, long double y)
 {
   long double z, ax, z_h, z_l, p_h, p_l;
   long double y1, t1, t2, r, s, t, u, v, w;
-  long double s2, s_h, s_l, t_h, t_l;
+  long double s2, s_h, s_l, t_h, t_l, ay;
   int32_t i, j, k, yisint, n;
   u_int32_t ix, iy;
   int32_t hx, hy;
@@ -284,6 +284,10 @@ __ieee754_powl (long double x, long double y)
        return (hy > 0) ? huge * huge : tiny * tiny;
     }
 
+  ay = y > 0 ? y : -y;
+  if (ay < 0x1p-117)
+    y = y < 0 ? -0x1p-117 : 0x1p-117;
+
   n = 0;
   /* take care subnormal number */
   if (ix < 0x00100000)