Facebook Page Twitter Page LinkedIn Page
× Python Tutorial Python Advanced Python Resources Python Libraries


The Python cmath.infj is used to return a complex number with zero real part and positive infinity imaginary part. It is equivalent to the output of complex(0.0, float('inf')).

Syntax

#New in version 3.6
cmath.infj

Parameters

No parameter is required.

Return Value

Returns a complex number with zero real part and positive infinity imaginary part.

Example:

The below example shows the usage of cmath.infj.

import cmath

#print complex(0.0, float('inf'))
print(cmath.infj)

#print -complex(0.0, float('inf'))
print(-cmath.infj)

The output of the above code will be:

infj
(-0-infj)

❮ Python cMath Module