Issue #22117: Add _PyTime_ROUND_CEILING rounding method for timestamps

Add also more tests for ROUNd_FLOOR.
This commit is contained in:
Victor Stinner 2015-03-30 03:52:49 +02:00
parent c4bb599be0
commit bcdd777d3c
4 changed files with 68 additions and 6 deletions

View file

@ -31,6 +31,8 @@ _PyTime_RoundTowardsPosInf(int is_neg, _PyTime_round_t round)
{
if (round == _PyTime_ROUND_FLOOR)
return 0;
if (round == _PyTime_ROUND_CEILING)
return 1;
return ((round == _PyTime_ROUND_UP) ^ is_neg);
}