Exemple #1
0
 def f(x, y):
     rnd = Random(x)
     rnd.init_by_array([x, y])
     rnd.jumpahead(y)
     return rnd.genrand32(), rnd.random()
Exemple #2
0
 def f(x, y):
     rnd = Random(x)
     rnd.init_by_array([x, y])
     rnd.jumpahead(intmask(y))
     return rnd.genrand32(), rnd.random()
Exemple #3
0
def test_numbers():
    rnd = Random(1000)
    nums = [rnd.genrand32() for i in range(14)]
    assert nums == [2807145907, 882709079, 493951047, 2621574848, 4081433851,
            44058974, 2070996316, 1549632257, 3747249597, 3650674304,
            911961945, 58396205, 174846504, 1478498153]
Exemple #4
0
def test_numbers():
    rnd = Random(1000)
    nums = [rnd.genrand32() for i in range(14)]
    assert nums == [2807145907, 882709079, 493951047, 2621574848, 4081433851,
            44058974, 2070996316, 1549632257, 3747249597, 3650674304,
            911961945, 58396205, 174846504, 1478498153]