mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
Issue #9337: Make float.__str__ identical to float.__repr__.
(And similarly for complex numbers.)
This commit is contained in:
parent
b6c5074920
commit
388122d43b
10 changed files with 63 additions and 85 deletions
|
@ -21,12 +21,6 @@ PyAPI_DATA(PyTypeObject) PyFloat_Type;
|
|||
#define PyFloat_Check(op) PyObject_TypeCheck(op, &PyFloat_Type)
|
||||
#define PyFloat_CheckExact(op) (Py_TYPE(op) == &PyFloat_Type)
|
||||
|
||||
/* The str() precision PyFloat_STR_PRECISION is chosen so that in most cases,
|
||||
the rounding noise created by various operations is suppressed, while
|
||||
giving plenty of precision for practical use. */
|
||||
|
||||
#define PyFloat_STR_PRECISION 12
|
||||
|
||||
#ifdef Py_NAN
|
||||
#define Py_RETURN_NAN return PyFloat_FromDouble(Py_NAN)
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue