title: Square root of complex numbers - g++ vs icpc
body: <p>A rather basic question but I am a little bit lost here. I am working on a library, which works with complex numbers. So far I used my implementation under Mac OS 10.8 and Ubuntu 10.04 (by using llvm-gcc on Man and gcc under Ubuntu).
  Yesterday I tried it on another machine with the icpc (icc/2013.3) and the complex number crunch part failed. </p>
  
  <p>I nailed the problem down by using this simple example:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;complex&gt;
  
  using namespace std;
  
  int main(int argc, char* argv[])
  {
      std::complex&lt;double&gt; tmpcmplxnumber(26.0,0.0);
      cout &lt;&lt; "Number: " &lt;&lt; tmpcmplxnumber &lt;&lt; endl;
      std::complex&lt;double&gt; newcmplxnumber = 1.0 - tmpcmplxnumber;
      cout &lt;&lt; "New Number: " &lt;&lt; newcmplxnumber &lt;&lt; endl;
  
      cout &lt;&lt; "Sqrt of New Number: " &lt;&lt; sqrt(newcmplxnumber) &lt;&lt; endl;
  
      return 0;
  }
  </code></pre>
  
  <p>gcc output (both machines) :</p>
  
  <pre><code>Number: (26,0)
  New Number: (-25,-0)
  Sqrt of New Number: (0,-5)
  </code></pre>
  
  <p>icpc output:</p>
  
  <pre><code>Number: (26,0)
  New Number: (-25,0)
  Sqrt of New Number: (0,5)
  </code></pre>
  
  <p>If I am informed correctly gcc implements the ISO standard, so the result should be correct (with all the signed-zero stuff ... etc) So is the icpc implementation "wrong" or is there a flag for that specific issue ?</p>
  
  <p><em>update</em>
  I know that both results are valid from a mathematical point of view, however I need the gcc result also when using the icpc.</p>