polynEval(p, x)

Evaluates a polynomial.

ppolynomial as vector
xthe point of evaluation
return valueevaluation

The polynomial is represented by a vector of coefficients in decreasing order of orders.

// i^2 == -1 polynEval([1,0,1],-1i)