[issue17020] random.random() generating values >= 1.0

Raymond Hettinger report at bugs.python.org
Fri Jan 25 06:24:29 CET 2013


Raymond Hettinger added the comment:

Can you show how you determined that you got a value >= 1.0 or provide a seed that reproduces the problem?

I'm not seeing an issue on the 2.7.3 64-bit Mac build:

>>> from itertools import starmap, repeat
>>> from random import random, seed
>>> seed(56019413053459019451450201)
>>> for i in range(20):
	print max(starmap(random, repeat((), 10000000)))

	
0.999999787916
0.999999859769
0.999999809486
0.99999968575
0.999999886565
0.999999991274
0.999999886922
0.999999874948
0.999999987989
0.999999751067
0.999999999353
0.999999935037
0.999999919091
0.999999664265
0.999999951016
0.999999998665
0.999999919618
0.999999786864
0.999999874042
0.999999967453

----------
nosy: +rhettinger

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


More information about the Python-bugs-list mailing list