isPowerOf2

fnbool isPowerOf2(X)(const X x) if (isNumeric!X) pure @safe nothrow @nogc

Check whether a number is an integer power of two.

Note that only positive numbers can be integer powers of two. This function always return false if x is negative or zero.

Parameters

xthe number to test

Returns

true if x is an integer power of two.