예제 #1
0
        public static void UIntPtrArithmetic()
        {
            var value = new UIntPtr(40U);

            Equal(new UIntPtr(800U), value.Multiply(new UIntPtr(20U)));
            Equal(new UIntPtr(800U), value.MultiplyChecked(new UIntPtr(20U)));
            Equal(uint.MaxValue * 2UL, new UIntPtr(uint.MaxValue).Multiply(new UIntPtr(2U)).ToUInt64());
            Equal(new UIntPtr(20U), value.Divide(new UIntPtr(2L)));
            Equal(new UIntPtr(40U ^ 234U), value.Xor(new UIntPtr(234U)));
            Equal(new UIntPtr(60U), value.Add(new UIntPtr(20U)));
            Equal(new UIntPtr(39U), value.Decrement());
            Equal(new UIntPtr(41U), value.Increment());
            Equal(new UIntPtr(1), value.Remainder(new UIntPtr(3)));
        }