multiply-by-const
▸ function multiplyByConst
(c
: number, p
: number[]): number[]
Defined in basic/double/multiply-by-const.ts:23
Returns the result of multiplies a polynomial by a constant in double precision.
example
multiplyByConst(0.25, [3,2,1]); //=> [0.75, 0.5, 0.25]
Parameters:
Name | Type | Description |
---|---|---|
c | number | a constant |
p | 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 |
Returns: number[]