math.log()

Type Function
Library math.*
Return value Number
Revision Release 2022.3683
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