$result -= 2**32 if $result >= 2**31; [download]
In reply to Re: Integer overflow by ikegami in thread Integer overflow by terranullis