The `log (expr)` function is the inverse of the `exp(expr)` function. The `log (expr)` function returns the natural logarithm of the expression given as an argument. The expression used as an argument must evaluate to a positive number or an error message `NaN` (not a number) will be thrown by the function.

In addition to the error message, it will print a warning message if a negative number is used as an argument to the `log()` function. The following code block shows an example of a `log(expr)` function:

$vi logfunc.awkBEGIN {print "log(5) = ", log(5);print "log(0) = ", log(0);print "log(-1) = ", log(-1);}$ awk -f logfunc.awk

The output of the execution of the previous code is as follows :

log(5) = 1.60944log(0) = -inf ...