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 ของตัวเลข |
---|---|
เวอร์ชันหลาม: | 2.3 |