title: double and float comparison
body: <p>According to <a href="https://stackoverflow.com/questions/1839422/strange-output-in-comparison-of-float-with-float-literal">this post</a>, when comparing a float and a double, the float should be treated as double. 
  The following program, does not seem to follow this statement. The behaviour looks quite unpredictable.
  Here is my program:</p>
  
  <pre><code>void main(void)
  {
      double a = 1.1;  // 1.5
      float b = 1.1;   // 1.5
      printf("%X  %X\n", a, b);
      if ( a == b)
          cout &lt;&lt; "success " &lt;&lt;endl;
      else
          cout &lt;&lt; "fail" &lt;&lt;endl;
  }
  </code></pre>
  
  <ul>
  <li>When I run the following program, I get "fail" displayed. </li>
  <li>However, when I change a and b to 1.5, it displays "success".</li>
  </ul>
  
  <p>I have also printed the hex notations of the values. They are different in both the cases. My compiler is Visual Studio 2005</p>
  
  <p>Can you explain this output ? Thanks.</p>