A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2007-January/070763.html below:

[Python-Dev] Floor division

[Python-Dev] Floor divisionGareth McCaughan gareth.mccaughan at pobox.com
Tue Jan 23 23:21:42 CET 2007
On Tuesday 23 January 2007 07:01, 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?!:
> >>> complex(complex(1.0, 2.0), complex(10.0, 20.0))
>
> (-19+12j)
>
> WTF?  In any case, that's also what's destroying the sign of the
> imaginary part in complex(1.0, -0.0).

It seems pretty clear what it thinks it's doing -- namely,
defining complex(a,b) = a + ib even when a,b are complex.
And half of why it does that is clear: you want complex(a)=a
when a is complex. Why b should be allowed to be complex too,
though, it's hard to imagine.

-- 
g
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4