Func Number Log10
# Python2.x Python log10() Function
[ Python Numbers](#)
* * *
## Description
The log10() method returns the base-10 logarithm of x.
* * *
## Syntax
Here is the syntax for the log10() method:
import math math.log10( x )
**Note:** log10() cannot be accessed directly; you need to import the math module and call the method via a static object.
* * *
## Parameters
* x -- A numeric expression.
* * *
## Return Value
Returns the base-10 logarithm of x, where x > 0.
* * *
## Example
The following example demonstrates the use of the log10() method:
#!/usr/bin/pythonimport math # Import math moduleprint "math.log10(100.12) : ", math.log10(100.12)print "math.log10(100.72) : ", math.log10(100.72)print "math.log10(119L) : ", math.log10(119L)print "math.log10(math.pi) : ", math.log10(math.pi)
When the above example is executed, it produces the following result:
math.log10(100.12) : 2.00052084094 math.log10(100.72) : 2.0031157171 math.log10(119L) : 2.07554696139 math.log10(math.pi) : 0.497149872694
[ Python Numbers](#)
YouTip