Python math.log1p()วิธี การ
ตัวอย่าง
ค้นหาบันทึก (1+หมายเลข) สำหรับหมายเลขที่แตกต่างกัน
# Import math Library
import math
# Return the log(1+number) for different numbers
print(math.log1p(2.7183))
print(math.log1p(2))
print(math.log1p(1))
ความหมายและการใช้งาน
เมธอดจะคืน ค่าmath.log1p()
log(1+number) ซึ่งคำนวณด้วยวิธีที่ถูกต้องแม้ว่าค่าของตัวเลขจะใกล้ศูนย์
ไวยากรณ์
math.log1p(x)
ค่าพารามิเตอร์
Parameter | Description |
---|---|
x | Required. Specifies the number to process. If the value is a negative number, it returns a ValueError. If the value is not a number, it returns a TypeError |
รายละเอียดทางเทคนิค
คืนมูลค่า: | ค่า ที่float แทนค่าบันทึกของ 1+ number |
---|---|
เวอร์ชันหลาม: | 2.6 |