VMS Help  —  CRTL  pow
    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)

1  –  Arguments

 x

    A floating-point base to be raised to an exponent y.

 y

    The exponent to which the base x is to be raised.

2  –  Description

    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.

3  –  Return Values

    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.

4  –  Example

        #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
Close Help