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