title: Find if x is bigger than y using bitwise operator in C
body: <p>If x > y, then this function will return 1, other wise return 0.</p>
  
  <p>so far i have </p>
  
  <pre><code>int isitGreater(int x, int y) {
  
       return (((y+((~x)+1)) &gt;&gt; 31) &amp; 1);
  </code></pre>
  
  <p>but it's not working. </p>
  
  <p>Allowed ops: Legal ops: ! ~ &amp; ^ | + &lt;&lt; >></p>
  
  <p>I'm sure I have the logic right, if X - Y and I get a negative number, that means y > x , so therefore the 32nd bit is a 1, so I shift that bit to the right 31 times and then "and" it with "1".</p>
  
  <p>edit: this does not work if x is negative, due to overflow. how can i fix this overflow problem without using conditional statements? </p>