Pow()
Power function, x to the y (x**y)
Declaration:
Real:
double
pow(double x, double y);
long
double pow(long double (x), long double (y));
Complex:
complex
pow(complex x, complex y);
complex
pow(complex x, double y);
complex
pow(double x, double y);
Return Value:
On success,
pow and powl return
the value calculated, x**y.
If x and y are both 0, they return 1.
If x is real and < 0, and y is not a whole number, these functions set errno to
EDOM (domain error).
program
#include <math.h>
#include <stdio.h>
int main(void)
{
double x = 2.0, y =
3.0;
printf("%lf
raised to %lf is %lf\n", x, y, pow(x, y));
return 0;
}
0 comments:
Post a Comment