本文整理汇总了C#中de4dot.blocks.cflow.Int32Value.hasValue方法的典型用法代码示例。如果您正苦于以下问题:C# Int32Value.hasValue方法的具体用法?C# Int32Value.hasValue怎么用?C# Int32Value.hasValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类de4dot.blocks.cflow.Int32Value
的用法示例。
在下文中一共展示了Int32Value.hasValue方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Mul
public static Int32Value Mul(Int32Value a, Int32Value b)
{
if (a.allBitsValid() && b.allBitsValid())
return new Int32Value(a.value * b.value);
if (a.isZero() || b.isZero())
return zero;
if (a.hasValue(1))
return b;
if (b.hasValue(1))
return a;
return createUnknown();
}
示例2: Rem_Un
public static Int32Value Rem_Un(Int32Value a, Int32Value b)
{
if (a.allBitsValid() && b.allBitsValid()) {
try {
return new Int32Value((int)((uint)a.value % (uint)b.value));
}
catch (ArithmeticException) {
return createUnknown();
}
}
if ((ReferenceEquals(a, b) && a.isNonZero()) || b.hasValue(1))
return zero;
return createUnknown();
}
示例3: Div
public static Int32Value Div(Int32Value a, Int32Value b)
{
if (a.allBitsValid() && b.allBitsValid()) {
try {
return new Int32Value(a.value / b.value);
}
catch (ArithmeticException) {
return createUnknown();
}
}
if (ReferenceEquals(a, b) && a.isNonZero())
return one;
if (b.hasValue(1))
return a;
return createUnknown();
}
示例4: compareLt_Un
public static Bool3 compareLt_Un(Int32Value a, Int32Value b)
{
if (a.allBitsValid() && b.allBitsValid())
return (uint)a.value < (uint)b.value ? Bool3.True : Bool3.False;
if (a.hasValue(uint.MaxValue))
return Bool3.False; // max < x => false
if (b.hasValue(uint.MinValue))
return Bool3.False; // x < min => false
return Bool3.Unknown;
}
示例5: compareLe_Un
public static Bool3 compareLe_Un(Int32Value a, Int32Value b)
{
if (a.allBitsValid() && b.allBitsValid())
return (uint)a.value <= (uint)b.value ? Bool3.True : Bool3.False;
if (a.hasValue(uint.MinValue))
return Bool3.True; // min <= x => true
if (b.hasValue(uint.MaxValue))
return Bool3.True; // x <= max => true
return Bool3.Unknown;
}
示例6: compareGt
public static Bool3 compareGt(Int32Value a, Int32Value b)
{
if (a.allBitsValid() && b.allBitsValid())
return a.value > b.value ? Bool3.True : Bool3.False;
if (a.hasValue(int.MinValue))
return Bool3.False; // min > x => false
if (b.hasValue(int.MaxValue))
return Bool3.False; // x > max => false
return Bool3.Unknown;
}
示例7: compareGe
public static Bool3 compareGe(Int32Value a, Int32Value b)
{
if (a.allBitsValid() && b.allBitsValid())
return a.value >= b.value ? Bool3.True : Bool3.False;
if (a.hasValue(int.MaxValue))
return Bool3.True; // max >= x => true
if (b.hasValue(int.MinValue))
return Bool3.True; // x >= min => true
return Bool3.Unknown;
}