math.log()

Type Function
Library math.*
Return value Number
Revision 2017.3179
Keywords log, logarithm
See also math.exp()
math.pow()

Overview

Returns the natural logarithm of x.

Syntax

math.log( x )
x (required)

Number. A number.

Examples

print(math.log (2.718281828459))     ----> very close to 1
print(math.log (1))     ----> 0
print(math.log (0))     ----> -inf
print(math.log (-1))    ----> NaN