Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Zortech C++ 3.0r4 - <b>poly</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
poly

Usage

   #include <math.h>
   double poly(double x,int deg,double coeff[]);

Description

   poly evaluates a polynomial of the form : (coeff[deg] * x + coeff
   [deg-1]) * x +...+ coeff[0].

Example 

   #include <stdio.h>
   #include <math.h>
   #include <stdlib.h>

   double coeff[4];

   int main()
   {
       double x = 1.2,y;
       coeff[0] = 0.0;
       coeff[1] = 1.0;
       coeff[2] = 2.0;
       coeff[3] = 3.0;
       y = poly(x,3,coeff);
       printf("The polynomial is %f\n",y);
       return EXIT_SUCCESS;
   }

Return Value

   The double result is returned.






Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson