title: How does the compiler handle subtraction of unsigned integers?
body: <p>I am unable to understand a simple arithmetic operation between two unsigned integers; why is the result "<code>802</code>"? 
  Assuming integer number size is <code>32</code>-bits guaranteed by compiler.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdint.h&gt;
  
  int main(int argc, char const *argv[])
  {
      uint32_t Temp1;
      Temp1 = (uint32_t)801 - (uint32_t)0xFFFFFFFF; // Two Unsigned Integers
  
      uint32_t Temp2;
      Temp2 = 801 - 0xFFFFFFFF;// Two Signed Integers and result assigned to unsigned
  
  
      unsigned int Temp3;
      Temp3 = (unsigned int)((unsigned int)801 - (unsigned int)0xFFFFFFFF); // Two Unsigned Integers
  
      int32_t Temp4;
      Temp4 = 801 - 0xFFFFFFFF;// Two Signed Integers
  
      printf("Temp1: %d %u\n",Temp1,Temp1 );
      printf("Temp2: %d %u\n",Temp2,Temp2 );
      printf("Temp3: %d %u\n",Temp3,Temp3 );
      printf("Temp4: %d %u\n",Temp4,Temp4 );  
      return 0;
  }
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>Temp1: 802 802
  Temp2: 802 802
  Temp3: 802 802
  Temp4: 802 802
  </code></pre>
  
  <p>How compiler will deal with it if I put the expression in an <code>if</code> condition? Will it cast the expression <code>((uint32_t)OPERAND_1 - (uint32_t)0xFFFFFFFF)</code> to signed integer or unsigned integer, and then evaluate? </p>
  
  <pre><code>if(((uint32_t)801 - (uint32_t)0xFFFFFFFF) &gt; (uint16_t)1500)
  {
      printf("Hello All\n");
  }
  else
  {
      printf("Hello None\n");
  }
  </code></pre>