coefficients

List that contains coefficients of the polynomial.

Every monomial \(a x^d\) is stored as a coefficient \(a\) placed into the list at index \(d\). For example, coefficients of a polynomial \(5 x^2 - 6\) can be represented as

listOf(
-6, // -6 +
0, // 0 x +
5, // 5 x^2
)

and also as

listOf(
-6, // -6 +
0, // 0 x +
5, // 5 x^2
0, // 0 x^3
0, // 0 x^4
)

It is not prohibited to put extra zeros at end of the list (as for \(0x^3\) and \(0x^4\) in the example). But the longer the coefficients list the worse performance of arithmetical operations performed on it. Thus, it is recommended not to put (or even to remove) extra (or useless) coefficients at the end of the coefficients list.