invert

▸ function invert (p: number[]): number[]

Defined in basic/double/invert.ts:16

Inverts the given polynomial by reversing the order of the coefficients, i.e. p(x) -> x^deg(p) * p(1/x)

example

invert([3,2,-5]); // => [-5,2,3]

Parameters:

NameTypeDescription
pnumber[]a polynomial with coefficients given densely as an array of double floating point numbers from highest to lowest power, e.g. [5,-3,0] represents the polynomial 5x^2 - 3x

Returns: number[]