fix SIGFPE caused by signed division overflow