2 ms·This works for negative values of x, though. It should be: ((x>0) && ((x & -x) == x))by cube13 15y agoThis works for negative values of x, though. It should be: ((x>0) && ((x & -x) == x))