fix bit masking hack in fpclassifyl and copysignl
authornsz <nsz@port70.net>
Sun, 4 Mar 2012 01:39:41 +0000 (02:39 +0100)
committernsz <nsz@port70.net>
Sun, 4 Mar 2012 01:39:41 +0000 (02:39 +0100)
src/math/__fpclassifyl.c
src/math/copysign.c

index daeeaab..308dc21 100644 (file)
@@ -10,7 +10,7 @@ int __fpclassifyl(long double x)
        if (!e)
                return u.bits.m ? FP_SUBNORMAL : FP_ZERO;
        if (e == 0x7fff)
-               return u.bits.m & ~(uint64_t)1<<63 ? FP_NAN : FP_INFINITE;
+               return u.bits.m & ~((uint64_t)1<<63) ? FP_NAN : FP_INFINITE;
        return u.bits.m & (uint64_t)1<<63 ? FP_NORMAL : FP_NAN;
 }
 #elif LD128
index 814d80c..04e1869 100644 (file)
@@ -5,7 +5,7 @@ double copysign(double x, double y) {
 
        ux.value = x;
        uy.value = y;
-       ux.bits &= ~(uint64_t)1<<63;
+       ux.bits &= ~((uint64_t)1<<63);
        ux.bits |= uy.bits & (uint64_t)1<<63;
        return ux.value;
 }