Original Post
here is my problem i have this function that will multiply numbers together and keep them sorted in a linked list.
now addpoly just adds 2 polynomials together and returns the sum as a polynomial.
now i can call addpoly just fine in main. but when i call it in the function above it returns nothing. im not sure why?
[edited by - omegasyphon on April 26, 2003 7:42:35 PM]
public Polynomial multiplyPoly( Polynomial rhs)
{
LinkedListIterator itr = myPoly.first();
LinkedListIterator ritr = rhs.getPoly().first();
Polynomial poly = new Polynomial();
Polynomial temp = new Polynomial();
while (ritr.isValid())
{
while (itr.isValid())
{
temp.addTerm(((Term)itr.retrieve()).multiply((Term)ritr.retrieve()));
itr.advance();
}
poly.addpoly(temp);
ritr.advance();
itr = myPoly.first();
}
return poly;
}