Author vstinner
Recipients belopolsky, ethan.furman, mark.dickinson, r.david.murray, tbarbugli, vstinner
Date 2015-02-25.17:31:55
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> Would you consider going back to round to nearest?

I don't understand "nearest". I prefer to use names of decimal rounding modes:

In my local patch, I'm using ROUND_FLOOR in _decimal: "Round towards -Infinity."

> Mark and I put in a lot of effort to get the rounding in the datetime module right.  (See for example, #8860.)

I'm unable right now to say which rounding mode should be used in the decimal module. But it's important to use the same rounding mode for all similar operations. For example, time.time() and should have the same rounding method (bad example, time.time() returns a float, which doesn't round the result).

For example, in my local patch, I'm using ROUND_FLOOR for:

- datetime.datetime.fromtimestamp()
- datetime.datetime.utcnow()
- os.utime()
- time.clock_settime()
- time.gmtime()
- time.localtime()
- time.ctime()

Note: the Python implementation of datetime uses time.localtime() and time.gmtime() for fromtimestamp(), so these functions should also have the same rounding method.
Date User Action Args
2015-02-25 17:31:56vstinnersetrecipients: + vstinner, mark.dickinson, belopolsky, r.david.murray, ethan.furman, tbarbugli
2015-02-25 17:31:56vstinnersetmessageid: <>
2015-02-25 17:31:56vstinnerlinkissue23517 messages
2015-02-25 17:31:55vstinnercreate