On Tue, May 10, 2011 at 11:16 AM, Olivier Delalleau <sh...@keba.be> wrote:
> Hi, > > I opened a ticket about this (http://projects.scipy.org/numpy/ticket/1827 > ), > but thought I'd also ask on the mailing list whether this is working as > intended. > > It looks like the resulting dtype of a "+" operation between a scalar and > an > array can depend on the order of the arguments. This seems wrong. > > Tested with numpy 1.5.1 under Ubuntu 11.04 (64-bit). > > In [4]: (numpy.array(0, dtype='uint16') + numpy.array([1], > dtype='int8')).dtype > Out[4]: dtype('int16') > > In [6]: (numpy.array([1], dtype='int8') + numpy.array(0, > dtype='uint16')).dtype > Out[6]: dtype('int8') > > Thanks for any feedback, > > This has been fixed in the coming 1.6.0 release. In [2]: (numpy.array(0, dtype='uint16') + numpy.array([1],dtype='int8')).dtype Out[2]: dtype('int8') In [3]: (numpy.array([1], dtype='int8') + numpy.array(0,dtype='uint16')).dtype Out[3]: dtype('int8') Chuck
_______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion