how to do log base of 2 on java code example
Example: java log base 2
public static int log2(int x)
{
return (int) (Math.log(x) / Math.log(2));
}
public static int log2(int x)
{
return (int) (Math.log(x) / Math.log(2));
}