[Numpy-tickets] [NumPy] #597: assigning negative # to a uint64 array element gives wrong answer on 32-bit machine

NumPy numpy-tickets@scipy....
Mon Oct 22 17:46:41 CDT 2007


#597: assigning negative # to a uint64 array element gives wrong answer on 32-bit
machine
--------------------------+-------------------------------------------------
 Reporter:  gregsmith_to  |       Owner:  somebody
     Type:  defect        |      Status:  new     
 Priority:  normal        |   Milestone:          
Component:  Other         |     Version:  1.0.2   
 Severity:  normal        |    Keywords:          
--------------------------+-------------------------------------------------
 {{{
 #!python
 a = numpy.zeros((2,), numpy.uint64)
 a[0] = -1234567
 a
 array([18446744073709551615,                    0], dtype=uint64)
 }}}
 The right answer is 18446744073708317049 (to be consistent with the uint32
 behaviour anyway). The value you get (184...615) is the largest possible
 uint64.

 Failure does not occur on a 64-bit machine.
 Sorry for posting against an older version; I could not find any tickets
 for this issue so it may remain.

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


More information about the Numpy-tickets mailing list