summaryrefslogtreecommitdiff
path: root/Include
diff options
context:
space:
mode:
authorMark Dickinson <dickinsm@gmail.com>2009-11-18 19:33:35 +0000
committerMark Dickinson <dickinsm@gmail.com>2009-11-18 19:33:35 +0000
commit7b0978e448214351e25cd78e181285a642bba5b3 (patch)
tree01b6c51eead6bf1f7daba9d1680f4a896ca520a3 /Include
parentdfed07bc6b86cf12e1eef9f0ac165c016418ad8f (diff)
downloadcpython-7b0978e448214351e25cd78e181285a642bba5b3.tar.gz
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.
Diffstat (limited to 'Include')
-rw-r--r--Include/floatobject.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/Include/floatobject.h b/Include/floatobject.h
index 6c11036190..54e88256a2 100644
--- a/Include/floatobject.h
+++ b/Include/floatobject.h
@@ -127,6 +127,13 @@ PyAPI_FUNC(PyObject *) _PyFloat_FormatAdvanced(PyObject *obj,
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