Método Python math.ldexp()
Exemplo
Valor de retorno de 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))
Definição e uso
O math.ldexp()
método retorna x * (2**i) dos números fornecidos x e i, que é o inverso de
math.frexp() .
Sintaxe
math.ldexp(x, i)
Valores de parâmetro
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 |
Detalhes técnicos
Valor de retorno: | O valor de x * (2**i) |
---|---|
Versão do Python: | 2.6 |