-
Notifications
You must be signed in to change notification settings - Fork 1
Simplifying terms
Multiplicate terms are determined on a '*'
operator after all the children are simplified. Multiplicative terms have a base_
and an exponent_
. After all the children have been converted into terms, all terms with the same base_
(determined by printing and comparing their strings) have their exponents added. The terms are then added back to a new multiplicative operator in descending order of their exponents.
Additive terms are determined on a '+'
operator after all the children are simplified. Additive terms have a base_
and a coefficient_
. After all the children have been converted into terms, all terms with the same base_
have their coefficients added. The terms are then added back to a new addition operator. The terms are currently unsorted.