bk***@ncf.ca (Raymond Martineau) writes:
On 21 Feb 2005 13:08:16 -0800, "Luke Wu" <Lo***********@gmail.com> wrote:puzzlecracker wrote: what does it do?
#define BLACKBOX(x) ((x)&((x)-1))
Clears the least significant set bit in x. This works on all unsigned
numbers and all signed numbers (except "sign-magnitude" negative even
numbers).
Inputting the integer '8' causes the "function" to return zero. Not
suprizing, since the original poster is a known troll.
8 has only one bit set. Clearing that bit, which is necessarily
the least significant set bit, yields 0. Thus, this is correct
behavior.
--
int main(void){char p[]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuv wxyz.\
\n",*q="kl BIcNBFr.NKEzjwCIxNJC";int i=sizeof p/2;char *strchr();int putchar(\
);while(*q){i+=strchr(p,*q++)-p;if(i>=(int)sizeof p)i-=sizeof p-1;putchar(p[i]\
);}return 0;}