power of java code example
Example 1: raise number to power java
Math.pow(number, power);
Example 2: java is power of 2
boolean result = number > 0 && ((number & (number - 1)) == 0);
Math.pow(number, power);
boolean result = number > 0 && ((number & (number - 1)) == 0);