Android examples for java.lang:Math
next Power Of Two by shifting
//package com.java2s; public class Main { static public int nextPowerOfTwo(int value) { return 1 << (32 - Integer.numberOfLeadingZeros(value - 1)); }/*from w ww .ja va 2 s.c o m*/ }