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"); }
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); }
public static SqlInt32 Mask(SqlInt32 value, SqlInt32 mask) { return(value | SqlInt32.OnesComplement(mask)); }