Python

[module] Python - math.isfinite() 메서드 - 숫자 유한 여부 체크 (= math.isfinite메서드 = 매스이즈인피니트메서드)

2154
목차
  1. math.isfinite() 예제 - 숫자의 유한 여부 체크
  2. math.isfinite() 정의
  3. math.isfinite() 구문

 

math.isfinite() 예제 - 숫자의 유한 여부 체크

 

import math


print(math.isfinite(2000)) # True

print(math.isfinite(-45.34)) # True

print(math.isfinite(+45.34)) # True

print(math.isfinite(math.inf)) # False

print(math.isfinite(float("nan"))) # False

print(math.isfinite(float("inf"))) # False

print(math.isfinite(float("-inf"))) # False

print(math.isfinite(-math.inf)) # False

print(math.isfinite(0.0)) # True


 

math.isfinite() 정의

 

숫자가 유한한지 여부 체크.

 


 

Python 3.2 +

 

 

math.isfinite() 구문

 

math.isfinite(num)

 


[매개변수]

 

num

필수. 체크할 숫자.
※ 반드시 자료형이 숫자여야 함. (예: float/integer/infinite/NaN/finite)

 


[반환값]

 

숫자가 finite (유한)인 경우, True 반환.
숫자가 infinite (무한) 또는 NaN (숫자아님) 경우, False 반환.

 



분류 제목
module Python - math.acosh() 메서드 -
module Python - math.asin() 메서드 -
module Python - math.asinh() 메서드 -
module Python - math.atan() 메서드 -
module Python - math.atan2() 메서드 -
module Python - math.atanh() 메서드 -
module Python - math.ceil() 메서드 ★ - 천장 반올림 (= 상위 정수로 반올림. = ceil메서드…
module Python - math.comb() 메서드 -
module Python - math.copysign() 메서드 -
module Python - math.cos() 메서드 -
module Python - math.cosh() 메서드 -
module Python - math.degrees() 메서드 -
module Python - math.dist() 메서드 -
module Python - math.erf() 메서드 -
module Python - math.erfc() 메서드 -
4/9
목록
 홈  PC버전 로그인 일본어
그누앞단언어
그누뒷단언어
그외코딩언어
그누보드
제작의뢰
Q&A
커뮤니티 2
웹유틸
회원센터
홈짱닷컴 PC버전 로그인