log

log

log EXPR

log

Returns the natural logarithm (base e) of EXPR. If EXPR is omitted, returns the log of $_ . To get the log of another base, use basic algebra: The base-N log of a number is equal to the natural log of that number divided by the natural log of N. For example:

sub log10 {
    my $n = shift;
    return log($n)/log(10);
}

See also exp for the inverse operation.

© 1993–2016 Larry Wall and others
Licensed under the GNU General Public License version 1 or later, or the Artistic License.
The Perl logo is a trademark of the Perl Foundation.
http://perldoc.perl.org/5.24.0/functions/log.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部