[]
        
(Showing Draft Content)

CSJ2K.j2k.util.MathUtil.log2

log2 Method

log2(int)

Method that calculates the floor of the log, base 2, of 'x'. The calculation is performed in integer arithmetic, therefore, it is exact.

Declaration
public static int log2(int x)
Parameters
Type Name Description
int x

The value to calculate log2 on.

Returns
Type Description
int

floor(log(x)/log(2)), calculated in an exact way.