mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Merge 64438: hex/oct/bin can show floats exactly.
This commit is contained in:
parent
dd811a4da7
commit
d11a44312f
4 changed files with 63 additions and 1 deletions
|
@ -1451,8 +1451,11 @@ PyObject *
|
|||
PyNumber_ToBase(PyObject *n, int base)
|
||||
{
|
||||
PyObject *res = NULL;
|
||||
PyObject *index = PyNumber_Index(n);
|
||||
PyObject *index;
|
||||
|
||||
if (PyFloat_Check(n))
|
||||
return _float_to_base(n, base);
|
||||
index = PyNumber_Index(n);
|
||||
if (!index)
|
||||
return NULL;
|
||||
if (PyLong_Check(index))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue