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

2007-01-23 Thread Andrew Koenig
> 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 i

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

2007-01-23 Thread Nick Maclaren
"Jim Jewett" <[EMAIL PROTECTED]> wrote: > Tim Peters wrote: > > > complex_new() ends with: > > > cr.real -= ci.imag; > > cr.imag += ci.real; > > > and I have no idea what that thinks it's doing. Surely this isn't > > intended?! > : > > I think it is. python.org/sf/1642844 adds c

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

2007-01-23 Thread Jim Jewett
Tim Peters wrote: > complex_new() ends with: > cr.real -= ci.imag; > cr.imag += ci.real; > and I have no idea what that thinks it's doing. Surely this isn't intended?!: I think it is. python.org/sf/1642844 adds comments to make it less unclear. > >>> complex(complex(1.0, 2.0),