title: Comparing float and double
body: <pre><code>#include &lt;stdio.h&gt;
  int main(void){
      float a = 1.1;
      double b = 1.1;
      if(a == b){
          printf("if block");
      }
      else{
          printf("else block");
      }
      return 0;
  }
  </code></pre>
  
  <p>Prints: else block</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  int main(void){
      float a = 1.5;
      double b = 1.5;
      if(a == b){
          printf("if block");
      }
      else{
          printf("else block");
      }
      return 0;
  }
  </code></pre>
  
  <p>Prints: if block</p>
  
  <p>What is the logic behind this? </p>
  
  <p>Compiler used: gcc-4.3.4</p>