def test_sub_frac(self): self.assertIs(fracs.cmp_frac(fracs.sub_frac([1, 1], [1, 1]), [0, 1]), 0) self.assertIs(fracs.cmp_frac(fracs.sub_frac([1, 2], [1, -2]), [1, 1]), 0) self.assertIs(fracs.cmp_frac(fracs.sub_frac([1, 2], [1, 2]), [0, 1]), 0)
# 5.1 import rekurencja print rekurencja.factorial(6) print rekurencja.fibonacci(5) # 5.2 import fracs print fracs.frac2float(fracs.sub_frac([2, 3], [1, 2]))
def test_sub_frac(self): self.assertEqual(fracs.sub_frac([74, 14], [18, 7]), [19, 7])
def test_sub_frac(self): self.assertEqual(fracs.sub_frac([1, 2], [1, 3]), [1, 6]) self.assertEqual(fracs.sub_frac([10, 20], [5, 8]), [-5, 40])
def test_sub_frac(self): self.assertEqual(fracs.sub_frac([2, 3], [1, 4]), [5, 12])
def test_sub_frac(self): self.assertEqual(fracs.sub_frac(f1, f3), [-7, 2]) self.assertEqual(fracs.sub_frac(f3, f4), [0, 2]) self.assertEqual(fracs.sub_frac(f5, f3), [-6, 2])
def test_sub_frac(self): self.assertEqual(fracs.sub_frac(self.pierwszy, self.drugi), [4, 3])
def test_sub_frac(self): self.assertEqual(fracs.sub_frac([3, 5], [1, 5]), [2, 5])
def test_sub_frac(self): self.assertEqual(fracs.sub_frac([5, 7], [3, 7]), [2, 7]) self.assertEqual(fracs.sub_frac([1, 2], [1, 3]), [1, 6]) self.assertEqual(fracs.sub_frac([0, 2], [3, 7]), [-3, 7]) self.assertEqual(fracs.sub_frac([5, 6], [3, 12]), [7, 12]) self.assertEqual(fracs.sub_frac([5, 7], [0, 7]), [5, 7])
def test_sub_frac(self): self.assertEqual(fracs.sub_frac([2, 3], [1, 3]), [1, 3]) self.assertEqual(fracs.sub_frac([1, 3], [1, 3]), [0, 3])
def test_sub_frac(self): self.assertEqual(fracs.sub_frac([1, 2], [1, 3]), [1, 6])