Merge 64438: hex/oct/bin can show floats exactly.

This commit is contained in:
Raymond Hettinger 2008-06-22 11:39:13 +00:00
parent dd811a4da7
commit d11a44312f
4 changed files with 63 additions and 1 deletions

View file

@ -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))