32 points · by mmastrac · 3y ago · 5 comments
Nice writeup though! I like the way it derived the logic rather than just presenting the solution.
Deriving a Bit-Twiddling Hack: Signed Integer Overflow
Deriving a portable C function to detect signed 32-bit integer addition overflow without invoking undefined behaviour.
grack.com