mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
SF bug #1224347: int/long unification and hex()
Hex longs now print with lowercase letters like their int counterparts.
This commit is contained in:
parent
d4128f397d
commit
3296e696db
4 changed files with 11 additions and 14 deletions
|
@ -1090,7 +1090,7 @@ long_format(PyObject *aa, int base, int addL)
|
|||
assert(accumbits >= basebits);
|
||||
do {
|
||||
char cdigit = (char)(accum & (base - 1));
|
||||
cdigit += (cdigit < 10) ? '0' : 'A'-10;
|
||||
cdigit += (cdigit < 10) ? '0' : 'a'-10;
|
||||
assert(p > PyString_AS_STRING(str));
|
||||
*--p = cdigit;
|
||||
accumbits -= basebits;
|
||||
|
@ -1144,7 +1144,7 @@ long_format(PyObject *aa, int base, int addL)
|
|||
digit nextrem = (digit)(rem / base);
|
||||
char c = (char)(rem - nextrem * base);
|
||||
assert(p > PyString_AS_STRING(str));
|
||||
c += (c < 10) ? '0' : 'A'-10;
|
||||
c += (c < 10) ? '0' : 'a'-10;
|
||||
*--p = c;
|
||||
rem = nextrem;
|
||||
--ntostore;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue