title: Linear Programming - variable that equals the sign of an expression
body: <p>I am trying to write a linear program and need a variable z that equals the sign of x-c, where x is another variable, and c is a constant.</p>
  
  <p>I considered <code>z = (x-c)/|x-c|</code>. Unfortunately, if x=c, then this creates division by 0.</p>
  
  <p>I cannot use z=x-c, because I don't want to weight it by the magnitude of the difference between x and c.</p>
  
  <p>Does anyone know of a good way to express z so that it is the sign of x-c?</p>
  
  <p>Thank you for any help and suggestions!</p>