Message228435
> 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:57 | mark.dickinson | set | recipients:
+ mark.dickinson, terry.reedy, eric.smith, docs@python, Barium |
2014-10-04 07:55:56 | mark.dickinson | set | messageid: <1412409357.0.0.662259976559.issue22546@psf.upfronthosting.co.za> |
2014-10-04 07:55:56 | mark.dickinson | link | issue22546 messages |
2014-10-04 07:55:56 | mark.dickinson | create | |
|