[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

Fwd: how this C code works?



this came from a friend of mine. can somebody crack this? - Diwakar

This came as the Unix fortune - can someone decipher? Thanks, Alan -

#define BITCOUNT(x)     (((BX_(x)+(BX_(x)>>4)) & 0x0F0F0F0F) % 255)
#define  BX_(x)         ((x) - (((x)>>1)&0x77777777)                    \
                             - (((x)>>2)&0x33333333)                    \
                             - (((x)>>3)&0x11111111))


-- really weird C code to count the number of bits in a word

-- 
Got something to say? Subscribe to tamil.com e-mail discussion
forums!

The teen mailing list:    mailto:teen-subscribe@xxxxxxxxxxxxxxx
Art discussions:          mailto:art-subscribe@xxxxxxxxxxxxxxx
Literary discussions:     mailto:books-subscribe@xxxxxxxxxxxxxxx
Infotech:                 mailto:it-subscribe@xxxxxxxxxxxxxxx
For 18 years and above:   mailto:sex-subscribe@xxxxxxxxxxxxxxx