[Numpy-discussion] Antwort: Re: numpy.left_shift with negative x2

markus.proeller@if... markus.proeller@if...
Wed Feb 3 07:33:00 CST 2010


>> On Wed, Feb 3, 2010 at 8:43 PM, <markus.proeller@ifm.com> wrote:
>> 
>> Hello, 
>> 
>> the following operation seems strange to me 
>> 
>> >>> np.left_shift(2,-1) 
>> 0 
>> 
>> I would have expected a right_shift by one. 
> 
> I wouldn't expect anything, the behavior is simply not defined. 

But it would prevent a statement like

if x2 > 0 then 
        ...
else
        ...


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


More information about the NumPy-Discussion mailing list