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

That was #9:

    int isPowerOfTwo (unsigned int x)
    {
      return ((x != 0) && !(x & (x - 1)));
    }


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

Search: