2 ms·
Integer overflow is defined to panic in debug builds, and either do that or two's compliment overflow in release builds. The current implementation overflows. H
by steveklabnik 10y ago
Integer overflow is defined to panic in debug builds, and either do that or two's compliment overflow in release builds. The current implementation overflows. However, zero is not false.
- smitherfield 10y agoI assume that treating 0 as false was intentional in this case (it probably was written in PDP-11 ASM) and a direct translation of the Therac code therefore would be if counter > 0 { deploy_radiation_shield(); }
- steveklabnik 10y agoYeah, you'd certainly have to see the actual code to be sure, I bet you're right.