fix -1/2 case bug