STINNER Victor added the comment:

I started a large change set to support nanoseconds in the C "pytime" API: see 
the issue #22117. While working on this change, I noticed that the rounding 
mode of datetime is currently wrong. Extract of a private patch:

typedef enum {
    /* Round towards zero. */
    _PyTime_ROUND_DOWN=0,
    /* Round away from zero.
       For example, used for timeout to wait "at least" N seconds. */
    _PyTime_ROUND_UP=1,
    /* Round towards minus infinity (-inf).
       For example, used for the system clock with UNIX epoch (time_t). */
    _PyTime_ROUND_FLOOR=2
} _PyTime_round_t;

I changed Modules/_datetimemodule.c to use _PyTime_ROUND_FLOOR, instead of 
_PyTime_ROUND_DOWN.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue23517>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to