파이썬 math.frexp() 메서드
예시
숫자의 가수와 지수 찾기:
#Import math Library
import math
#Return mantissa and exponent
of numbers
print(math.frexp(4))
print(math.frexp(-4))
print(math.frexp(7))
정의 및 사용
이 math.frexp()
메서드는 지정된 숫자의 가수와 지수를 쌍( m , e )으로 반환합니다.
이 방법의 수학 공식은 number = m * 2 **e 입니다.
통사론
math.frexp(x)
매개변수 값
Parameter | Description |
---|---|
x | Required. A positive or negative number. If the value is not a number, it returns TypeError |
기술적 세부 사항
반환 값: | xtuple 의 가수와 지수를 쌍(m,e)으로 나타내는 값. 가수는 정수로 반환된 부동 지수로 반환됩니다. |
---|---|
파이썬 버전: | 2.6 |