Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include "Polynom.h"
- #include "rational.h"
- #include<iostream>
- using namespace std;
- void testPolynomial()
- {
- cout << "----- start testPolynomial ---------" << endl;
- cout << "test0 :" << Polynom::getMaxDegree() << endl;
- Polynomial p1;
- cout << "test1: " << p1;
- Polinomial p2(6);
- p2.setCoeff(2, 0.4);
- cout << "test2: " << p2 << "degree=" << p2.getDegree(false) << endl;
- double c[5] = { 0.1, 0.2, 0 ,11.5, 1.3 };
- Polinomial p3(c, 4);
- cout << "test3: " << p3;
- p2.setCoeff(2, 0.0);
- cout << "test4: " << p2;
- cout << "test6 :maxDegree = " << Polinomial::getMaxDegree() << endl;
- cout << "______________" << endl;
- }
- void testRational() {
- cout << "----- start testRational ---------" << endl;
- cout << "test7" << endl;
- Rational r1;
- r1.print();
- cout << r1;
- double c[] = { 0,2,2,3,4,5 };
- Polinomial p1(c, 5);
- c[0] = 1.2;
- Polinomial p2(c, 3);
- Rational r2(p1, p2);
- cout << "test8" << endl;
- r2.print();
- cout << endl << r2 << endl;
- cout << "test9" << endl;
- cout << "nom = " << r2.getNom();
- cout << "denom = " << r2.getDenom();
- cout << "test10 :maxDegree = " << Polinomial::getMaxDegree() << endl;
- cout << "__________________________" << endl;
- }
- int main()
- {
- testPolynomial();
- testRational();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement