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

[module] Python - math.isnan() 메서드 ★ - NaN 여부 체크. (= isnan메서드 = 이즈난메서드)

4197  
목차
  1. math.isnan() 예제 - NaN 여부 체크
  2. math.isnan() 정의 
  3. math.isnan() 구문

 

math.isnan() 예제 - NaN 여부 체크

 

import math

 

print (math.isnan (12)) # False

print (math.isnan (-12.34)) # False

print (math.isnan (+12.34)) # False

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

print (math.isnan (float("nan"))) # True

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

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

print (math.isnan (math.nan)) # True

 

 

math.isnan() 정의

 

NaN (숫자 아님 : Not a Number) 여부 체크.

 


 

※ NaN 맞으면 True 반환, 아니면 False 반환.

※ Python 3.5

 

 

math.isnan() 구문

 

math.isnan(x)

 


[매개변수]

 

x

필수. NaN인지 체크할 값.

 


[반환값]

 

  • NaN 맞으면 : True 반환.
  • NaN 아니면 : False 반환.

 



분류 제목
module Python - math.log1p() 메서드 -
module Python - math.log2() 메서드 -
module Python - math.perm() 메서드 -
module Python - math.pow() 메서드 ★ - 승수값 (= 누승값 = pow메서드 = 포오 = 파워)
module Python - math.prod() 메서드 -
module Python - math.radians() 메서드 -
module Python - math.remainder() 메서드 ★ - 나머지 반환. (= remainder메서드 = …
module Python - math.sin() 메서드 -
module Python - math.sinh() 메서드 -
module Python - math.sqrt() 메서드 -
module Python - math.tan() 메서드 -
module Python - math.tanh() 메서드 -
module Python - math.trunc() 메서드 ★ - 정수 부분 반환. (= trunc메서드 = 트렁크)
module Python - math.e 상수 - 오일러 상수 (2.71...)
module Python - math.inf 상수 - float 자료형의 무한대 상수 (= inf) 반환.
module Python - math.nan 상수 - float 자료형의 NaN 상수 (= nan) 반환.
module Python - math.pi 상수 - 원주율 (= 3.14...) 반환. (= 파이 상수)
module Python - math.tau 상수 - 원주율 2배 (= 6.28...) 반환. (= 타우 상수)
module Python - cmath 모듈 메서드・상수 종류 (※ 복소수 모듈)
module Python - cmath.acos(x) 메서드 -
5/7
목록
찾아주셔서 감사합니다. Since 2012