1. Computing & Technology
Glossary|Tips/Tricks|FREE App/VCL|Best'O'Net|Books|Link Back

Delphi Programming RTL Reference|By Category|Alphabetically|By Unit
 

Poly

unit
math
category
arithmetic routines

declaration
function Poly(const X: Extended; const Coefficients: array of Double): Extended;

description
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)

example
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) 

in real code

see also


 Free Delphi code snippet inside every Delphi Newsletter!
Subscribe to the Newsletter
Name
Email

 Got some code to share? Got a question? Need some help?

Discuss in my forum

©2012 About.com. All rights reserved.

A part of The New York Times Company.