title: why (0+0i)^{0} == (nan, nan) in c++
body: <p>take a look at the code blew:</p>
  
  <pre><code>#include &lt;complex&gt;
  #include &lt;iostream&gt;
  
  int main()
  {
      std::cout &lt;&lt; std::pow( std::complex&lt;double&gt;(0,0), std::complex&lt;double&gt;(0,0) ) &lt;&lt; "\n";
      std::cout &lt;&lt; std::pow( std::complex&lt;double&gt;(0,0), double(0) ) &lt;&lt; "\n";
  
      return 0;
  }
  </code></pre>
  
  <p>g++(4.8.1) gives an output of </p>
  
  <pre><code>(nan,nan)
  (-nan,-nan)
  </code></pre>
  
  <p>while clang++(3.3) gives an out put of </p>
  
  <pre><code>(-nan,-nan)
  (-nan,-nan)
  </code></pre>
  
  <p>But I am expecting (1.0, 0.0).</p>
  
  <p>Can anyone give an explanation?</p>