Hi All,

I would like to propose that the bit_ops preserve the length of the relevant
types. Currently we have:

In [1]: ones(1,dtype=int8) & ones(1,dtype=uint8)
Out[1]: array([1], dtype=int16)

In [3]: ones(1,dtype=int64) & ones(1,dtype=uint64)
Out[3]: array([1], dtype=object)


Note the increased size in the first case and the return of a Python long
integer object in the second. As all the high order bits will be zeroed in
any case when the smaller elements are sign extended, I propose that in
these mixed cases an unsigned type be returned of the same size as the
largest input size. I think this conforms with the rule of least surprise.

Chuck
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to