title: Why does abs(complex<int>) always return zero?
body: <p>The following code with VS2010 prints <code>0</code>, contrary to my expectations:</p>
  
  <pre><code>#include &lt;complex&gt;
  #include &lt;iostream&gt;
  
  using namespace std;
  
  int main(void)
  {
      complex&lt;int&gt; z(20, 200);
      cout &lt;&lt; abs&lt;int&gt;(z) &lt;&lt; endl;
      return 0;
  }
  </code></pre>
  
  <p>It works fine when the type is <code>double</code>.</p>