[Numpy-discussion] Oddity with numpy.int64 integer division

Christian Marquardt christian at marquardt.sc
Mon Apr 23 16:20:48 EDT 2007


Dear all,

this is odd:

   >>> import numpy as np
   >>> fact = 28250000L * 86400L
   >>> nn = np.array([-20905000L])
   >>> nn
   array([-20905000], dtype=int64)
   >>> nn[0] // fact
   0

But:

   >>> long(nn[0]) // fact
   -1L

Is this a bug in numpy, or in python's implementation of longs? I would
think both should give the same, really... (Python 2.5, numpy 1.0.3dev3725,
Linux, Intel compilers...)

Many thanks for any ideas / advice,

  Christian




More information about the NumPy-Discussion mailing list