The cmath.log10()
function calculates the base-10 logarithm of a given complex number.
cmath.log10(x)
x |
The value(real or complex) whose base-10 logarithm is to be calculated. |
The function returns the base-10 logarithm of x
as a complex number. The value returned is equivalent to cmath.log(x, 10).
import cmath
print(cmath.log10(100))
print(cmath.log10(1000+10j))
print(cmath.log10(50+10j))
If the value of x
is 0, a ValueError
is raised.
import cmath
cmath.log10(0)