Метод Python math.log10()
Пример
Найдите логарифм по основанию 10 различных чисел
# 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))
Определение и использование
Метод math.log10()
возвращает логарифм числа по основанию 10.
Синтаксис
math.log10(x)
Значения параметров
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 |
Технические детали
Возвращаемое значение: | Значение float , представляющее логарифм числа по основанию 10. |
---|---|
Версия Python: | 2.3 |