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

2010-02-03 Thread Ralf Gommers
On Wed, Feb 3, 2010 at 9:33 PM, wrote: > > >> On Wed, Feb 3, 2010 at 8:43 PM, 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 behav

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

2010-02-03 Thread markus . proeller
>> On Wed, Feb 3, 2010 at 8:43 PM, 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 state