Mercurial > cpython-lru_cache-weakref
diff Python/marshal.c @ 53192:973f4d7aa87c
Make sure that marshal and pickle continue to output 17
digits of precision for floats.
| author | Mark Dickinson <dickinsm@gmail.com> |
|---|---|
| date | Fri, 17 Apr 2009 08:41:23 +0000 |
| parents | b653eab13b73 |
| children | ed3f51f2abfb |
line wrap: on
line diff
--- a/Python/marshal.c Fri Apr 17 00:11:54 2009 +0000 +++ b/Python/marshal.c Fri Apr 17 08:41:23 2009 +0000 @@ -237,7 +237,7 @@ } 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 @@ 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_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);
