diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2015-09-02 17:16:07 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2015-09-02 17:16:07 (GMT) |
commit | 2ec558739e6bd32365e1a883889f9d5372b35719 (patch) | |
tree | 96eebd9fb83fcc59feb0ee478f6cbd0d105a3d29 /Include/pytime.h | |
parent | 8cbb013553c07e2577d08c7046c0eee70d0c0b66 (diff) | |
download | cpython-2ec558739e6bd32365e1a883889f9d5372b35719.zip cpython-2ec558739e6bd32365e1a883889f9d5372b35719.tar.gz cpython-2ec558739e6bd32365e1a883889f9d5372b35719.tar.bz2 |
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.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Include/pytime.h b/Include/pytime.h index 98ae12b..41fb806 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, |