diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2015-03-30 01:52:49 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2015-03-30 01:52:49 (GMT) |
commit | bcdd777d3c01a6db3b4357922663624ef617e65a (patch) | |
tree | 89c64b79fd8d7d515bcece608063019cfad79bfd /Python | |
parent | c4bb599be091ae92cfbe47e82a6d18f39c11443e (diff) | |
download | cpython-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')
-rw-r--r-- | Python/pytime.c | 2 |
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); } |