* src/fdlibm/s_finite.c,
[cacao.git] / src / fdlibm / e_fmod.c
index 1cf099076668e48315f640403e520fea5ce22e36..e3dd4bf915d0ed1a63bbe46f51f4e4ddce0ac187 100644 (file)
@@ -1,17 +1,17 @@
 
-/* @(#)e_fmod.c 5.1 93/09/24 */
+/* @(#)e_fmod.c 1.3 95/01/18 */
 /*
  * ====================================================
  * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
  *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Developed at SunSoft, 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.
  * ====================================================
  */
 
-/*
+/* 
  * __ieee754_fmod(x,y)
  * Return x mod y in exact arithmetic
  * Method: shift and subtract
@@ -49,7 +49,7 @@ static double one = 1.0, Zero[] = {0.0, -0.0,};
            return (x*y)/(x*y);
        if(hx<=hy) {
            if((hx<hy)||(lx<ly)) return x;      /* |x|<|y| return x */
-           if(lx==ly)
+           if(lx==ly) 
                return Zero[(uint32_t)sx>>31];  /* |x|=|y| return x*0*/
        }
 
@@ -72,7 +72,7 @@ static double one = 1.0, Zero[] = {0.0, -0.0,};
        } else iy = (hy>>20)-1023;
 
     /* set up {hx,lx}, {hy,ly} and align y to x */
-       if(ix >= -1022)
+       if(ix >= -1022) 
            hx = 0x00100000|(0x000fffff&hx);
        else {          /* subnormal x, shift x to normal */
            n = -1022-ix;
@@ -84,7 +84,7 @@ static double one = 1.0, Zero[] = {0.0, -0.0,};
                lx = 0;
            }
        }
-       if(iy >= -1022)
+       if(iy >= -1022) 
            hy = 0x00100000|(0x000fffff&hy);
        else {          /* subnormal y, shift y to normal */
            n = -1022-iy;
@@ -113,7 +113,7 @@ static double one = 1.0, Zero[] = {0.0, -0.0,};
 
     /* convert back to floating value and restore the sign */
        if((hx|lx)==0)                  /* return sign(x)*0 */
-           return Zero[(uint32_t)sx>>31];
+           return Zero[(unsigned)sx>>31];      
        while(hx<0x00100000) {          /* normalize x */
            hx = hx+hx+(lx>>31); lx = lx+lx;
            iy -= 1;
@@ -136,5 +136,4 @@ static double one = 1.0, Zero[] = {0.0, -0.0,};
        }
        return x;               /* exact output */
 }
-
 #endif /* defined(_DOUBLE_IS_32BITS) */