Beispiel #1
0
 def test_multiply_large_numbers(self):
     first = pow(81723, 4)
     second = pow(56789, 7)
     mod = 123456789
     result = Modular.mul_modulo(first, second, mod)
     expected = 28459179
     self.assertEqual(expected, result)
Beispiel #2
0
 def test_simple_multiply(self):
     first = 2
     second = 3
     mod = 5
     result = Modular.mul_modulo(first, second, mod)
     expected = 1
     self.assertEqual(expected, result)
Beispiel #3
0
 def test_multiply_by_modulo_multiple(self):
     first = 10
     second = 7
     mod = 5
     result = Modular.mul_modulo(first, second, mod)
     expected = 0
     self.assertEqual(expected, result)