Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

log

Returns the natural logarithm (base e) of its argument.

Returns the natural logarithm of EXPR, or $_ if omitted. The argument is coerced to Nv (f64). Returns -Inf for 0 and NaN for negative values. For other bases use log($x) / log($base). Always returns an Nv.

Synopsis

my $l = log(exp(1));   # 1
my $l = log($x);
my $l = log;           # log($_)

See Also

exp, sqrt