Calculate complex power of complex number
complex cpow( complex z1, complex z2 )
z1^z2
EX1
void run_complex_cpow() { complex z1(2., 1.); complex z2(3., 2.); complex cresult = cpow(z1, z2); out_complex("base = ", z1); // "base = 2.000000+1.000000i" out_complex("power = ", z2); // "power = 3.000000+2.000000i" out_complex("cpow = ", cresult); // Result is "cpow = -4.379164+0.622534i" }
If base is 0, and power is 0, result is missing value;
If base is 0, and power is complex or positive double, result is 0;
If base is 0, and power is negative double, returns missing value.
origin.h