[Python-bugs-list] bug in complex_nonzero (PR#347)
Mon, 5 Jun 2000 13:54:04 -0400
Frédéric, you should upgrade to Python 1.5.2! This was fixed a long time
ago (1.5.2 was released more than a year ago).
> -----Original Message-----
> From: email@example.com
> [mailto:firstname.lastname@example.org]On Behalf Of email@example.com
> Sent: Monday, June 05, 2000 1:13 PM
> To: firstname.lastname@example.org
> Cc: email@example.com
> Subject: [Python-bugs-list] bug in complex_nonzero (PR#347)
> Full_Name: Frédéric van der Plancke
> Version: 1.5.1
> OS: Windows NT 4
> Submission from: i0913.bfp-s.euronet.be (22.214.171.124)
> There is a bug in the test for non-nullity of a complex number.
> e.g. not (1j), not (4+0j) both return 1.
> (they should return 0, like (not n) for any non-null number n.)
> correction in <complexobject.c>:
> '||' instead of '&&' in complex_nonzero(v):
> static int
> PyComplexObject *v;
> return v->cval.real != 0.0 || v->cval.imag != 0.0;
> (Warning: I did not test my correction ;-)
> I confirm that, to the best of my knowledge and belief, this
> contribution is free of any claims of third parties under
> copyright, patent or other rights or interests ("claims"). To
> the extent that I have any such claims, I hereby grant to CNRI a
> nonexclusive, irrevocable, royalty-free, worldwide license to
> reproduce, distribute, perform and/or display publicly, prepare
> derivative versions, and otherwise use this contribution as part
> of the Python software and its related documentation, or any
> derivative versions thereof, at no cost to CNRI or its licensed
> users, and to authorize others to do so.
> I acknowledge that CNRI may, at its sole discretion, decide
> whether or not to incorporate this contribution in the Python
> software and its related documentation. I further grant CNRI
> permission to use my name and other identifying information
> provided to CNRI by me for use in connection with the Python
> software and its related documentation.
> Python-bugs-list maillist - Pythonfirstname.lastname@example.org