Hi, On Wed, 16 Nov 2016, Michael Matz wrote:
> > Looks good to me, thanks. > > An integer X is a power of two if and only if > X & -X == 0 (&& X != 0 if you want to exclude zero) Nonsense. It's X & -X == X (or X & (X-1) == 0) of course, and doesn't handle negative numbers. Still, no popcount needed. Ciao, Michael.