fork download
  1. #include <iostream>
  2. #include <complex>
  3. using namespace std;
  4.  
  5. int main(void) {
  6. complex<double> z = -1;
  7. cout << "sqrt(" << z << ") = " << sqrt(z) << endl;
  8. return 0;
  9. }
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
sqrt((-1,0)) = (0,1)