Roundup Robot devn...@psf.upfronthosting.co.za added the comment:
New changeset 6df0b4ed8617 by Mark Dickinson in branch '2.7':
Closes #14591: Random.jumpahead could produce an invalid MT state on 64-bit
machines.
http://hg.python.org/cpython/rev/6df0b4ed8617
--
nosy: +python-dev
Changes by Raymond Hettinger raymond.hettin...@gmail.com:
--
assignee: rhettinger - mark.dickinson
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14591
___
Raymond Hettinger raymond.hettin...@gmail.com added the comment:
The patch is fine but would be a bit better if the two loop passes were merged
and if the tmp variable were renamed to something like nonzero or somesuch.
--
___
Python tracker
Mark Dickinson dicki...@gmail.com added the comment:
Raymond, can this patch be applied?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14591
___
Serhiy Storchaka storch...@gmail.com added the comment:
The = 0x8000UL was intentional. The low-order 31 bits of mt[0] don't
form part of the state of the Mersenne Twister: the resulting random stream
isn't affected by their values.
Thanks, I have no more questions.
--
Mark Dickinson dicki...@gmail.com added the comment:
Responding to a comment from Serhiy on Rietveld:
Modules/_randommodule.c:442: mt[0] = 0x8000UL;
mt[0] |= 0x8000UL (according to the comment)?
The = 0x8000UL was intentional. The low-order 31 bits of mt[0] don't form
part of
Changes by Mark Dickinson dicki...@gmail.com:
--
stage: - commit review
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14591
___
___
Antoine Pitrou pit...@free.fr added the comment:
In test_random, you should use assertLess so that the offending value is
displayed on failure.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14591
Mark Dickinson dicki...@gmail.com added the comment:
Done.
--
Added file: http://bugs.python.org/file25508/random_jumpahead_5.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14591
___
Changes by STINNER Victor victor.stin...@gmail.com:
--
title: Value returned by random.random() out of valid range - Value returned
by random.random() out of valid range on 64-bit
___
Python tracker rep...@bugs.python.org
Antoine Pitrou pit...@free.fr added the comment:
The patch should probably come with an unit test.
--
nosy: +pitrou
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14591
___
Mark Dickinson dicki...@gmail.com added the comment:
Patch with unit test. :-)
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14591
___
___
Mark Dickinson dicki...@gmail.com added the comment:
Dang. Patch now attached.
--
Added file: http://bugs.python.org/file25304/random_jumpahead_4.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14591
13 matches
Mail list logo