11.07.2015 Views

PicC 9.50 dsPIC Manual.pdf

PicC 9.50 dsPIC Manual.pdf

PicC 9.50 dsPIC Manual.pdf

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Library FunctionsEVAL_POLYSynopsis#include double eval_poly (double x, const double * d, int n)DescriptionThe eval_poly() function evaluates a polynomial, whose coefficients are contained in the array d, atx, for example:y = x*x*d2 + x*d1 + d0.The order of the polynomial is passed in n.Example#include #include voidmain (void){double x, y;double d[3] = {1.1, 3.5, 2.7};}x = 2.2;y = eval_poly(x, d, 2);printf("The polynomial evaluated at %f is %f\n", x, y);Return ValueA double value, being the polynomial evaluated at x.142

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!