[Numpy-discussion] numpy.left_shift with negative x2

markus.proeller@if... markus.proeller@if...
Wed Feb 3 06:43:17 CST 2010


Hello,

the following operation seems strange to me

>>> np.left_shift(2,-1)
0

I would have expected a right_shift by one.

The documentation on
http://docs.scipy.org/doc/numpy/reference/generated/numpy.left_shift.html#numpy.left_shift
also says that the operation is equivalent to multiplying x1 by 2**x2.
That's not the case!


Markus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20100203/190a173a/attachment.html 


More information about the NumPy-Discussion mailing list