title: C++ double operator+
body: <blockquote>
    <p><strong>Possible Duplicates:</strong><br>
    <a href="https://stackoverflow.com/questions/1236550/incorrect-floating-point-math">Incorrect floating point math?</a><br>
    <a href="https://stackoverflow.com/questions/2986324/float-compile-time-calculation-not-happening">Float compile-time calculation not happening?</a>  </p>
  </blockquote>
  
  
  
  <p>Strange stuff going on today, I'm about to lose it...</p>
  
  <pre><code>#include &lt;iomanip&gt;
  #include &lt;iostream&gt;
  using namespace std;
  
  int main()
  {
      cout &lt;&lt; setprecision(14);
      cout &lt;&lt; (1/9+1/9+4/9) &lt;&lt; endl;
  }
  </code></pre>
  
  <p>This code outputs 0 on MSVC 9.0 x64 and x86 and on GCC 4.4 x64 and x86 (default options and strict math...). And as far as I remember, <code>1/9+1/9+4/9 = 6/9 = 2/3 != 0</code></p>