division by zero returns a maximum value instead of doing division by a small number