powerOf2 Summary Tests if a number is would be the result of any exponentiation 2n where n is an integer and the number 2 (two) is the base. Usage public static bool powerOf2(unsigned int x) Returns true if the specified value is a power of 2 (two) and false otherwise. Parameters x The value to check. Description Tests if a number is would be the result of any exponentiation 2n where n is an integer and the number 2 (two) is the base. Examples Basic Usage 1234import System; Console.log(Math.powerOf2(4)); // trueConsole.log(Math.powerOf2(5)); // false Share HTML | BBCode | Direct Link