Commit a51437d6 authored by Jim Fulton's avatar Jim Fulton

Increased precision of non-binary floats.

parent 858cfcf8
/* /*
$Id: cPickle.c,v 1.49 1998/03/06 14:23:08 jim Exp $ $Id: cPickle.c,v 1.50 1998/03/25 12:39:28 jim Exp $
Copyright Copyright
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
static char cPickle_module_documentation[] = static char cPickle_module_documentation[] =
"C implementation and optimization of the Python pickle module\n" "C implementation and optimization of the Python pickle module\n"
"\n" "\n"
"$Id: cPickle.c,v 1.49 1998/03/06 14:23:08 jim Exp $\n" "$Id: cPickle.c,v 1.50 1998/03/25 12:39:28 jim Exp $\n"
; ;
#include "Python.h" #include "Python.h"
...@@ -923,7 +923,7 @@ save_float(Picklerobject *self, PyObject *args) { ...@@ -923,7 +923,7 @@ save_float(Picklerobject *self, PyObject *args) {
{ {
char c_str[250]; char c_str[250];
c_str[0] = FLOAT; c_str[0] = FLOAT;
sprintf(c_str + 1, "%f\n", x); sprintf(c_str + 1, "%.12g\n", x);
if ((*self->write_func)(self, c_str, strlen(c_str)) < 0) if ((*self->write_func)(self, c_str, strlen(c_str)) < 0)
return -1; return -1;
...@@ -4308,7 +4308,7 @@ init_stuff(PyObject *module, PyObject *module_dict) { ...@@ -4308,7 +4308,7 @@ init_stuff(PyObject *module, PyObject *module_dict) {
void void
initcPickle() { initcPickle() {
PyObject *m, *d, *v; PyObject *m, *d, *v;
char *rev="$Revision: 1.49 $"; char *rev="$Revision: 1.50 $";
PyObject *format_version; PyObject *format_version;
PyObject *compatible_formats; PyObject *compatible_formats;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment