Complex is a class for complex numbers. Each instance has a coupled numbers; real and imaginary part of the number.
Create a complex number. re can be either real or complex number. If re is real and im is not given, then its imaginary part is zero. The real part can be accessed as the attribute real, and imaginary part imag.
Return the angle between the x-axis and the number in the Gaussian plane.
Return the complex conjugate of the number.
Copy the number.
Return the inverse of the number. If the number is zero, ZeroDivisionError is raised.
+ | addition |
- | subtraction |
* | multiplication |
/ | division |
**, pow | powering |
== | equality |
!= | not equal |
+(unary) | copy |
-(unary) | negation |
repr | repr string like "Complex(1, 1)" |
str | str string like "1 + 1j" |
complex | convert to Python complex |
abs | absolute value |
All comparison operators (<, <=, >=, >) are prohibited, and an attempt raises TypeError.