[pypy-svn] r32416 - pypy/dist/pypy/module/_random
cfbolz at codespeak.net
cfbolz at codespeak.net
Sun Sep 17 16:15:07 CEST 2006
Author: cfbolz
Date: Sun Sep 17 16:15:05 2006
New Revision: 32416
Modified:
pypy/dist/pypy/module/_random/rpy_random.py
Log:
forgot a ";", thanks armin
Modified: pypy/dist/pypy/module/_random/rpy_random.py
==============================================================================
--- pypy/dist/pypy/module/_random/rpy_random.py (original)
+++ pypy/dist/pypy/module/_random/rpy_random.py Sun Sep 17 16:15:05 2006
@@ -29,7 +29,7 @@
# In the previous versions, MSBs of the seed affect
# only MSBs of the array mt[].
# for >32 bit machines
- mt[mti] &= r_uint(0xffffffff);
+ mt[mti] &= r_uint(0xffffffff)
self.index = mti + 1
def init_by_array(self, init_key):
@@ -95,13 +95,14 @@
import sys
rnd = Random()
rnd.init_genrand(1000)
+ rnd.init_by_array([1, 2, 3, 4])
print rnd.index
-# for j in range(100):
-# print rnd.state[j],
-# if j % 7 == 6:
-# print
-# print "\n"
+ for j in range(100):
+ print rnd.state[j],
+ if j % 7 == 6:
+ print
+ print "\n"
for j in range(5):
print rnd.genrand32(),
if j % 7 == 6:
More information about the Pypy-commit
mailing list