コード例 #1
0
ファイル: Program.cs プロジェクト: rhk98/BinaryShiftAndAdd
 static void Main(string[] args)
 {
     if (args.Length == 2)
     {
         var binaryMultiplicationOfTwoNumbers = new BinaryMultiplicationOfTwoNumbers();
         var result = binaryMultiplicationOfTwoNumbers.MultiplyTheBinaryWay(Convert.ToInt32(args[0]), Convert.ToInt32(args[1]));
         Console.WriteLine("The result the binary way is {0}", result);
     }
     else
     {
         Console.WriteLine("I will only accept 2 integers today...");
     }
 }
コード例 #2
0
 public void Multiply256Times19Success()
 {
     var binaryMultiplicationOfTwoNumbers = new BinaryMultiplicationOfTwoNumbers();
     Assert.AreEqual(4864, binaryMultiplicationOfTwoNumbers.MultiplyTheBinaryWay(256, 19));
 }
コード例 #3
0
 public void Multiply11Times14Success()
 {
     var binaryMultiplicationOfTwoNumbers = new BinaryMultiplicationOfTwoNumbers();
     Assert.AreEqual(154, binaryMultiplicationOfTwoNumbers.MultiplyTheBinaryWay(11, 14));
 }
コード例 #4
0
 public void Multiply102Times233Success()
 {
     var binaryMultiplicationOfTwoNumbers = new BinaryMultiplicationOfTwoNumbers();
     Assert.AreEqual(23766, binaryMultiplicationOfTwoNumbers.MultiplyTheBinaryWay(102, 233));
 }
コード例 #5
0
 public void Multiply1021Times2331Success()
 {
     var binaryMultiplicationOfTwoNumbers = new BinaryMultiplicationOfTwoNumbers();
     Assert.AreEqual(2379951, binaryMultiplicationOfTwoNumbers.MultiplyTheBinaryWay(1021, 2331));
 }
コード例 #6
0
 public void Multiply10216Times23312Success()
 {
     var binaryMultiplicationOfTwoNumbers = new BinaryMultiplicationOfTwoNumbers();
     Assert.AreEqual(238155392, binaryMultiplicationOfTwoNumbers.MultiplyTheBinaryWay(10216, 23312));
 }