about summary refs log tree commit diff
path: root/sysdeps/libm-ieee754
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/libm-ieee754')
-rw-r--r--sysdeps/libm-ieee754/s_ilogb.c4
-rw-r--r--sysdeps/libm-ieee754/s_ilogbf.c8
-rw-r--r--sysdeps/libm-ieee754/s_ilogbl.c4
-rw-r--r--sysdeps/libm-ieee754/s_llrintf.c12
-rw-r--r--sysdeps/libm-ieee754/s_lrint.c10
-rw-r--r--sysdeps/libm-ieee754/s_lrintf.c12
-rw-r--r--sysdeps/libm-ieee754/s_nanf.c2
-rw-r--r--sysdeps/libm-ieee754/s_nanl.c2
8 files changed, 27 insertions, 27 deletions
diff --git a/sysdeps/libm-ieee754/s_ilogb.c b/sysdeps/libm-ieee754/s_ilogb.c
index 0c28b689b9..820f01c9b2 100644
--- a/sysdeps/libm-ieee754/s_ilogb.c
+++ b/sysdeps/libm-ieee754/s_ilogb.c
@@ -37,7 +37,7 @@ static char rcsid[] = "$NetBSD: s_ilogb.c,v 1.9 1995/05/10 20:47:28 jtc Exp $";
 	if(hx<0x00100000) {
 	    GET_LOW_WORD(lx,x);
 	    if((hx|lx)==0)
-		return 0x80000001;	/* ilogb(0) = 0x80000001 */
+		return FP_ILOGB0;	/* ilogb(0) = FP_ILOGB0 */
 	    else			/* subnormal x */
 		if(hx==0) {
 		    for (ix = -1043; lx>0; lx<<=1) ix -=1;
@@ -47,7 +47,7 @@ static char rcsid[] = "$NetBSD: s_ilogb.c,v 1.9 1995/05/10 20:47:28 jtc Exp $";
 	    return ix;
 	}
 	else if (hx<0x7ff00000) return (hx>>20)-1023;
-	else return 0x7fffffff;
+	else return FP_ILOGBNAN;
 }
 weak_alias (__ilogb, ilogb)
 #ifdef NO_LONG_DOUBLE
diff --git a/sysdeps/libm-ieee754/s_ilogbf.c b/sysdeps/libm-ieee754/s_ilogbf.c
index 2440803c20..e652b93619 100644
--- a/sysdeps/libm-ieee754/s_ilogbf.c
+++ b/sysdeps/libm-ieee754/s_ilogbf.c
@@ -8,7 +8,7 @@
  *
  * Developed at SunPro, a Sun Microsystems, Inc. business.
  * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice 
+ * software is freely granted, provided that this notice
  * is preserved.
  * ====================================================
  */
@@ -32,13 +32,13 @@ static char rcsid[] = "$NetBSD: s_ilogbf.c,v 1.4 1995/05/10 20:47:31 jtc Exp $";
 	GET_FLOAT_WORD(hx,x);
 	hx &= 0x7fffffff;
 	if(hx<0x00800000) {
-	    if(hx==0) 
-		return 0x80000001;	/* ilogb(0) = 0x80000001 */
+	    if(hx==0)
+		return FP_ILOGB0;	/* ilogb(0) = FP_ILOGB0 */
 	    else			/* subnormal x */
 	        for (ix = -126,hx<<=8; hx>0; hx<<=1) ix -=1;
 	    return ix;
 	}
 	else if (hx<0x7f800000) return (hx>>23)-127;
-	else return 0x7fffffff;
+	else return FP_ILOGBNAN;
 }
 weak_alias (__ilogbf, ilogbf)
diff --git a/sysdeps/libm-ieee754/s_ilogbl.c b/sysdeps/libm-ieee754/s_ilogbl.c
index 11372e0dc8..d44229dcda 100644
--- a/sysdeps/libm-ieee754/s_ilogbl.c
+++ b/sysdeps/libm-ieee754/s_ilogbl.c
@@ -41,7 +41,7 @@ static char rcsid[] = "$NetBSD: $";
 	if(es==0) {
 	    GET_LDOUBLE_WORDS(es,hx,lx,x);
 	    if((hx|lx)==0)
-		return 0x80000001;	/* ilogbl(0) = 0x80000001 */
+		return FP_ILOGB0;	/* ilogbl(0) = FP_ILOGB0 */
 	    else			/* subnormal x */
 		if(hx==0) {
 		    for (ix = -16415; lx>0; lx<<=1) ix -=1;
@@ -51,6 +51,6 @@ static char rcsid[] = "$NetBSD: $";
 	    return ix;
 	}
 	else if (es<0x7fff) return es-0x3fff;
-	else return 0x7fffffff;
+	else return FP_ILOGBNAN;
 }
 weak_alias (__ilogbl, ilogbl)
