validate values depending on the operator