[Numpy-tickets] [NumPy] #488: seeded randint returns different values on 32 and 64bit architectures

NumPy numpy-tickets@scipy....
Mon Apr 2 07:10:41 CDT 2007


#488: seeded randint returns different values on 32 and 64bit architectures
--------------------------+-------------------------------------------------
 Reporter:  benstone      |        Owner:  somebody
     Type:  defect        |       Status:  closed  
 Priority:  normal        |    Milestone:          
Component:  numpy.random  |      Version:  1.0.1   
 Severity:  normal        |   Resolution:  fixed   
 Keywords:  randint       |  
--------------------------+-------------------------------------------------
Changes (by cookedm):

  * status:  new => closed
  * resolution:  => fixed

Old description:

> This returns different values on 32 and 64bit Ubuntu (feisty) - using
> Numpy1.0.1
> import numpy.random as r
> r.seed(7777)
> r.randint(10)

New description:

 This returns different values on 32 and 64bit Ubuntu (feisty) - using
 Numpy1.0.1
 {{{
 import numpy.random as r
 r.seed(7777)
 r.randint(10)
 }}}

Comment:

 The underlying Mersenne Twister RNG gives out 32-bit integers per call. On
 a 64-bit machine, it'll be called twice to make a 64-bit integer. I've
 changed it in r3642 so that intervals less than 2**32 on a 64-bit machine
 will use one call to the RNG, instead of two.

 Has the side effect that randint will be faster on 64-bit machines now.

-- 
Ticket URL: <http://projects.scipy.org/scipy/numpy/ticket/488#comment:1>
NumPy <http://projects.scipy.org/scipy/numpy>
The fundamental package needed for scientific computing with Python.


More information about the Numpy-tickets mailing list