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 Barium, docs@python, eric.smith, mark.dickinson, terry.reedy
Date 2014-10-04.07:55:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> It seems that str, repr, and '' are using precision 16

None of them is using a fixed precision: they're all using David Gay's implementation of the "shortest string" algorithm (à la Burger and Dybvig).   For repr, this is the case since Python 3.1 / 2.7; for str and formatting with no type specifier, since Python 3.2.  The docs definitely do need updating here.

> I expected this last to be
> '33.14159265358979'

'33.1415926535898' is shorter, and rounds back to the same floating-point number, so that's what Gay's algorithm gives here.
Date User Action Args
2014-10-04 07:55:57mark.dickinsonsetrecipients: + mark.dickinson, terry.reedy, eric.smith, docs@python, Barium
2014-10-04 07:55:56mark.dickinsonsetmessageid: <>
2014-10-04 07:55:56mark.dickinsonlinkissue22546 messages
2014-10-04 07:55:56mark.dickinsoncreate