[Python-Dev] compex numbers (was Floor Division)

Andrew Koenig ark at acm.org
Wed Jan 24 05:11:18 CET 2007


> If "real" and "imag" are themselves complex numbers, then normalizing
> the result will move the imaginary portion of the "real" vector into
> the imaginary part and vice versa.

Not quite.

>>> complex(1,1j)
0j
>>> complex(0,1j)
(-1+0j)

So it moves the imaginary portion of the "imag" argument into the real part
of the result with change of sign, on the basis that 1j*1j == -1.





More information about the Python-Dev mailing list