Python math.ldexp()วิธี การ
ตัวอย่าง
ส่งคืนค่า x * (2**i):
#Import math Library
import math
#Return value of x * (2**i)
print(math.ldexp(9, 3))
print(math.ldexp(-5, 2))
print(math.ldexp(15,
2))
ความหมายและการใช้งาน
วิธี การmath.ldexp()
ส่งคืน x * (2**i) ของตัวเลขที่กำหนด x และ i ซึ่งเป็นค่าผกผันของ
math.frexp( )
ไวยากรณ์
math.ldexp(x, i)
ค่าพารามิเตอร์
Parameter | Description |
---|---|
x | Required. A positive or negative number. If the value is not a number, it returns TypeError |
i | Required. A positive or negative number. If the value is not a number, it returns TypeError |
รายละเอียดทางเทคนิค
คืนมูลค่า: | ค่าของ x * (2**i) |
---|---|
เวอร์ชันหลาม: | 2.6 |