Python math.log10() Metode
Contoh
Temukan logaritma basis-10 dari bilangan yang berbeda
# 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))
Definisi dan Penggunaan
Metode math.log10()
ini mengembalikan logaritma basis-10 dari suatu angka.
Sintaksis
math.log10(x)
Nilai Parameter
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 |
Detail Teknis
Nilai Kembali: | Nilai float , yang mewakili logaritma basis-10 dari suatu bilangan |
---|---|
Versi Python: | 2.3 |