Message20083
Logged In: YES
user_id=80475
This has been fixed for Py2.3.3 and 2.4 as a result of the
automatic conversion between ints and longs.
In 2.2, it is still possible, but the call to int() inside
random.randrange() would be have to be changed to math.floor()
which can handle the full range. As the comments indicate,
this was not worth a performance hit.
As a workaround, generate two 16 bit integers and then join
them with (a << 16) | b. This ought to work for practical
purposes; however, the underlying generator may not be
strong enough to make this a theoretically reliable
transform (i.e. it may dramatically shorten the period of
the composite generator). |
|
Date |
User |
Action |
Args |
2007-08-23 14:20:08 | admin | link | issue901285 messages |
2007-08-23 14:20:08 | admin | create | |
|