Exemplo n.º 1
0
 public static void GenericComparerDouble()
 {
     var numbers   = new[] { -1.5, 0, 1.5, 0, -2.5, 0, 2.5 };
     var instance  = GenericComparer.Create(0d);
     var different = instance.CountDifferent(numbers); // = 4
     var equal     = instance.CountEqual(numbers);     // = 3
 }
Exemplo n.º 2
0
 public static void GenericComparerFactory()
 {
     var numbers   = new[] { -1, 0, 1, 0, -2, 0, 2 };
     var instance  = GenericComparer.Create(0);
     var different = instance.CountDifferent(numbers); // = 4
     var equal     = instance.CountEqual(numbers);     // = 3
 }