I would like to propose the addition of a polynomial addition feature in math. This feature would allow users to easily create polynomials and perform addition operations on them, enhancing the functionality and usability of the package.
Proposed Implementation:
Polynomial Class: A class that represents a polynomial and contains methods to add terms and display the polynomial.
Addition Function: A function that takes multiple polynomials, merges like terms, and returns the resulting polynomial.
Example Usage:
from polynomial_addition import Polynomial, add_polynomials
Is there an existing issue for this?
Feature Description
I would like to propose the addition of a polynomial addition feature in math. This feature would allow users to easily create polynomials and perform addition operations on them, enhancing the functionality and usability of the package.
Proposed Implementation:
Polynomial Class: A class that represents a polynomial and contains methods to add terms and display the polynomial. Addition Function: A function that takes multiple polynomials, merges like terms, and returns the resulting polynomial. Example Usage:
from polynomial_addition import Polynomial, add_polynomials
poly1 = Polynomial() poly1.add_term(3, 2) # 3x^2 poly1.add_term(5, 1) # 5x
poly2 = Polynomial() poly2.add_term(2, 2) # 2x^2 poly2.add_term(-5, 1) # -5x
added_poly = add_polynomials([poly1, poly2]) print("Added Polynomial:", added_poly.display()) #5x^2
I have already tried the code, and it is producing the expected results as shown in the example usage.Please assign this issue to me.
Record
Full Name
Gargi Lodh
Participant Role
GSSOC