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 tim.peters
Recipients Serge Anuchin, mark.dickinson, r.david.murray, rhettinger, serhiy.storchaka, skrah, steven.daprano, tim.peters, vstinner
Date 2015-07-04.15:58:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1436025515.94.0.490393038746.issue24546@psf.upfronthosting.co.za>
In-reply-to
Content
Mark, note that the sequence in the OP's original report only contains 35 elements.  That, alas, makes "double rounding" irrelevant to this bug report.  That is, while random.choice() can suffer double-rounding surprises in _some_ cases, it cannot in the case actually reported here:  in the 64-bit extended-precision format, there are at least

64 - (53 + (35).bit_length()) = 5

trailing zeroes in any possible

random.random() * 35

result.  IOW, all such results are exact in 64-bit arithmetic, so the first "cut back to 64 bits" rounding is a no-op.
History
Date User Action Args
2015-07-04 15:58:35tim.peterssetrecipients: + tim.peters, rhettinger, mark.dickinson, vstinner, steven.daprano, r.david.murray, skrah, serhiy.storchaka, Serge Anuchin
2015-07-04 15:58:35tim.peterssetmessageid: <1436025515.94.0.490393038746.issue24546@psf.upfronthosting.co.za>
2015-07-04 15:58:35tim.peterslinkissue24546 messages
2015-07-04 15:58:35tim.peterscreate