b-horner

▸ function bHorner (p: bigint[], x: bigint): bigint

Defined in evaluate/bigint/b-horner.ts:14

Returns the result of evaluating (at an integer value) a univariate polynomial with bigint coefficients using Horner's method.

Parameters:

NameTypeDescription
pbigint[]a polynomial with coefficients given densely as an array of bigints from highest to lowest power, e.g. [5,-3,0] represents the polynomial 5x^2 - 3x
xbigintthe value at which to evaluate the polynomial

Returns: bigint