David
Farruggio

MathGenie

log

Natural logarithm

Syntax and Description

log(X) returns the natural logarithm ln(x) of each element in array X. The log function's domain includes negative and complex numbers, which can lead to unexpected results if used unintentionally. For negative and complex numbers z = u + i*w, the complex logarithm log(z) returns
log(abs(z)) + 1i*angle(z).
If you want negative and complex numbers to return error messages rather than return complex results, use reallog instead.

Back to functions