Python cmath.inf Constant
Example
Print the positive and negative infinity:
#Import cmath Library
import cmath
# Print the positive infinity
print (cmath.inf)
# Print the negative infinity
print (-cmath.inf)
Try it Yourself »
Definition and Usage
The cmath.inf
constant returns a floating-point positive infinity.
For negative infinity, use -cmath.inf
.
The cmath.inf constant is equivalent to float("inf")
.
Syntax
cmath.inf
Technical Details
Return Value: | A float value, representing the value of positive infinity |
---|---|
Python Version: | 3.6 |