Languages
[Edit]
EN

Python - math.log() method example

0 points
Created by:
Keisha-Acosta
380

The math.log() method returns the natural logarithm (base e) of a number. 

The math.log() method is presented on the following chart:

math.log(x) function visualization - Python math module.
math.log(x) function visualization - Python math module.

1. Documentation

Edit
Syntax
Parameters

x- value in the range 0 to infinitive.

newBase - logarithm base.

Result

number value calculated as ln(x) mathematical function.

If x is negative it returns ValueError.

If x is equal to 0 it returns ValueError.

If x is equal to infinity it returns infinity.

Description

log is a method that takes one parameter and returns an approximation of the ln(x) function (natural logarithm function - logarithm with base e).

2. Logarithm with custom base example

Edit

This example shows a logarithmic function calculation with its own base.

References

Edit
  1. Natural logarithm - Wikipedia

1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

Python - math module

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join