Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Ah... I have some good memories of adapting some of these for microcontrollers while still in school.

My favorite is Kernighan's method for counting set bits. It's as short and clean as the naive method and not immediately obvious: http://graphics.stanford.edu/~seander/bithacks.html#CountBit...



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: