From: Guido van Rossum Date: Mon, 25 Jan 1999 19:42:19 +0000 (+0000) Subject: Ai! complex_nonzero() has && which should be ||, else decidedly X-Git-Tag: v1.5.2b2~288 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3bbef60990583cb61e797ccf902a122ffa6c923a;p=thirdparty%2FPython%2Fcpython.git Ai! complex_nonzero() has && which should be ||, else decidedly non-zero things like 5j and complex(1,0) are considered to be zero/false. Tim Peters. --- diff --git a/Objects/complexobject.c b/Objects/complexobject.c index 2e9771315614..e8447bb7c589 100644 --- a/Objects/complexobject.c +++ b/Objects/complexobject.c @@ -514,7 +514,7 @@ static int complex_nonzero(v) PyComplexObject *v; { - return v->cval.real != 0.0 && v->cval.imag != 0.0; + return v->cval.real != 0.0 || v->cval.imag != 0.0; } static int