Microchip Technology SW006021-1N Benutzerhandbuch
![Microchip Technology](https://files.manualsbrain.com/attachments/cf42c3c895ef469f06d2e47e97fd98d738fcf5cf/common/fit/150/50/7340124dc8aa983aaf764094e2f06faab86f306c03111c5817f7e4e53fb2/brand_logo.gif)
Library Functions
2012 Microchip Technology Inc.
DS52053B-page 331
EVAL_POLY
Synopsis
#include <math.h>
double eval_poly (double x, const double * d, int n)
Description
The
eval_poly()
function evaluates a polynomial, whose coefficients are contained in
the array
d
, at
x
, for example:
y = x*x*d2 + x*d1 + d0.
The order of the polynomial is passed in
n
.
Example
#include <stdio.h>
#include <math.h>
void
main (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 Value
A double value, being the polynomial evaluated at
x
.
EXP
Synopsis
#include <math.h>
double exp (double f)
Description
The
exp()
routine returns the exponential function of its argument; i.e., ‘e’ to the power
of ‘
f
’
.
Example
#include <math.h>
#include <stdio.h>
void
main (void)
{
double f;
for(f = 0.0 ; f <= 5 ; f += 1.0)
printf(“e to %1.0f = %f\n”, f, exp(f));
}
See Also
log(
), log10(), pow()