cpow

 

Description

Calculate complex power of complex number

Syntax

complex cpow( complex z1, complex z2 )

Parameters

z1
[input] base, the complex value whose power is sought.
z2
[input] the power

Return

z1^z2

Examples

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"
}

Remark

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.

See Also

header to Include

origin.h

Reference