]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Correct former completely bogus code. It never worked correctly.
authorUlrich Drepper <drepper@redhat.com>
Thu, 20 Mar 1997 03:21:35 +0000 (03:21 +0000)
committerUlrich Drepper <drepper@redhat.com>
Thu, 20 Mar 1997 03:21:35 +0000 (03:21 +0000)
sysdeps/libm-ieee754/s_modfl.c

index 433c936240283e2d31c36a07b1197b80e261d6d8..324fe9fde62b5f44cd0ea12787e76dbf01e2aeb4 100644 (file)
@@ -55,32 +55,29 @@ static long double one = 1.0;
            } else {
                i = (0xffffffff)>>j0;
                if(((i0&i)|i1)==0) {            /* x is integral */
-                   u_int32_t high;
                    *iptr = x;
-                   GET_HIGH_WORD(high,x);
-                   INSERT_WORDS(x,high&0x80000000,0);  /* return +-0 */
+                   SET_LDOUBLE_WORDS(x,se&0x8000,0,0); /* return +-0 */
                    return x;
                } else {
-                   INSERT_WORDS(*iptr,i0&(~i),0);
+                   SET_LDOUBLE_WORDS(*iptr,se,i0&(~i),0);
                    return x - *iptr;
                }
            }
        } else if (j0>63) {             /* no fraction part */
-           u_int32_t high;
            *iptr = x*one;
-           GET_HIGH_WORD(high,x);
-           INSERT_WORDS(x,high&0x80000000,0);  /* return +-0 */
+           /* We must handle NaNs separately.  */
+           if (j0 == 0x4000 && ((i0 & 0x7fffffff) | i1))
+             return x*one;
+           SET_LDOUBLE_WORDS(x,se&0x8000,0,0); /* return +-0 */
            return x;
        } else {                        /* fraction part in low x */
            i = ((u_int32_t)(0xffffffff))>>(j0-20);
            if((i1&i)==0) {             /* x is integral */
-               u_int32_t high;
                *iptr = x;
-               GET_HIGH_WORD(high,x);
-               INSERT_WORDS(x,high&0x80000000,0);      /* return +-0 */
+               INSERT_WORDS(x,se&0x8000,0);    /* return +-0 */
                return x;
            } else {
-               INSERT_WORDS(*iptr,i0,i1&(~i));
+               SET_LDOUBLE_WORDS(*iptr,se,i0,i1&(~i));
                return x - *iptr;
            }
        }