This bug has been in the last few versions of MSVC++ .
It regards the implementation in the STL of the mathematical power functions for complex numbers.
Trying to find the sqrt of -1, which should give 0+i, two of three complex overloaded versions of std::pow() give roughly the right result, but one erroneously gives NaN.
Debugging into the STL it seems that the implementation of
pow(double, complex) just uses the real version of pow if the exponent is real. That is only safe if the base argument is also non-negative, but this condition is not checked.