summaryrefslogtreecommitdiffstats
path: root/Python/pytime.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-03-30 01:52:49 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2015-03-30 01:52:49 (GMT)
commitbcdd777d3c01a6db3b4357922663624ef617e65a (patch)
tree89c64b79fd8d7d515bcece608063019cfad79bfd /Python/pytime.c
parentc4bb599be091ae92cfbe47e82a6d18f39c11443e (diff)
downloadcpython-bcdd777d3c01a6db3b4357922663624ef617e65a.zip
cpython-bcdd777d3c01a6db3b4357922663624ef617e65a.tar.gz
cpython-bcdd777d3c01a6db3b4357922663624ef617e65a.tar.bz2
Issue #22117: Add _PyTime_ROUND_CEILING rounding method for timestamps
Add also more tests for ROUNd_FLOOR.
Diffstat (limited to 'Python/pytime.c')
-rw-r--r--Python/pytime.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Python/pytime.c b/Python/pytime.c
index 0d28911..ca4386a 100644
--- a/Python/pytime.c
+++ b/Python/pytime.c
@@ -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);
}