[]
Method that calculates the floor of the log, base 2, of 'x'. The calculation is performed in integer arithmetic, therefore, it is exact.
public static int log2(int x)
Type | Name | Description |
---|---|---|
int | x | The value to calculate log2 on. |
Type | Description |
---|---|
int | floor(log(x)/log(2)), calculated in an exact way. |