Tim Peters added the comment:

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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue24546>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to