Delphi Programming RTL Reference|By Category|Alphabetically|By Unit
function Poly(const X: Extended; const Coefficients: array of Double): Extended;
Evaluates a uniform polynomial of one variable at the value X.
The coefficients are ordered in increasing powers of X, as shown here:
Coefficients[0] + Coefficients[1]*X + ... + Coefficients[N]*(X^N)
const coef: array[0..3] of Char = (1,5,7,-1);
const x = 5;
...
result := Poly(x, coef);
//result = 1 + 5*5 + 25 * 7 + 125 * (-1)
|
|
Free Delphi code snippet inside every Delphi Newsletter! |
|
|
|
Got some code to share? Got a question? Need some help? |
|
|