Natural logarithm
returns the natural logarithmln(x)of each element in arrayY
= log(X
)X
.
Thelog
function’s domain includes negative and complex numbers, which can lead to unexpected results if used unintentionally. For negative and complex numbersz = u + i*w
, the complex logarithmlog(z)
returns
log(abs(z)) + 1i*angle(z)
If you want negative and complex numbers to return error messages rather than return complex results, usereallog
instead.