return integer.bitLength(); return decimal.unscaledValue().bitLength();
return integer.abs().bitLength(); { BigDecimal d = decimal.abs(); if (d.compareTo(one)>0) return d.toBigInteger().bitLength(); BigDecimal integerPart = new BigDecimal(d.toBigInteger()); integerPart = integerPart.negate(); d = d.add(integerPart); if (d.compareTo(zero) == 0) return 0; int bitCount = 0;   d = d.multiply(two); while (d.compareTo(one)<0) { d = d.multiply(two); bitCount--; } return bitCount; }
  public long BitCount()  {    //TODO fixme check that it works as needed    if (integer != null)      return integer.bitLength();    return decimal.unscaledValue().bitLength();  }