static BitOps bitOps(Object x){
	Class xc = x.getClass();

	if(xc == Long.class)
		return LONG_BITOPS;
	else if(xc == Integer.class)
		return LONG_BITOPS;
	else if(xc == BigInt.class)
		return BIGINT_BITOPS;
	else if(xc == BigInteger.class)
		return BIGINT_BITOPS;
	else if(xc == Double.class || xc == Float.class || xc == BigDecimalOps.class || xc == Ratio.class)
		throw new ArithmeticException("bit operation on non integer type: " + xc);
	else
		return LONG_BITOPS;
}