Mark Dickinson added the comment: [Tim] > I suspect, but have not proved, that 1. - 2.**-53 is the only > random.random() result for which it's possible that double-rounding > can cause int(i * random.random()) == i.
I'm sure this is true. Any other random value is at most 1 - 2**-52, and we're always going to have (1 - 2**-52) * i <= next_below(i), (where * represents multiplication in the rationals, with unrounded result), and since next_below(i) is representable both in the extended 64-bit precision and the target 53-bit precision, neither of the roundings will change that inequality. ---------- _______________________________________ 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