Zou iemand ook eens kunnen kijken wat of dat er uit de random generatoren komt 
van zowel de standaard python distributie als bijv pypy?

Ik krijg verschillende resultaten wanneer ik de random.jumpahead() functie 
gebruik.

.Floris


import random

random.seed(12345)
for i in xrange(10):
    print random.random()
print
randomState = random.getstate()  
for i in xrange(10):
    random.setstate(randomState)
    random.jumpahead(1)
    randomState = random.getstate()    
    print random.random()
        
    
'''
standard python:

0.416619872545
0.0101691694571
0.825206509254
0.2986398552
0.368411689488
0.193661349045
0.566008168729
0.161687823929
0.124266884284
0.43293626801

jumpahead()
0.94861718596
0.466389725591
0.440309106388
0.756595610966
0.329954203719
0.207243180479
0.982769966933
0.856141036147
0.746277878413
0.304000958341


pypy

0.416619872545
0.0101691694571
0.825206509254
0.2986398552
0.368411689488
0.193661349045
0.566008168729
0.161687823929
0.124266884284
0.43293626801

jumpahead()
0.41362858709
0.482594587067
0.363386428038
0.0122210322735
0.218894401377
0.786381037234
0.535611315209
0.545681381301
0.0153701629836
0.136216130724
'''

_______________________________________________
Python-nl mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-nl

Antwoord per e-mail aan