What\'s the best way to do integer math in 32- and 64-bit, so that overflow happens like it does in C?
e.g. (65536*65536+1)*(65536*65536+1) should be 0x0000000200000
Just & the result with the appropriate 32- or 64-bit mask (0xffffffff or 0xffffffffffffffff).
&
0xffffffff
0xffffffffffffffff