Closed stepthom closed 11 years ago
Normally in mathematics, a function is written in descending order of the exponents:
f(x) = x^5 + x^4 + x^3 + ...
However, the way that MathFunctions are randomly generated, the ordering of terms is most likely to be unsorted.
Change the addTerm function in MathFuncion to add the term in the right location, thereby ensuring that a function is always in the right order.
addTerm
MathFuncion
Also, create a unit test or two to ensure that addTerm behaves as expected.
PR #8 handles this.
Normally in mathematics, a function is written in descending order of the exponents:
However, the way that MathFunctions are randomly generated, the ordering of terms is most likely to be unsorted.
Change the
addTerm
function inMathFuncion
to add the term in the right location, thereby ensuring that a function is always in the right order.Also, create a unit test or two to ensure that
addTerm
behaves as expected.