public static PyComplex log(PyComplex x, double base) {
PyComplex r = new PyComplex(0.0, 0.0);
double l = hypot(x.real, x.imag);
double log_base = Math.log(base);
r.imag = Math.atan2(x.imag, x.real) / log_base;
r.real = math.log(new PyFloat(l)) / log_base;
return (r);
}