mirror of
https://github.com/python/cpython.git
synced 2025-07-19 09:15:34 +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
|
@ -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 */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue