summaryrefslogtreecommitdiff
path: root/Python/pytime.c
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 /Python/pytime.c
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 'Python/pytime.c')
-rw-r--r--Python/pytime.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/Python/pytime.c b/Python/pytime.c
index ffb390afe5..02a1edfea0 100644
--- a/Python/pytime.c
+++ b/Python/pytime.c
@@ -60,8 +60,7 @@ _PyLong_FromTime_t(time_t t)
#endif
}
-/* Round to nearest with ties going away from zero (_PyTime_ROUND_HALF_UP). */
-static double
+double
_PyTime_RoundHalfUp(double x)
{
/* volatile avoids optimization changing how numbers are rounded */