equal
▸ function equal
(p1
: number[], p2
: number[]): boolean
Defined in basic/double/equal.ts:17
Returns true if two polynomials are exactly equal by comparing coefficients, false otherwise.
example
equal([1,2,3,4], [1,2,3,4]); //=> true
equal([1,2,3,4], [1,2,3,4,5]); //=> false
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: boolean