mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Make sure that marshal and pickle continue to output 17
digits of precision for floats.
This commit is contained in:
parent
8648e501d8
commit
3e09f43e06
2 changed files with 4 additions and 4 deletions
|
@ -237,7 +237,7 @@ w_object(PyObject *v, WFILE *p)
|
|||
}
|
||||
else {
|
||||
char *buf = PyOS_double_to_string(PyFloat_AS_DOUBLE(v),
|
||||
'r', 0, 0, NULL);
|
||||
'g', 17, 0, NULL);
|
||||
if (!buf)
|
||||
return;
|
||||
n = strlen(buf);
|
||||
|
@ -269,7 +269,7 @@ w_object(PyObject *v, WFILE *p)
|
|||
char *buf;
|
||||
w_byte(TYPE_COMPLEX, p);
|
||||
buf = PyOS_double_to_string(PyComplex_RealAsDouble(v),
|
||||
'r', 0, 0, NULL);
|
||||
'g', 17, 0, NULL);
|
||||
if (!buf)
|
||||
return;
|
||||
n = strlen(buf);
|
||||
|
@ -277,7 +277,7 @@ w_object(PyObject *v, WFILE *p)
|
|||
w_string(buf, (int)n, p);
|
||||
PyMem_Free(buf);
|
||||
buf = PyOS_double_to_string(PyComplex_ImagAsDouble(v),
|
||||
'r', 0, 0, NULL);
|
||||
'g', 17, 0, NULL);
|
||||
if (!buf)
|
||||
return;
|
||||
n = strlen(buf);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue