BigInteger.IsEven 属性

定义

指示当前 BigInteger 对象的值是否是偶数。Indicates whether the value of the current BigInteger object is an even number.

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

属性值

如果 true 对象的值是偶数,则为 BigInteger;否则为 falsetrue if the value of the BigInteger object is an even number; otherwise, false.

注解

此属性是一项便利功能,用于指示 BigInteger 值是否均匀地除以2。This property is a convenience feature that indicates whether a BigInteger value is evenly divisible by two. 它等效于以下表达式:It is equivalent to the following expression:

value % 2 == 0;  
value Mod 2 = 0  

如果 BigInteger.Zero当前 BigInteger 对象的值,则属性将返回 trueIf the value of the current BigInteger object is BigInteger.Zero, the property returns true.

适用于