title: C comparison between -1 and 65535/4294967295/18446744073709551615
body: <p>I have a misunderstanding about the following statements:</p>
  <pre><code>printf(&quot;%d\n&quot;, -1 == 65535);
  printf(&quot;%d\n&quot;, -1 == 4294967295UL);
  printf(&quot;%d\n&quot;, -1 == 18446744073709551615);
  printf(&quot;%d\n&quot;, -1 == 18446744073709551615UL);
  </code></pre>
  <p>The output is:</p>
  <pre><code>0
  0
  0
  1
  </code></pre>
  <p>If if don't add the UL suffixes the compiler gives the following warning: <code>main.c:36:28: warning: integer constant is so large that it is unsigned</code></p>
  <p>Can someone explain this to me please? Why for 18446744073709551615 the result is 0 but for 18446744073709551615UL the results is 1? It's ok not to add that suffix?</p>
  <p>Thanks</p>