[issue14591] Value returned by random.random() out of valid range

Mark Dickinson report at bugs.python.org
Mon Apr 16 18:00:24 CEST 2012


Mark Dickinson <dickinsm at gmail.com> added the comment:

Patch looks good to me.

There's one other subtle bug in random_jumpahead, which is that it's not guaranteed that the resulting state is nonzero.  The way to fix this is to add a line like the one near the end of the 'init_by_array' function.

mt[0] = 0x80000000UL; /* MSB is 1; assuring non-zero initial array */

----------
nosy: +mark.dickinson

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14591>
_______________________________________


More information about the Python-bugs-list mailing list