Avoiding overflows on Ints