Python math.ldexp() Metodo
Esempio
Valore restituito di 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))
Definizione e utilizzo
Il math.ldexp()
metodo restituisce x * (2**i) dei numeri dati x e i, che è l'inverso di
math.frexp() .
Sintassi
math.ldexp(x, i)
Valori dei parametri
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 |
Dettagli tecnici
Valore di ritorno: | Il valore di x * (2**i) |
---|---|
Versione Python: | 2.6 |