diff Include/floatobject.h @ 57324:92e06cdbeab9 legacy-trunk

Issue #7117, continued: Change round implementation to use the correctly-rounded string <-> float conversions; this makes sure that the result of the round operation is correctly rounded, and hence displays nicely using the new float repr.
author Mark Dickinson <dickinsm@gmail.com>
date Wed, 18 Nov 2009 19:33:35 +0000
parents 1d8f24d40c2c
children
line wrap: on
line diff
--- a/Include/floatobject.h	Wed Nov 18 18:52:35 2009 +0000
+++ b/Include/floatobject.h	Wed Nov 18 19:33:35 2009 +0000
@@ -127,6 +127,13 @@
 					       char *format_spec,
 					       Py_ssize_t format_spec_len);
 
+/* Round a C double x to the closest multiple of 10**-ndigits.  Returns a
+   Python float on success, or NULL (with an appropriate exception set) on
+   failure.  Used in builtin_round in bltinmodule.c. */
+PyAPI_FUNC(PyObject *) _Py_double_round(double x, int ndigits);
+
+
+
 #ifdef __cplusplus
 }
 #endif