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

math.isinf

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


Import

import math
from math import isinf

Signature & Overview

math.isinf(x, /)

Return True if x is a positive or negative infinity, and False otherwise.

Usage

import math

assert math.isinf(float("inf")) is True
assert math.isinf(float("-inf")) is True
assert math.isinf(float("nan")) is False

Gotchas

REPL Inspect

from math import isinf
help(isinf)

Linked from

Related notes