isnan()
isnan(number) returns Boolean , True if the input number is NaN ( Not a Number ), False otherwise.
isnan(n)
Example
import math
print(math.isnan(2)) # False
print(math.isnan(-2)) # False
print(math.isnan(0.0)) # False
print(math.isnan(0/1)) # False
print(math.isnan(0.0/1)) # False
Note : 0.0 is considered finite.
import math
print(math.isnan(float('inf'))) # False
print(math.isnan(float('-inf'))) # False
print(math.isnan(float('nan'))) # True
← Subscribe to our YouTube Channel here
This article is written by plus2net.com team.
https://www.plus2net.com
plus2net.com