]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Remove tacit double usage in ldbl-128
authorPaul E. Murphy <murphyp@linux.vnet.ibm.com>
Tue, 2 Aug 2016 18:32:06 +0000 (13:32 -0500)
committerPaul E. Murphy <murphyp@linux.vnet.ibm.com>
Wed, 3 Aug 2016 16:01:25 +0000 (11:01 -0500)
There is quiet truncation to double arithmetic in several
files.  I noticed them when building ldbl-128 in a
soft-fp context.  This did not change any test results.

ChangeLog
sysdeps/ieee754/ldbl-128/k_tanl.c
sysdeps/ieee754/ldbl-128/s_atanl.c
sysdeps/ieee754/ldbl-128/s_logbl.c

index b694a7cb55407f2528c495ae0c85129c997f8199..d87885c4d321ae18ea949bb19db4988ba5d184d0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2016-08-03  Paul E. Murphy  <murphyp@linux.vnet.ibm.com>
+
+       * sysdeps/ieee754/ldbl-128/k_tanl.c (__kernal_tanl):
+       Use fabsl instead of fabs.
+       * sysdeps/ieee754/ldbl-128/s_logbl.c (__logbl):
+       Likewise.
+       * sysdeps/ieee754/ldbl-128/s_atanl.c (__kernel_tanl):
+       Add long double suffix to constant to ensure proper
+       promotion to long double.
+
 2016-08-03  Tom Tromey  <tom@tromey.com>
 
        [BZ #20311]
index 6bb221e4a67c4a8da5dfb5fba3ccf3018d1eae61..cd2bbf5f99dc7a197097170afa9508d0e0d4a835 100644 (file)
@@ -98,7 +98,7 @@ __kernel_tanl (long double x, long double y, int iy)
        {                       /* generate inexact */
          if ((ix | u.parts32.w1 | u.parts32.w2 | u.parts32.w3
               | (iy + 1)) == 0)
-           return one / fabs (x);
+           return one / fabsl (x);
          else if (iy == 1)
            {
              math_check_force_underflow (x);
index aaae701551a0753339dec0bcfab75eadf9b49e7f..35577a857caece34c8c47517258f5d9b58c41ee4 100644 (file)
@@ -231,7 +231,7 @@ __atanl (long double x)
         Roundoff to integer is asymmetrical to avoid cancellation when t < 0
          (cf. fdlibm). */
       k = 8.0 * x + 0.25;
-      u = 0.125 * k;
+      u = 0.125L * k;
       /* Small arctan argument.  */
       t = (x - u) / (1.0 + x * u);
     }
index 3ba67b7bd2c70c613b56d528bad3eec1ad04900b..b7c1ca15d7ef33f1e97e4bb6a5a12c07d2287fa6 100644 (file)
@@ -34,7 +34,7 @@ __logbl (long double x)
   GET_LDOUBLE_WORDS64 (hx, lx, x);
   hx &= 0x7fffffffffffffffLL;  /* high |x| */
   if ((hx | lx) == 0)
-    return -1.0 / fabs (x);
+    return -1.0 / fabsl (x);
   if (hx >= 0x7fff000000000000LL)
     return x * x;
   if ((ex = hx >> 48) == 0)    /* IEEE 754 logb */