파이썬 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)의 값 |
---|---|
파이썬 버전: | 2.6 |