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およびiのx *(2 ** 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)の値 |
---|---|
Pythonバージョン: | 2.62.6 |