mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
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).
This commit is contained in:
parent
8cbb013553
commit
2ec558739e
6 changed files with 26 additions and 34 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue