math.log()
Anonymous contributors
Anonymous contributors
Anonymous contributors
Published May 19, 2021Updated Sep 3, 2021
Contribute to Docs
Returns the natural logarithm of n
.
Syntax
math.log(n, base)
base
is optional and it’s the logarithmic base to use. Default is e.
Example 1
Use math.log()
to return the natural log of 12
(base e):
import mathprint(math.log(12))# Output: 2.4849066497880004
Example 2
Use math.log()
to return the natural log of 12
(base 5
):
import mathprint(math.log(12, 5))# Output: 1.5439593106327716
All contributors
- Anonymous contributorsAnonymous contributors
- Anonymous contributors
Looking to contribute?
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.