Android examples for java.lang:Integer
Get int next Power Of 2
public class Main{ public static int nextPowerOf2(int n) { n -= 1;//w w w. j a v a2s . co m n |= n >>> 16; n |= n >>> 8; n |= n >>> 4; n |= n >>> 2; n |= n >>> 1; return n + 1; } }