語言

BigInteger.IsEven 屬性

定義

表示當前 BigInteger 物件的值是否為偶數。

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

屬性值

true 若物件 BigInteger 值為偶數;否則, false。

備註

此特性是一種便利性,用以判斷一個 BigInteger 值是否能被二整除。 它等價於以下表達式:

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

若當前 BigInteger 物件的值為 BigInteger.Zero,則該性質返回 true。

適用於