IntPtr.IsEvenInteger(IntPtr) 方法

定义

确定值是否表示偶数整数。

public:
 static bool IsEvenInteger(IntPtr value) = System::Numerics::INumberBase<IntPtr>::IsEvenInteger;
public static bool IsEvenInteger (IntPtr value);
static member IsEvenInteger : nativeint -> bool
Public Shared Function IsEvenInteger (value As IntPtr) As Boolean

参数

value
IntPtr

nativeint

要检查的值。

返回

true 如果 value 是偶数整数,则为 ;否则为 false

实现

注解

此方法正确处理浮点值,因此 2.0 将返回 true ,而 2.2 将返回 false

的返回值 false 并不表示 IsOddInteger(TSelf) 将返回 true。 具有小数部分的数字(例如 3.3)不是偶数或奇数。

适用于