negate

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

Defined in basic/double/negate.ts:14

Returns the negative of the given polynomial (p -> -p).

example

negate([0.1, -0.2]); //=> [-0.1, 0.2]

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[]