# How can I check for NaN values?

Return

`True`

if x is a NaN (not a number), and`False`

otherwise.

`>>> import math>>> x = float('nan')>>> math.isnan(x)True`

Return

`True`

if x is a NaN (not a number), and`False`

otherwise.

`>>> import math>>> x = float('nan')>>> math.isnan(x)True`