?

Log in

No account? Create an account

Previous Entry | Next Entry

Interesting tit-bits from fortune ..

#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

Comments

( 3 comments — Leave a comment )
icklemichael
Apr. 8th, 2009 06:46 pm (UTC)
If you like random code for slightly random things I recommend:

http://www.amazon.co.uk/Hackers-Delight-Henry-S-Warren/dp/0201914654/ref=sr_1_1?ie=UTF8&s=books&qid=1239216289&sr=8-1

I would lend it to you but I'd probably never see it again! ;)
zaniyah
Apr. 9th, 2009 11:56 am (UTC)
I still have your book! I have just not had a chance to see you when I had it with me. :(
zaniyah
Apr. 9th, 2009 12:21 pm (UTC)
Also, that book looks awesome ..
( 3 comments — Leave a comment )

Profile

star, zaniyah, fractal
zaniyah
Zaniyah

Latest Month

May 2009
S M T W T F S
     12
3456789
10111213141516
17181920212223
24252627282930
31      

Page Summary

Powered by LiveJournal.com
Designed by Golly Kim