BigInteger.bitLength

Returns the number of bits in the minimal two's-complement representation of this BigInteger, <em>excluding</em> a sign bit. For positive BigIntegers, this is equivalent to the number of bits in the ordinary binary representation. (Computes {@code (ceil(log2(this < 0 ? -this : this+1)))}.)

@return number of bits in the minimal two's-complement representation of this BigInteger, <em>excluding</em> a sign bit.

class BigInteger
int
bitLength
()

Meta