Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Bit Twiddling Hacks (2005).
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; }
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: