Op Englesch liesen Editéieren

Deelen iwwer


BigInteger.GetBitLength Method

Definition

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

C#
public long GetBitLength();

Returns

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

Produkt Versiounen
.NET 5, 6, 7, 8, 9, 10