Correctly handle > and < in equations