News for hackers. Stuff that matters.
Re:Bit Twiddling Hacks (2005) by jhallenworld on Sunday July 03, 2016 @10:47PM (#12028677)
>https://graphics.stanford.edu/~seander/bithacks.html#Integer...

The quick and dirty version is still useful (portable, works for all values) for the case of 1/2 word size unsigned versions of min and max:

    unsigned max(unsigned short a, unsigned short b)
    {
        unsigned q = a - b;
        unsigned r = ((~q) >> 16);
        return r + b;
    }
Re:Bit Twiddling Hacks (2005) by yitchelle on Monday July 04, 2016 @03:18AM (#12029284)
Does the right shift limits this to certain word sizes?