News for hackers. Stuff that matters.
Re:Write A Function To Determine If A Number Is A Power Of 2 by andfarm on Monday October 18, 2010 @06:34PM (#1805435)
Absolute value of a signed it:

    a= x >> 32
    return (a + x)^a
Careful; right-shifting by >= the size of the type is an undefined operation, and might not do what you expect in all cases. (For instance, it might do nothing at all on x86, as integer shifts/rotations in ia32 are all performed modulo 32.)

There are no comments on this comment yet.