[pypy-issue] [issue1381] random() generator returning result outside the 0.0 .. 1.0 domain.

Amaury Forgeot d Arc tracker at bugs.pypy.org
Fri Jan 25 11:37:16 CET 2013

Amaury Forgeot d Arc <amauryfa at gmail.com> added the comment:

> With the jumpahead() , setstate() and getstate() you can keep independent
> streams for each class for every unit.
> But if there is a simpler (faster) way, please hint !

Did you know you can create distinct random objects? They keep their own internal state.

gen = random.Random()
print gen.random()

PyPy bug tracker <tracker at bugs.pypy.org>

More information about the pypy-issue mailing list