BigInteger.IsPowerOfTwo 属性

定义

指示当前 BigInteger 对象的值是否是 2 的幂。Indicates whether the value of the current BigInteger object is a power of two.

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

属性值

Boolean

如果 BigInteger 对象的值是 2 的幂,则为 true;否则为 falsetrue if the value of the BigInteger object is a power of two; otherwise, false.

注解

此属性确定某个 BigInteger 值是否设置了单非零位。This property determines whether a BigInteger value has a single non-zero bit set. 这意味着 true ,如果当前对象的值 BigInteger 为 1 (为1,即 20) 或2的任何更大的幂,则返回。This means that it returns true if the value of the current BigInteger object is 1 (that is, 20) or any greater power of two. false如果当前对象的值为0,则返回 BigIntegerIt returns false if the value of the current BigInteger object is 0.

适用于