Skip to content

Commit d653715

Browse files
committed
py/mpprint: Fix int formatting so "+" is printed for 0-valued integer.
1 parent 8cd4911 commit d653715

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

py/mpprint.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ int mp_print_mp_int(const mp_print_t *print, mp_obj_t x, int base, int base_char
222222
char prefix_buf[4];
223223
char *prefix = prefix_buf;
224224

225-
if (mp_obj_int_sign(x) > 0) {
225+
if (mp_obj_int_sign(x) >= 0) {
226226
if (flags & PF_FLAG_SHOW_SIGN) {
227227
*prefix++ = '+';
228228
} else if (flags & PF_FLAG_SPACE_SIGN) {

0 commit comments

Comments
 (0)