Hacker News new | ask | show | jobs
by thrasumachos 1763 days ago
Nice that it even provides the right answer for negative numbers as undefined behavior but only when optimizations are enabled!
1 comments

Nice catch. One of many instances where C/C++ compilers rely on integer wraparound being UB.