adjusted overflow detection for multiply