BigInteger.bitLength

BigInteger.bitLength

Class Overview | Class Members | This Package | All Packages

Syntax
public int bitLength()
Description
Returns the number of bits in the minimal two's-complement representation of this number, *excluding* a sign bit, i.e., (ceil(log2(this < 0 ? -this : this + 1))). (For positive numbers, this is equivalent to the number of bits in the ordinary binary representation.)