Khan/khan-exercises — pull request #17110 by jc4p (2012-03-21 16:52:16+00:00)
Title: Fix for #16779. Modify utils/polynomial.js for coefficient of -1

Modify utils/polynomial.js to assume a coefficient of -1 and a positive numbered degree means (coefficient*base)^degree rather than coefficient*(base)^degree, so that what displays as -n^2 to the user works for all values of n.

See my comment on #16779 for a more detailed explanation of the problem.

Tested with polynomials:
f(x) = 3x
f(x) = -2x^2 + 3x -3
f(x) = -x^2 + 3x - 3