summaryrefslogtreecommitdiffstats
path: root/Objects/floatobject.c
diff options
context:
space:
mode:
authorEric Smith <eric@trueblade.com>2009-04-25 21:40:15 (GMT)
committerEric Smith <eric@trueblade.com>2009-04-25 21:40:15 (GMT)
commit068f06568be288b8628a4e24118503e4d9b7af1b (patch)
treee1d01c08ed08489c994e7cbf167fd703c7f2c64e /Objects/floatobject.c
parentdfcffd40447de8e04376f8946fb71a9c16151563 (diff)
downloadcpython-068f06568be288b8628a4e24118503e4d9b7af1b.zip
cpython-068f06568be288b8628a4e24118503e4d9b7af1b.tar.gz
cpython-068f06568be288b8628a4e24118503e4d9b7af1b.tar.bz2
Issue #5835, deprecate PyOS_ascii_formatd.
If anyone wants to clean up the documentation, feel free. It's my first documentation foray, and it's not that great. Will port to py3k with a different strategy.
Diffstat (limited to 'Objects/floatobject.c')
-rw-r--r--Objects/floatobject.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/Objects/floatobject.c b/Objects/floatobject.c
index 4f041f4..382b991 100644
--- a/Objects/floatobject.c
+++ b/Objects/floatobject.c
@@ -342,7 +342,6 @@ static void
format_float(char *buf, size_t buflen, PyFloatObject *v, int precision)
{
register char *cp;
- char format[32];
int i;
/* Subroutine for float_repr and float_print.
@@ -352,8 +351,8 @@ format_float(char *buf, size_t buflen, PyFloatObject *v, int precision)
in such cases, we append ".0" to the string. */
assert(PyFloat_Check(v));
- PyOS_snprintf(format, 32, "%%.%ig", precision);
- PyOS_ascii_formatd(buf, buflen, format, v->ob_fval);
+ _PyOS_double_to_string(buf, buflen, v->ob_fval, 'g', precision,
+ 0, NULL);
cp = buf;
if (*cp == '-')
cp++;