mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
Subtle change to hex/oct formatting so the largest negative number
does not receive a minus sign.
This commit is contained in:
parent
8dc797d1f8
commit
80dd9b6672
1 changed files with 2 additions and 2 deletions
|
@ -725,7 +725,7 @@ int_oct(v)
|
|||
long x = v -> ob_ival;
|
||||
if (x == 0)
|
||||
strcpy(buf, "0");
|
||||
else if (x > 0)
|
||||
else if (-x < 0)
|
||||
sprintf(buf, "0%lo", x);
|
||||
else
|
||||
sprintf(buf, "-0%lo", -x);
|
||||
|
@ -738,7 +738,7 @@ int_hex(v)
|
|||
{
|
||||
char buf[20];
|
||||
long x = v -> ob_ival;
|
||||
if (x >= 0)
|
||||
if (-x <= 0)
|
||||
sprintf(buf, "0x%lx", x);
|
||||
else
|
||||
sprintf(buf, "-0x%lx", -x);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue