On this page
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
- True for both
+infand-inf: Checkx > 0orx < 0afterward if the sign matters.
REPL Inspect
from math import isinf
help(isinf)
Linked from
Related notes
- tuts/python3/stdlib_module/math/isfinite Linked here; links to this page; shared tags: #math, #stdlib
- tuts/python3/stdlib_module/math/isnan Linked here; links to this page; shared tags: #math, #stdlib
- tuts/python3/stdlib_module/math Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/math/acos Linked here; shared tags: #math, #stdlib
- tuts/python3/stdlib_module/math/acosh Linked here; shared tags: #math, #stdlib
- tuts/python3/stdlib_module/math/asin Linked here; shared tags: #math, #stdlib
- tuts/python3/stdlib_module/math/asinh Linked here; shared tags: #math, #stdlib
- tuts/c/stdlib/math shared tags: #math, #stdlib
- tuts/c/stdlib/math/fabs shared tags: #math, #stdlib
- tuts/c/stdlib/math/floor shared tags: #math, #stdlib