Método Python math.log10()
Exemplo
Encontre o logaritmo de 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))
Definição e uso
O math.log10()
método retorna o logaritmo de base 10 de um número.
Sintaxe
math.log10(x)
Valores de parâmetro
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 |
Detalhes técnicos
Valor de retorno: | Um float valor, representando o logaritmo de base 10 de um número |
---|---|
Versão do Python: | 2.3 |