Home >>Python cmath Module >Python cmath.inf Constant

Python cmath.inf Constant

Python cmath.inf Constant

Python cmath.inf constant is used to return a floating-point positive infinity. For negative infinity we use -cmath.inf.

Syntax:
cmath.inf
Here is an example of Python cmath.inf constant:

import cmath 
print (cmath.inf)
print (-cmath.inf)

Output:
inf
-inf

No Sidebar ads