Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3bbef60

Browse files
committed
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.
1 parent d371ff1 commit 3bbef60

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Objects/complexobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ static int
514514
complex_nonzero(v)
515515
PyComplexObject *v;
516516
{
517-
return v->cval.real != 0.0 && v->cval.imag != 0.0;
517+
return v->cval.real != 0.0 || v->cval.imag != 0.0;
518518
}
519519

520520
static int

0 commit comments

Comments
 (0)