public void TestBitwiseMin_10_5() { var t = new Twiddle(); int a = 10; int b = 5; int expected = Math.Min(a, b); int actual = t.BitwiseMin1(a, b); Assert.AreEqual(expected, actual); }
public void TestBitwiseMin_m999_m1000() { var t = new Twiddle(); int a = -999; int b = -1000; int expected = Math.Min(a, b); int actual = t.BitwiseMin1(a, b); Assert.AreEqual(expected, actual); }
public void TestBitwiseMin_minval_0() { var t = new Twiddle(); int a = int.MinValue; int b = 0; int expected = Math.Min(a, b); int actual = t.BitwiseMin1(a, b); Assert.AreEqual(expected, actual); }
public void TestNumberOfSetBitsBK_16() { uint n = 16; uint expected = 1; uint actual = new Twiddle().NumberOfSetBitsBK(n); Assert.AreEqual(expected, actual); }
public void TestNumberOfSetBits_15() { uint n = 15; uint expected = 4; uint actual = new Twiddle().NumberOfSetBits(n); Assert.AreEqual(expected, actual); }
public void TestBitwiseMax_2_1() { var t = new Twiddle(); int a = 2; int b = 1; int expected = Math.Max(a, b); int actual = t.BitwiseMax(a, b); Assert.AreEqual(expected, actual); }