On this page
  1. math.isnan
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

math.isnan

Prev: math.isinf | Up: math | Next: math.isqrt
Rel: math.acos, math.acosh, math.asin, math.asinh
Ref: docs.python.org — math.isnan
Tags: #public #python3 #stdlib #math


Import

import math
from math import isnan

Signature & Overview

math.isnan(x, /)

Return True if x is a NaN (not a number), and False otherwise.

Usage

import math

x = float("nan")
assert math.isnan(x) is True
assert (x == x) is False

Gotchas

REPL Inspect

from math import isnan
help(isnan)

Linked from

Related notes