Hacker News new | past | comments | ask | show | jobs | submit login

my favorite is determine if an int is a power of 2: if(!(a & (a-1))){ // a is a power of 2 }



or a is negative.




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: