summaryrefslogtreecommitdiff
path: root/libc/sysdeps/ieee754/flt-32/e_fmodf.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/ieee754/flt-32/e_fmodf.c')
-rw-r--r--libc/sysdeps/ieee754/flt-32/e_fmodf.c33
1 files changed, 11 insertions, 22 deletions
diff --git a/libc/sysdeps/ieee754/flt-32/e_fmodf.c b/libc/sysdeps/ieee754/flt-32/e_fmodf.c
index 47b312392..e82a9ceab 100644
--- a/libc/sysdeps/ieee754/flt-32/e_fmodf.c
+++ b/libc/sysdeps/ieee754/flt-32/e_fmodf.c
@@ -8,16 +8,12 @@
*
* 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.
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: e_fmodf.c,v 1.4 1995/05/10 20:45:10 jtc Exp $";
-#endif
-
-/*
+/*
* __ieee754_fmodf(x,y)
* Return x mod y in exact arithmetic
* Method: shift and subtract
@@ -26,18 +22,10 @@ static char rcsid[] = "$NetBSD: e_fmodf.c,v 1.4 1995/05/10 20:45:10 jtc Exp $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const float one = 1.0, Zero[] = {0.0, -0.0,};
-#else
-static float one = 1.0, Zero[] = {0.0, -0.0,};
-#endif
-#ifdef __STDC__
- float __ieee754_fmodf(float x, float y)
-#else
- float __ieee754_fmodf(x,y)
- float x,y ;
-#endif
+float
+__ieee754_fmodf (float x, float y)
{
int32_t n,hx,hy,hz,ix,iy,sx,i;
@@ -66,13 +54,13 @@ static float one = 1.0, Zero[] = {0.0, -0.0,};
} else iy = (hy>>23)-127;
/* set up {hx,lx}, {hy,ly} and align y to x */
- if(ix >= -126)
+ if(ix >= -126)
hx = 0x00800000|(0x007fffff&hx);
else { /* subnormal x, shift x to normal */
n = -126-ix;
hx = hx<<n;
}
- if(iy >= -126)
+ if(iy >= -126)
hy = 0x00800000|(0x007fffff&hy);
else { /* subnormal y, shift y to normal */
n = -126-iy;
@@ -85,17 +73,17 @@ static float one = 1.0, Zero[] = {0.0, -0.0,};
hz=hx-hy;
if(hz<0){hx = hx+hx;}
else {
- if(hz==0) /* return sign(x)*0 */
+ if(hz==0) /* return sign(x)*0 */
return Zero[(u_int32_t)sx>>31];
- hx = hz+hz;
+ hx = hz+hz;
}
}
hz=hx-hy;
if(hz>=0) {hx=hz;}
/* convert back to floating value and restore the sign */
- if(hx==0) /* return sign(x)*0 */
- return Zero[(u_int32_t)sx>>31];
+ if(hx==0) /* return sign(x)*0 */
+ return Zero[(u_int32_t)sx>>31];
while(hx<0x00800000) { /* normalize x */
hx = hx+hx;
iy -= 1;
@@ -111,3 +99,4 @@ static float one = 1.0, Zero[] = {0.0, -0.0,};
}
return x; /* exact output */
}
+strong_alias (__ieee754_fmodf, __fmodf_finite)