Esempio n. 1
0
 public void GivenGetBinaryGcd_ForFourNumWhenOneOfNumbersIsZeroOutIsPositive()
 {
     Assert.AreEqual(1, AlgorithmGcd.GetBinaryGcd(0, -17, 34, 30, out double elapsedMs));
     Assert.AreEqual(5, AlgorithmGcd.GetBinaryGcd(-340000, 0, 50, 100005, out elapsedMs));
 }
Esempio n. 2
0
 public void GivenGetBinaryGcd_ForFourNumWhenNumbersIsNegativeAndPositiveOutIsPositive()
 {
     Assert.AreEqual(1, AlgorithmGcd.GetBinaryGcd(34, -17, 34, -50, out double elapsedMs));
     Assert.AreEqual(2, AlgorithmGcd.GetBinaryGcd(-340000, 170, 34, -100, out elapsedMs));
 }
Esempio n. 3
0
 public void GivenGetBinaryGcd_ForThreeNumWhenNumbersIsNegativeOutIsPositive()
 {
     Assert.AreEqual(1, AlgorithmGcd.GetBinaryGcd(-34, -17, -3700, out double elapsedMs));
     Assert.AreEqual(17, AlgorithmGcd.GetBinaryGcd(-340000, -170, -17, out elapsedMs));
 }
Esempio n. 4
0
 public void GivenGetBinaryGcd_ForFourNumWhenNumbersIsPositiveOutIsPositive()
 {
     Assert.AreEqual(1, AlgorithmGcd.GetBinaryGcd(34, 17, 3700, 170, out double elapsedMs));
     Assert.AreEqual(1, AlgorithmGcd.GetBinaryGcd(340000, 170, 17, 1900, out elapsedMs));
 }
Esempio n. 5
0
 public void GivenGetBinaryGcd_ForTwoNumWhenOneOfNumbersIsZeroOutIsPositive()
 {
     Assert.AreEqual(17, AlgorithmGcd.GetBinaryGcd(0, -17, out double elapsedMs));
     Assert.AreEqual(340000, AlgorithmGcd.GetBinaryGcd(-340000, 0, out elapsedMs));
 }