파이썬 cmath.isinf() 메서드
예시
복소수 값이 무한대인지 여부를 확인하십시오.
#import cmath for complex number operations
import cmath
#find
whether a complex number is infinite or not
print (cmath.isinf(complex(10
+ float('inf'))))
print (cmath.isinf(11 + 4j))
정의 및 사용
이 cmath.isinf()
메서드는 값이 양수 또는 음수 무한대인지 여부를 확인합니다. 이 메서드는 부울 값을 반환합니다. True
값이 무한대이면 False
.
통사론
cmath.isinf(x)
매개변수 값
Parameter | Description |
---|---|
x | Required. The value to check for infinity |
기술적 세부 사항
반환 값: | bool 값( 값 True 이 무한대인 경우), 그렇지 않은 경우False |
---|---|
파이썬 버전: | 2.6 |