Skip to content

Commit 104be4a

Browse files
committed
Use %.17f to format floats/doubles
1 parent bf02fb2 commit 104be4a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Modules/cPickle.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -922,7 +922,7 @@ save_float(Picklerobject *self, PyObject *args) {
922922
{
923923
char c_str[250];
924924
c_str[0] = FLOAT;
925-
sprintf(c_str + 1, "%f\n", x);
925+
sprintf(c_str + 1, "%.17g\n", x);
926926

927927
if ((*self->write_func)(self, c_str, strlen(c_str)) < 0)
928928
return -1;

0 commit comments

Comments
 (0)