Пример #1
0
 def test_true_poly_2(self):
     self.assertEqual(poly2str(diff(read_poly('x'))), '1')
Пример #2
0
from polynom.poly_logic import read_poly
from polynom.poly_logic import diff
from polynom.poly_logic import poly2str
s = '4x^1+0x'
polynom = read_poly(s)
print(polynom)
print(diff(polynom))
print(poly2str(diff(polynom)))
Пример #3
0
 def test_true_poly_10(self):
     self.assertEqual(poly2str(diff(read_poly('-1-x^9+x^10-x'))),
                      '10x^9-9x^8-1')
Пример #4
0
 def test_true_poly_1(self):
     self.assertEqual(poly2str(diff(read_poly('10x^4+10x^6+6x'))),
                      '60x^5+40x^3+6')
Пример #5
0
 def test_true_poly_9(self):
     self.assertEqual(poly2str(diff(read_poly('-x^9-1+x^10'))),
                      '10x^9-9x^8')
Пример #6
0
 def test_true_poly_6(self):
     self.assertEqual(poly2str(diff(read_poly('1+x^9+x^10'))), '10x^9+9x^8')
Пример #7
0
 def test_true_poly_5(self):
     self.assertEqual(poly2str(diff(read_poly('10x^155-x'))), '1550x^154-1')
Пример #8
0
 def test_true_poly_4(self):
     self.assertEqual(poly2str(diff(read_poly('x^5-x^4-x^2'))),
                      '5x^4-4x^3-2x')
Пример #9
0
 def test_true_poly_3(self):
     self.assertEqual(poly2str(diff(read_poly('x^2'))), '2x')