From d65371538d8ecdc64691f1c522b5b9ecc1299c7f Mon Sep 17 00:00:00 2001 From: Damien George Date: Wed, 15 Mar 2017 17:25:12 +1100 Subject: [PATCH] py/mpprint: Fix int formatting so "+" is printed for 0-valued integer. --- py/mpprint.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py/mpprint.c b/py/mpprint.c index 72d1c55ca0..4bc45fef4d 100644 --- a/py/mpprint.c +++ b/py/mpprint.c @@ -222,7 +222,7 @@ int mp_print_mp_int(const mp_print_t *print, mp_obj_t x, int base, int base_char char prefix_buf[4]; char *prefix = prefix_buf; - if (mp_obj_int_sign(x) > 0) { + if (mp_obj_int_sign(x) >= 0) { if (flags & PF_FLAG_SHOW_SIGN) { *prefix++ = '+'; } else if (flags & PF_FLAG_SPACE_SIGN) {