On Saturday, 5 May 2012 at 05:32:14 UTC, Era Scarecrow wrote:
Any systems that implement a carry flag likely works exactly like that.
Yes, but that misses the actual problem! The problem isn't the _system_, it's the _compiler_. If the language says overflow or underflow are undefined behavior, then what the system does _doesn't matter one bit_, because the compiler can optimize away the code entirely: http://blog.llvm.org/2011/05/what-every-c-programmer-should-know.html