From: Peter Vandenabeele Date: 2012-02-09T21:32:55+09:00 Subject: Re: Operator Overloading --002354470c5c11455404b8873655 Content-Type: text/plain; charset=UTF-8 On Thu, Feb 9, 2012 at 1:09 PM, luk malcik wrote: > I need to write + operator for polynomials. How can I do that for > (that's an example, i need for all polynomials!:)) expression (3x^2 + > 2x + 2) + (2x^2 + 2x +5) > Well, first start with defining the class that represents your polynomials ... (with proper tests, on "input" and "output" methods). When that is done, start defining the '==', '+', '*', ... methods (with proper tests, otherwise you wouldn't pass if I was your professor) Doing the polynomial division and "find poles" would be fun to earn better grades :-) HTH, Peter *** Available for a new project *** Peter Vandenabeele http://twitter.com/peter_v http://rails.vandenabeele.com http://coderwall.com/peter_v --002354470c5c11455404b8873655--