log function
returns the natural logarithm of complex
. There is one branch cut,
from 0 along the negative real axis to -∞, continuous from above.
Implementation
Complex<num, num> log(Complex complex) {
var r = math.log((abs(complex)));
var i = phase(complex);
return Complex<num, num>(r, i);
}