b-from-roots

▸ function bFromRoots (roots: bigint[]): bigint[]

Defined in roots/from-roots/bigint/b-from-roots.ts:22

Constructs a polynomial from the given roots by multiplying out the factors (x - root1)(x - root2)

  • currently, only integer roots are allowed

example

fromRoots([1n,2n,3n,3n]); //=> [1n, -9n, 29n, -39n, 18n]

Parameters:

NameTypeDescription
rootsbigint[]an array of roots

Returns: bigint[]