[Numpy-discussion] proposal on ufunc shift operators.
Charles R Harris
Wed May 28 13:01:16 CDT 2008
Currently we have:
In : ones(1,dtype=int8) << ones(1,dtype=uint8)
Out: array(, dtype=int16)
In : ones(1,dtype=int64) << ones(1,dtype=uint64)
Out: array(, dtype=object)
Note the increased size in the first case and the return of a Python long
integer object in the second. I propose that these operators should preserve
the type of the first argument, although this is not easy to do with the
current ufunc setup. It is impossible to use a type of sufficient size for
all shift values and preserving the type of the first argument is what I
think most folks would expect.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Numpy-discussion