Python math.inf Constant
Python math.inf A floating-point value for positive infinity; for negative infinity, use -math.inf.
math.inf Equivalent to the output of float('inf').
Syntax
The syntax of the math.inf constant is as follows:
math.inf
Return Value
Returns a floating-point number representing positive infinity.
Example
The following example returns positive and negative infinity:
Example
Import the math package
import
math
Output positive infinity
(
math
.
inf
)
Output negative infinity
(
math
.
inf
)
Output result:
inf
-inf
Python math Module