Math Functions
math.isnan()
Recognize the floating-point not-a-number value; ordinary equality cannot reliably detect NaN.
Formal Syntax & Structure
python syntaxpython
math.isnan(x, /)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| x | real number | Input real value. |
Return Value
bool
True when the described condition holds, otherwise False.
Working Example
Example Snippetpython
import mathprint(math.isnan(math.nan))