Phương thức toán học Python.ldexp ()
Thí dụ
Giá trị trả về của 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))
Định nghĩa và Cách sử dụng
Phương math.ldexp()
thức trả về x * (2 ** i) của các số x và i đã cho, là nghịch đảo của
math.frexp () .
Cú pháp
math.ldexp(x, i)
Giá trị tham số
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 |
Chi tiết kỹ thuật
Giá trị trả lại: | Giá trị của x * (2 ** i) |
---|---|
Phiên bản Python: | 2,6 |