• 회원가입
  • 로그인
  • 구글아이디로 로그인

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

2172  
목차
  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 - cmath.sinh(x) 메서드 -
module Python - cmath.sqrt(x) 메서드 -
module Python - cmath.tan(x) 메서드 -
module Python - cmath.tanh(x) 메서드 -
module Python - cmath.e 상수 - 오일러 상수 (2.71...)
module Python - cmath.inf 상수 - float 자료형의 무한대 상수 (= inf) 반환.
module Python - cmath.infj 상수 - complex 자료형의 무한대 상수 (= infj) 반환.
module Python - cmath.nan 상수 - float 자료형의 nan 상수 (= nan) 반환.
module Python - cmath.nanj 상수 - complex 자료형의 nan 상수 (= nanj) 반환.
module Python - cmath.pi 상수 - 원주율 (= 3.14...) 반환. (= 파이 상수)
module Python - cmath.tau 상수 - 원주율 2배 (= 6.28...) 반환. (= 타우 상수)
howto Python - digit 숫자 (0~9)를 정사각형 형태로 나열.
pandas Python - Pandas Intro (판다스 소개)
pandas Python - Pandas Start (설치/시작/버전확인)
pandas Python - Pandas Series (시리즈)
pandas Python - Pandas DataFrames (데이터프레임)
pandas Python - Pandas Read CSV (CSV 읽기)
pandas Python - Pandas Read JSON (JSON 읽기)
pandas Python - Pandas Analyzing DataFrames (데이터프레임 분석)
pandas Python - Pandas Cleaning Data (데이터 청소/정리)
23/24
목록
찾아주셔서 감사합니다. Since 2012