コード例 #1
0
        public static CanonicalIntegerBoolean AddUnsigned(TIntT first, TIntT second, out TIntT result)
        {
            var result_ = unchecked (first + second);

            result = result_;
            return(CanonicalIntegerBooleanModule.LessThanOrEqual(first.ToUnsignedUnchecked(), result_.ToUnsignedUnchecked()));
        }
コード例 #2
0
        public static CanonicalIntegerBoolean DecreaseUnsigned(CanonicalIntegerBoolean borrow, TIntT value, out TIntT result)
        {
            var t = value - 1;

            return(CanonicalIntegerBooleanModule.Equals(0, value) | ConditionalDecreaseUnsigned(borrow, t, out result));
        }
コード例 #3
0
 public static CanonicalIntegerBoolean DecreaseUnsigned(TIntT value, out TIntT result)
 {
     result = value - 1;
     return(CanonicalIntegerBooleanModule.Equals(0, value));
 }
コード例 #4
0
        public static CanonicalIntegerBoolean IncreaseUnsigned(CanonicalIntegerBoolean carry, TIntT value, out TIntT result)
        {
            var t = 1 + value;

            return(CanonicalIntegerBooleanModule.Equals(-1, value.ToSignedUnchecked()) | ConditionalIncreaseUnsigned(carry, t, out result));
        }
コード例 #5
0
 public static CanonicalIntegerBoolean IncreaseUnsigned(TIntT value, out TIntT result)
 {
     result = 1 + value;
     return(CanonicalIntegerBooleanModule.Equals(-1, value.ToSignedUnchecked()));
 }
コード例 #6
0
 public static CanonicalIntegerBoolean ConditionalDecreaseUnsigned(CanonicalIntegerBoolean borrow, TIntT value, out TIntT result)
 {
     ConditionalDecreaseUnchecked(borrow, value, out result);
     return(borrow & CanonicalIntegerBooleanModule.Equals(0, value));
 }
コード例 #7
0
 public static CanonicalIntegerBoolean SubtractUnsigned(TIntT first, TIntT second, out TIntT result)
 {
     result = unchecked (first - second);
     return(CanonicalIntegerBooleanModule.GreaterThanOrEqual(first.ToUnsignedUnchecked(), second.ToUnsignedUnchecked()));
 }