diff --git a/py/objcomplex.c b/py/objcomplex.c
index 12f10ec10b132d6aff9004a06a9c4a4f30d1cf53..8a424f7f269bacadfa23a9d30ce3181a7448450c 100644
--- a/py/objcomplex.c
+++ b/py/objcomplex.c
@@ -59,7 +59,7 @@ STATIC void complex_print(const mp_print_t *print, mp_obj_t o_in, mp_print_kind_
     } else {
         mp_format_float(o->real, buf, sizeof(buf), 'g', 7, '\0');
         mp_printf(print, "(%s", buf);
-        if (o->imag >= 0) {
+        if (o->imag >= 0 || isnan(o->imag)) {
             mp_print_str(print, "+");
         }
         mp_format_float(o->imag, buf, sizeof(buf), 'g', 7, '\0');
@@ -73,7 +73,7 @@ STATIC void complex_print(const mp_print_t *print, mp_obj_t o_in, mp_print_kind_
     } else {
         sprintf(buf, "%.16g", (double)o->real);
         mp_printf(print, "(%s", buf);
-        if (o->imag >= 0) {
+        if (o->imag >= 0 || isnan(o->imag)) {
             mp_print_str(print, "+");
         }
         sprintf(buf, "%.16g", (double)o->imag);
diff --git a/tests/float/complex1.py b/tests/float/complex1.py
index 23952710905f186cf4f8a27bd9d7c9ce8640d697..ebe4b0f37c247e3112730d279bfe40e8f9a0bbbd 100644
--- a/tests/float/complex1.py
+++ b/tests/float/complex1.py
@@ -43,6 +43,11 @@ print("%.5g" % abs(1j + 2))
 # float on lhs should delegate to complex
 print(1.2 + 3j)
 
+# check printing of inf/nan
+print(float('nan') * 1j)
+print(float('inf') * (1 + 1j))
+print(float('-inf') * (1 + 1j))
+
 # convert bignum to complex on rhs
 ans = 1j + (1 << 70); print("%.5g %.5g" % (ans.real, ans.imag))