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

This works for negative values of x, though.

It should be: ((x>0) && ((x & -x) == x))



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

Search: