Пример #1
0
        public void OnesComplement()
        {
            int a = 5;

            SqlInt32 x = new SqlInt32(a);
            SqlInt32 z = ~x;

            Assert.AreEqual(z.Value, ~a, "Ones Complement operator does not work correctly");
            z = SqlInt32.OnesComplement(x);
            Assert.AreEqual(z.Value, ~a, "Ones Complement function does not work correctly");
        }
Пример #2
0
        public void OnesComplement()
        {
            int a = 5;

            SqlInt32 x = new SqlInt32(a);
            SqlInt32 z = ~x;

            Assert.Equal(z.Value, ~a);
            z = SqlInt32.OnesComplement(x);
            Assert.Equal(z.Value, ~a);
        }
Пример #3
0
 public static SqlInt32 Mask(SqlInt32 value, SqlInt32 mask)
 {
     return(value | SqlInt32.OnesComplement(mask));
 }