Precision: what is alright is the overflow situation. But the second if is still redundant since this can either be 0 or positive.