6 ms·
Nice that it even provides the right answer for negative numbers as undefined behavior but only when optimizations are enabled!
by thrasumachos 5y ago
Nice that it even provides the right answer for negative numbers as undefined behavior but only when optimizations are enabled!
- titzer 5y agoNice catch. One of many instances where C/C++ compilers rely on integer wraparound being UB.