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

math.isfinite

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


Import

import math
from math import isfinite

Signature & Overview

math.isfinite(x, /)

Return True if x is neither an infinity nor a NaN, and False otherwise.

Usage

import math

assert math.isfinite(3.14) is True
assert math.isfinite(float("inf")) is False
assert math.isfinite(float("nan")) is False

Gotchas

REPL Inspect

from math import isfinite
help(isfinite)

Linked from

Related notes