about summary refs log tree commit diff
path: root/sysdeps/ieee754/ldbl-128/e_jnl.c
diff options
context:
space:
mode:
authorPaul E. Murphy <murphyp@linux.vnet.ibm.com>2016-09-02 11:01:07 -0500
committerPaul E. Murphy <murphyp@linux.vnet.ibm.com>2016-09-13 15:33:59 -0500
commit02bbfb414f367c73196e6f23fa7435a08c92449f (patch)
tree5f70a6d722dbdb1d716f6cf4b34fd7ca50e62c80 /sysdeps/ieee754/ldbl-128/e_jnl.c
parentfd37b5a78ab215ea2599250ec345e25545410bce (diff)
downloadglibc-02bbfb414f367c73196e6f23fa7435a08c92449f.tar.gz
glibc-02bbfb414f367c73196e6f23fa7435a08c92449f.tar.xz
glibc-02bbfb414f367c73196e6f23fa7435a08c92449f.zip
ldbl-128: Use L(x) macro for long double constants
This runs the attached sed script against these files using
a regex which aggressively matches long double literals
when not obviously part of a comment.

Likewise, 5 digit or less integral constants are replaced
with integer constants, excepting the two cases of 0 used
in large tables, which are also the only integral values
of the form x.0*E0L encountered within these converted
files.

Likewise, -L(x) is transformed into L(-x).

Naturally, the script has a few minor hiccups which are
more clearly remedied via the attached fixup patch.  Such
hiccups include, context-sensitive promotion to a real
type, and munging constants inside harder to detect
comment blocks.
Diffstat (limited to 'sysdeps/ieee754/ldbl-128/e_jnl.c')
-rw-r--r--sysdeps/ieee754/ldbl-128/e_jnl.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/sysdeps/ieee754/ldbl-128/e_jnl.c b/sysdeps/ieee754/ldbl-128/e_jnl.c
index 1ff2a8f5a5..470631e600 100644
--- a/sysdeps/ieee754/ldbl-128/e_jnl.c
+++ b/sysdeps/ieee754/ldbl-128/e_jnl.c
@@ -62,10 +62,10 @@
 #include <math_private.h>
 
 static const _Float128
-  invsqrtpi = 5.6418958354775628694807945156077258584405E-1L,
-  two = 2.0e0L,
-  one = 1.0e0L,
-  zero = 0.0L;
+  invsqrtpi = L(5.6418958354775628694807945156077258584405E-1),
+  two = 2,
+  one = 1,
+  zero = 0;
 
 
 _Float128
@@ -108,7 +108,7 @@ __ieee754_jnl (int n, _Float128 x)
 
   {
     SET_RESTORE_ROUNDL (FE_TONEAREST);
-    if (x == 0.0L || ix >= 0x7fff0000)	/* if x is 0 or inf */
+    if (x == 0 || ix >= 0x7fff0000)	/* if x is 0 or inf */
       return sgn == 1 ? -zero : zero;
     else if ((_Float128) n <= x)
       {
@@ -219,12 +219,12 @@ __ieee754_jnl (int n, _Float128 x)
 	    _Float128 q0, q1, h, tmp;
 	    int32_t k, m;
 	    w = (n + n) / (_Float128) x;
-	    h = 2.0L / (_Float128) x;
+	    h = 2 / (_Float128) x;
 	    q0 = w;
 	    z = w + h;
-	    q1 = w * z - 1.0L;
+	    q1 = w * z - 1;
 	    k = 1;
-	    while (q1 < 1.0e17L)
+	    while (q1 < L(1.0e17))
 	      {
 		k += 1;
 		z += h;
@@ -249,7 +249,7 @@ __ieee754_jnl (int n, _Float128 x)
 	    v = two / x;
 	    tmp = tmp * __ieee754_logl (fabsl (v * tmp));
 
-	    if (tmp < 1.1356523406294143949491931077970765006170e+04L)
+	    if (tmp < L(1.1356523406294143949491931077970765006170e+04))
 	      {
 		for (i = n - 1, di = (_Float128) (i + i); i > 0; i--)
 		  {
@@ -270,7 +270,7 @@ __ieee754_jnl (int n, _Float128 x)
 		    a = temp;
 		    di -= two;
 		    /* scale b to avoid spurious overflow */
-		    if (b > 1e100L)
+		    if (b > L(1e100))
 		      {
 			a /= b;
 			t /= b;
@@ -325,10 +325,10 @@ __ieee754_ynl (int n, _Float128 x)
       if ((u.parts32.w0 & 0xffff) | u.parts32.w1 | u.parts32.w2 | u.parts32.w3)
 	return x + x;
     }
-  if (x <= 0.0L)
+  if (x <= 0)
     {
-      if (x == 0.0L)
-	return ((n < 0 && (n & 1) != 0) ? 1.0L : -1.0L) / 0.0L;
+      if (x == 0)
+	return ((n < 0 && (n & 1) != 0) ? 1 : -1) / L(0.0);
       if (se & 0x80000000)
 	return zero / (zero * x);
     }