Esempio n. 1
0
	Polynomial operator - (Polynomial & other)
	{
		Polynomial ret = (*this);
		for (int j = 0; j < other.terms.size(); ++j)
			ret.terms.push_back(-(other.terms[j]));
		ret.refine();
		return ret;
	}
Esempio n. 2
0
	Polynomial operator / (Fraction & x)
	{
		Polynomial ret = (*this);
		for (int j = 0; j < ret.terms.size(); ++j)
			ret.terms[j].coff = ret.terms[j].coff / x;
		ret.refine();
		return ret;
	}
Esempio n. 3
0
	Polynomial operator * (Polynomial & other)
	{
		Polynomial ret;
		for (int i = 0; i < terms.size(); ++i)
			for (int j = 0; j < other.terms.size(); ++j)
				ret.terms.push_back(terms[i] * other.terms[j]);
		ret.refine();
		return ret;
	}