Método Python math.log10()
Ejemplo
Encuentra el logaritmo en base 10 de diferentes números
# Import math Library
import math
# Return the base-10 logarithm
of different numbers
print(math.log10(2.7183))
print(math.log10(2))
print(math.log10(1))
Definición y uso
El math.log10()
método devuelve el logaritmo en base 10 de un número.
Sintaxis
math.log10(x)
Valores paramétricos
Parameter | Description |
---|---|
x | Required. Specifies the value to calculate the logarithm for. If the value is 0 or a negative number, it returns a ValueError. If the value is not a number, it returns a TypeError |
Detalles técnicos
Valor devuelto: | Un float valor, que representa el logaritmo en base 10 de un número |
---|---|
Versión de Python: | 2.3 |