Python math.ldexp() Metode
Contoh
Nilai kembalian 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))
Definisi dan Penggunaan
Metode math.ldexp()
ini mengembalikan x * (2**i) dari bilangan x dan i yang diberikan, yang merupakan kebalikan dari
math.frexp() .
Sintaksis
math.ldexp(x, i)
Nilai Parameter
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 |
Detail Teknis
Nilai Kembali: | Nilai x * (2**i) |
---|---|
Versi Python: | 2.6 |