code: public static int log_2( int x ) {
  		int shift;
  		/* Scale x to range 1.0 <= x < 2.0 */
  		shift = IBXM.FP_SHIFT;
  		while( x < IBXM.FP_ONE ) {
  			x <<= 1;
  			shift--;
  		}
  		while( x >= ( IBXM.FP_ONE << 1 ) ) {
  			x >>= 1;
  			shift++;
  		}
  		return ( IBXM.FP_ONE * shift ) + eval_table( log_2_table, x - IBXM.FP_ONE );
  	}
docs: /*
  Calculate log-base-2 of x (non-fixed-point).
  A fixed point value is returned.