summaryrefslogtreecommitdiffstatshomepage
path: root/py/objcomplex.c
diff options
context:
space:
mode:
Diffstat (limited to 'py/objcomplex.c')
-rw-r--r--py/objcomplex.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/py/objcomplex.c b/py/objcomplex.c
index 24762e8b11..5b4df0da66 100644
--- a/py/objcomplex.c
+++ b/py/objcomplex.c
@@ -73,7 +73,7 @@ static mp_obj_t complex_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const
static mp_obj_t complex_unary_op(int op, mp_obj_t o_in) {
mp_obj_complex_t *o = o_in;
switch (op) {
- case RT_UNARY_OP_NOT: if (o->real != 0 || o->imag != 0) { return mp_const_true;} else { return mp_const_false; }
+ case RT_UNARY_OP_BOOL: return MP_BOOL(o->real != 0 || o->imag != 0);
case RT_UNARY_OP_POSITIVE: return o_in;
case RT_UNARY_OP_NEGATIVE: return mp_obj_new_complex(-o->real, -o->imag);
default: return MP_OBJ_NULL; // op not supported