title: The float representations of a constant and a variable are different?
body: <p>I executed the following C++ code and get the answer &quot;Not the same? Weird.....&quot;. Originally I expected to get &quot;Of course, they are the same!!!&quot;. I was using Dev-C++ 5.11.</p>
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  int main() {
      float p;
      p = 0.3;
      if ((p-0.3)==0)
          cout &lt;&lt; &quot;Of course, they are the same !!!\n&quot;;
      else
          cout &lt;&lt; &quot;Not the same? Weird.....\n&quot;;
      return 0;
  }
  </code></pre>