summaryrefslogtreecommitdiff
path: root/Include/pytime.h
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-09-02 19:16:07 +0200
committerVictor Stinner <victor.stinner@gmail.com>2015-09-02 19:16:07 +0200
commitea58c6adb1a11497266bc69f0629feb2fb541fa9 (patch)
tree215b4115a4d3e5eedbfe35124c54f9e865a50fcd /Include/pytime.h
parent51fcd229fa31d1aef2d27a1b51077d6f726453e7 (diff)
downloadcpython-ea58c6adb1a11497266bc69f0629feb2fb541fa9.tar.gz
Issue #23517: datetime.timedelta constructor now rounds microseconds to nearest
with ties going away from zero (ROUND_HALF_UP), as Python 2 and Python older than 3.3, instead of rounding to nearest with ties going to nearest even integer (ROUND_HALF_EVEN).
Diffstat (limited to 'Include/pytime.h')
-rw-r--r--Include/pytime.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/Include/pytime.h b/Include/pytime.h
index 98ae12bae5..41fb80607d 100644
--- a/Include/pytime.h
+++ b/Include/pytime.h
@@ -44,6 +44,10 @@ PyAPI_FUNC(PyObject *) _PyLong_FromTime_t(
PyAPI_FUNC(time_t) _PyLong_AsTime_t(
PyObject *obj);
+/* Round to nearest with ties going away from zero (_PyTime_ROUND_HALF_UP). */
+PyAPI_FUNC(double) _PyTime_RoundHalfUp(
+ double x);
+
/* Convert a number of seconds, int or float, to time_t. */
PyAPI_FUNC(int) _PyTime_ObjectToTime_t(
PyObject *obj,