[issue34109] Accumulator bug

Tim Peters report at bugs.python.org
Fri Jul 13 13:04:13 EDT 2018


Tim Peters <tim at python.org> added the comment:

?  I expect your code to return -1 about once per 7**4 = 2401 times, which would be about 400 times per million tries, which is what your output shows.

If you start with -5, and randint(1, 7) returns 1 four times in a row, r5 is left at -5 + 4 = -1.

----------
nosy: +tim.peters

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34109>
_______________________________________


More information about the Python-bugs-list mailing list