lojix/power_model/src/main/com/thesett/aima/attribute/time/BitHackUtils.java
public static int intLogBase2v2(int value)
    {
        int temp;

        if ((temp = value >> 24) > 0)
        {
            return 24 + LOG_TABLE_256[temp];
        }
        else if ((temp = value >> 16) > 0)
        {
            return 16 + LOG_TABLE_256[temp];
        }
        else if ((temp = value >> 8) > 0)
        {
            return 8 + LOG_TABLE_256[temp];
        }
        else
        {
            return LOG_TABLE_256[value];
        }
    }
public static int intLogBase2v2(int value)
    {
        int temp;

        if ((temp = value >> 24) > 0)
        {
            return 24 + LOG_TABLE_256[temp];
        }
        else if ((temp = value >> 16) > 0)
        {
            return 16 + LOG_TABLE_256[temp];
        }
        else if ((temp = value >> 8) > 0)
        {
            return 8 + LOG_TABLE_256[temp];
        }
        else
        {
            return LOG_TABLE_256[value];
        }
    }
public static int intLogBase2v2 ( int value ) { int temp ; if ( ( temp = value >> 24 ) > 0 ) { return 24 + LOG_TABLE_256 [ temp ] ; } else if ( ( temp = value >> 16 ) > 0 ) { return 16 + LOG_TABLE_256 [ temp ] ; } else if ( ( temp = value >> 8 ) > 0 ) { return 8 + LOG_TABLE_256 [ temp ] ; } else { return LOG_TABLE_256 [ value ] ; } }
Calcalates the log base 2 of an integer. This code is tuned to uniformly distributed input values, longer numbers
are favoured.

@param  value The value to calculate for.

@return Log base 2 of the input value.
Calcalates the log base 2 of an integer . This code is tuned to uniformly distributed input values longer numbers are favoured .