VMS Help
CRTL, pow
*Conan The Librarian
|
Returns the first argument raised to the power of the second
argument.
Format
#include <math.h>
double pow (double x, double y);
float powf (float x, float y); (Integrity servers, Alpha)
long double powl (long double x, long double y);
(Integrity servers, Alpha)
x
A floating-point base to be raised to an exponent y.
y
The exponent to which the base x is to be raised.
The pow functions raise a floating-point base x to a floating-
point exponent y. The value of pow(x,y) is computed as e**(y
ln(x)) for positive x.
If x is 0 and y is negative, HUGE_VAL is returned and errno is
set to ERANGE or EDOM.
x The result of the first argument raised to the
power of the second.
1.0 The base is 0 and the exponent is 0.
HUGE_VAL The result overflowed; errno is set to ERANGE.
HUGE_VAL The base is 0 and the exponent is negative;
errno is set to ERANGE or EDOM.
#include <stdio.h>
#include <math.h>
#include <errno.h>
main()
{
double x;
errno = 0;
x = pow(-3.0, 2.0);
printf("%d, %f\n", errno, x);
}
This example program outputs the following:
0, 9.000000