Issue #23517: Add "half up" rounding mode to the _PyTime API

This commit is contained in:
Victor Stinner 2015-09-02 01:43:56 +02:00
parent bbdda21a7a
commit 744742320f
4 changed files with 122 additions and 15 deletions

View file

@ -30,7 +30,10 @@ typedef enum {
_PyTime_ROUND_FLOOR=0,
/* Round towards infinity (+inf).
For example, used for timeout to wait "at least" N seconds. */
_PyTime_ROUND_CEILING
_PyTime_ROUND_CEILING=1,
/* Round to nearest with ties going away from zero.
For example, used to round from a Python float. */
_PyTime_ROUND_HALF_UP
} _PyTime_round_t;
/* Convert a time_t to a PyLong. */