Copyright © tutorialspoint.com

Python Number log10() Function

previous next


Description:

This function returns base-10 logarithm of x for x > 0.

Syntax:

import math

math.log10( x )

Note: This function is not accessible directly so we need to import math module and then we need to call this function using math static object.

Parameters:

Here is the detail of parameters:

Return Value:

The base-10 logarithm of x for x > 0

Example:

#!/usr/bin/python
import math   # This will import math module

print "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)

This will produce 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

previous next

Copyright © tutorialspoint.com