BigInteger.IsPowerOfTwo プロパティ

定義

現在の BigInteger オブジェクトの値が 2 の累乗かどうかを示します。

public:
 property bool IsPowerOfTwo { bool get(); };
public bool IsPowerOfTwo { get; }
member this.IsPowerOfTwo : bool
Public ReadOnly Property IsPowerOfTwo As Boolean

プロパティ値

BigInteger オブジェクトの値が 2 の累乗の場合は true。それ以外の場合は false

注釈

このプロパティは、値に 0 以外の BigInteger ビットが 1 つ設定されているかどうかを判断します。 つまり、現在BigIntegerのオブジェクトの値が 1 (つまり、20) の場合、または 2 のより大きな累乗である場合は が返trueされます。 現在BigIntegerのオブジェクトのfalse値が 0 の場合は を返します。

適用対象