Previous Up Next

6.27.19  Evaluating a polynomial: horner

The horner command uses Horner’s method to evaluate polynomials.


Example.
Input:

horner(x^2-2*x+1,2)

or:

horner([1,-2,1],2)

Output:

1

Previous Up Next