title: Pow-like function for negative base case
body: <p>std::pow is fine for most combinations of base and exponent values.</p>
  
  <p>However when the base is negative and fractional, std::pow keels over. </p>
  
  <p>In the example below NaN is returned (as per definition), <strike>when the expected value is roughly: -1.2332863005546</strike></p>
  
  <pre><code>#include &lt;cmath&gt;
  #include &lt;cstdio&gt;
  
  int main()
  {
      double a = -1.1;
      double b =  2.2;
      double c = std::pow(a,b);
      printf("%5.2f ^ %5.2f = %25.10f\n",a,b,c);
      return 0;
  }
  </code></pre>
  
  <p>My question is: Any ideas on how to develop a generic pow function that returns non-NaN values when the base is negative?</p>
  
  <p>Update - There will always be a class of results that can only be expressed using complex numbers.</p>