diff --git a/sysdeps/libm-ieee754/s_llrintf.c b/sysdeps/libm-ieee754/s_llrintf.c
index 83cb7fdd37..a812377d19 100644
--- a/sysdeps/libm-ieee754/s_llrintf.c
+++ b/sysdeps/libm-ieee754/s_llrintf.c
@@ -34,17 +34,17 @@ long long int
 __llrintf (float x)
 {
   int32_t j0;
-  u_int32_t i, i0;
+  u_int32_t i0;
   volatile float w;
   float t;
   long long int result;
   int sx;
 
-  GET_FLOAT_WORD (i, x);
+  GET_FLOAT_WORD (i0, x);
 
   sx = i0 >> 31;
   j0 = ((i0 >> 23) & 0xff) - 0x7f;
-  i0 = i & 0x7fffff;
+  i0 &= 0x7fffff;
   i0 |= 0x800000;
 
   if (j0 < (int32_t) (sizeof (long long int) * 8) - 1)
@@ -57,10 +57,10 @@ __llrintf (float x)
 	{
 	  w = two23[sx] + x;
 	  t = w - two23[sx];
-	  GET_FLOAT_WORD (i, t);
-	  i0 = i & 0x7fffff;
-	  i0 |= 0x800000;
+	  GET_FLOAT_WORD (i0, t);
 	  j0 = ((i0 >> 23) & 0xff) - 0x7f;
+	  i0 &= 0x7fffff;
+	  i0 |= 0x800000;
 
 	  result = i0 >> (23 - j0);
 	}
diff --git a/sysdeps/libm-ieee754/s_lrint.c b/sysdeps/libm-ieee754/s_lrint.c
index 8fe7d24e14..8f0d717963 100644
--- a/sysdeps/libm-ieee754/s_lrint.c
+++ b/sysdeps/libm-ieee754/s_lrint.c
@@ -34,7 +34,7 @@ long int
 __lrint (double x)
 {
   int32_t j0;
-  u_int32_t i0,i1,i;
+  u_int32_t i0,i1;
   volatile double w;
   double t;
   long int result;
@@ -55,9 +55,9 @@ __lrint (double x)
 	  w = two52[sx] + x;
 	  t = w - two52[sx];
 	  EXTRACT_WORDS (i0, i1, t);
-	  i0 = i & 0xfffff;
-	  i0 |= 0x100000;
 	  j0 = ((i0 >> 20) & 0x7ff) - 0x3ff;
+	  i0 &= 0xfffff;
+	  i0 |= 0x100000;
 
 	  result = i0 >> (20 - j0);
 	}
@@ -71,9 +71,9 @@ __lrint (double x)
 	  w = two52[sx] + x;
 	  t = w - two52[sx];
 	  EXTRACT_WORDS (i0, i1, t);
-	  i0 = i & 0xfffff;
-	  i0 |= 0x100000;
 	  j0 = ((i0 >> 20) & 0x7ff) - 0x3ff;
+	  i0 &= 0xfffff;
+	  i0 |= 0x100000;
 
 	  result = ((long int) i0 << (j0 - 20)) | (i1 >> (52 - j0));
 	}
diff --git a/sysdeps/libm-ieee754/s_lrintf.c b/sysdeps/libm-ieee754/s_lrintf.c
index d80d81a718..210ffec501 100644
--- a/sysdeps/libm-ieee754/s_lrintf.c
+++ b/sysdeps/libm-ieee754/s_lrintf.c
@@ -34,17 +34,17 @@ long int
 __lrintf (float x)
 {
   int32_t j0;
-  u_int32_t i, i0;
+  u_int32_t i0;
   volatile float w;
   float t;
   long int result;
   int sx;
 
-  GET_FLOAT_WORD (i, x);
+  GET_FLOAT_WORD (i0, x);
 
   sx = i0 >> 31;
   j0 = ((i0 >> 23) & 0xff) - 0x7f;
-  i0 = i & 0x7fffff;
+  i0 &= 0x7fffff;
   i0 |= 0x800000;
 
   if (j0 < (int32_t) (sizeof (long int) * 8) - 1)
@@ -57,10 +57,10 @@ __lrintf (float x)
 	{
 	  w = two23[sx] + x;
 	  t = w - two23[sx];
-	  GET_FLOAT_WORD (i, t);
-	  i0 = i & 0x7fffff;
-	  i0 |= 0x800000;
+	  GET_FLOAT_WORD (i0, t);
 	  j0 = ((i0 >> 23) & 0xff) - 0x7f;
+	  i0 &= 0x7fffff;
+	  i0 |= 0x800000;
 
 	  result = i0 >> (23 - j0);
 	}
diff --git a/sysdeps/libm-ieee754/s_nanf.c b/sysdeps/libm-ieee754/s_nanf.c
index 862327aa1e..b59040ac82 100644
--- a/sysdeps/libm-ieee754/s_nanf.c
+++ b/sysdeps/libm-ieee754/s_nanf.c
@@ -35,6 +35,6 @@ __nanf (const char *tagp)
       return strtof (buf, NULL);
     }
 
-  return NANF;
+  return NAN;
 }
 weak_alias (__nanf, nanf)
diff --git a/sysdeps/libm-ieee754/s_nanl.c b/sysdeps/libm-ieee754/s_nanl.c
index 223f95082e..bd42689b78 100644
--- a/sysdeps/libm-ieee754/s_nanl.c
+++ b/sysdeps/libm-ieee754/s_nanl.c
@@ -35,6 +35,6 @@ __nanl (const char *tagp)
       return strtold (buf, NULL);
     }
 
-  return NANL;
+  return NAN;
 }
 weak_alias (__nanl, nanl)