From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ingo Krabbe To: Alexandre Oliva Cc: David Berthelot , Ben Kohlen , Subject: Re: bug? Date: Mon, 18 Jun 2001 23:58:00 -0000 Message-id: References: X-SW-Source: 2001-06/msg00137.html On 19 Jun 2001, Alexandre Oliva wrote: > On Jun 18, 2001, Ingo Krabbe wrote: > > > Hmm, I see that we can also do > > x & (~(x^x)>>n) which is really easier :-) > > This is only well-defined if x's type is unsigned. The behavior of > right-shifting negative values is undefined (or unspecified?) > That's a kind of why I used ~(~(x^x)<<(sizeof(x)*8-n)). CU INGO