This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mark.dickinson
Recipients William McIlhagga, mark.dickinson
Date 2016-11-16.22:30:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1479335432.41.0.585172763819.issue28717@psf.upfronthosting.co.za>
In-reply-to
Content
> Is this behaviour documented? Or are you just expected to know what C does?

Indeed, it's not as well documented as it should be. I think that's partly for historical reasons: before Python 2.7, Python's % formatting more-or-less delegated directly to the underlying C sprintf library function, and so just inherited whatever the behaviour of that function happened to be on the target operating system. Because the C standard doesn't make guarantees about the behaviour of %f for ties, Python wasn't in a position to do so either.

But that excuse doesn't work any more with Python 2.7 and Python 3.x, where on most (but still not all) platforms, we're consistently rounding results using the usual round-ties-to-even rounding mode.

There's a currently open issue (#17259) to improve the documentation here.
History
Date User Action Args
2016-11-16 22:30:32mark.dickinsonsetrecipients: + mark.dickinson, William McIlhagga
2016-11-16 22:30:32mark.dickinsonsetmessageid: <1479335432.41.0.585172763819.issue28717@psf.upfronthosting.co.za>
2016-11-16 22:30:32mark.dickinsonlinkissue28717 messages
2016-11-16 22:30:32mark.dickinsoncreate