add
▸ function add
(p1
: number[], p2
: number[]): number[]
Defined in basic/double/add.ts:22
Returns the result of adding two polynomials in double precision.
example
add([1,2,3],[3,4]); //=> [1,5,7]
Parameters:
Name | Type | Description |
---|---|---|
p1 | number[] | 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 |
p2 | number[] | another polynomial |
Returns: number[]