title: Behaviour of negative zero (-0.0) in comparison with positive zero (+0.0)
body: <p>In my code, </p>
  
  <pre><code>float f = -0.0; // Negative 
  </code></pre>
  
  <p>and compared with <strong>negative zero</strong></p>
  
  <pre><code>f == -0.0f
  </code></pre>
  
  <p>result will be <code>true</code>.</p>
  
  <p>But </p>
  
  <pre><code>float f = 0.0; // Positive
  </code></pre>
  
  <p>and compared with <strong>negative zero</strong></p>
  
  <pre><code>f == -0.0f
  </code></pre>
  
  <p>also, result will be <code>true</code> instead of <code>false</code></p>
  
  <p><strong>Why in both cases result to be true?</strong></p>
  
  <hr>
  
  <p>Here is <a href="http://coliru.stacked-crooked.com/a/4962a3b70d76a260" rel="noreferrer">a MCVE to test it (live on coliru)</a>:</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  int main()
  {
      float f = -0.0;
  
      std::cout&lt;&lt;"==== &gt; " &lt;&lt; f &lt;&lt;std::endl&lt;&lt;std::endl;
  
      if(f == -0.0f)
      {
          std::cout&lt;&lt;"true"&lt;&lt;std::endl;
      }
      else
      {
          std::cout&lt;&lt;"false"&lt;&lt;std::endl;
      }
  }
  </code></pre>
  
  <p><strong>Output:</strong></p>
  
  <pre><code>==== &gt; -0  // Here print negative zero
  
  true
  </code></pre>