BigInteger.GetBitLength Method

Definition

Gets the number of bits required for shortest two's complement representation of the current instance without the sign bit.

public:
 long GetBitLength();
public long GetBitLength ();
member this.GetBitLength : unit -> int64
Public Function GetBitLength () As Long

Returns

Int64

The minimum non-negative number of bits in two's complement notation without the sign bit.

Remarks

This method returns 0 if the value of current object is equal to Zero or MinusOne. For positive integers the return value is equal to the ordinary binary representation string length.

Applies to