Lines Matching refs:gcd
697 gcd = math.gcd
698 self.assertEqual(gcd(0, 0), 0)
699 self.assertEqual(gcd(1, 0), 1)
700 self.assertEqual(gcd(-1, 0), 1)
701 self.assertEqual(gcd(0, 1), 1)
702 self.assertEqual(gcd(0, -1), 1)
703 self.assertEqual(gcd(7, 1), 1)
704 self.assertEqual(gcd(7, -1), 1)
705 self.assertEqual(gcd(-23, 15), 1)
706 self.assertEqual(gcd(120, 84), 12)
707 self.assertEqual(gcd(84, -120), 12)
708 self.assertEqual(gcd(1216342683557601535506311712,
715 self.assertEqual(gcd(a, b), c)
716 self.assertEqual(gcd(b, a), c)
717 self.assertEqual(gcd(-a, b), c)
718 self.assertEqual(gcd(b, -a), c)
719 self.assertEqual(gcd(a, -b), c)
720 self.assertEqual(gcd(-b, a), c)
721 self.assertEqual(gcd(-a, -b), c)
722 self.assertEqual(gcd(-b, -a), c)
726 self.assertEqual(gcd(a, b), c)
727 self.assertEqual(gcd(b, a), c)
728 self.assertEqual(gcd(-a, b), c)
729 self.assertEqual(gcd(b, -a), c)
730 self.assertEqual(gcd(a, -b), c)
731 self.assertEqual(gcd(-b, a), c)
732 self.assertEqual(gcd(-a, -b), c)
733 self.assertEqual(gcd(-b, -a), c)
735 self.assertRaises(TypeError, gcd, 120.0, 84)
736 self.assertRaises(TypeError, gcd, 120, 84.0)
737 self.assertEqual(gcd(MyIndexable(120), MyIndexable(84)), 12)