returns the power of the complex value such that the power is an integer
complex ipow( complex z, int n )
z^n
EX1
void run_complex_ipow() { complex cc(sqrt(3.), 1.); // the complex number whose real part // is the square root of 3, and imaginary part is 1. // so that its phase is 30 degrees and amplitude is 2. int n = 3; complex cresult = ipow(cc, n); out_complex("Input = ", cc); out_int("power = ", n); out_complex("ipow = ", cresult); // the result should be such that its amplitude is 8 (which // is 2 to the power 3) and whose phase is 90 degrees (which // is 30 degrees times 3). // so "ipow = -0.000000+8.000000i" }
origin.h