pow()

Declaration

double pow(double dX, double dPower);

Description:

This function returns the value of "dX" to the power "dPower."

Overloads

float pow(float, float);
float pow(float, int);
double pow(double, double);
double pow(double, int);
long double pow(long double, long double);
long double pow(long double, int);

Related Functions

float powf(float, float);
long double powl(long double, long double);

* Note: Since C does not allow function overloading, these other versions of this function exist.

Domain

(-∞, ∞)

Range

(-∞, ∞) X (-∞, ∞)

Periodicity

None

Symmetry

None

Asymptotes

None

 

Example

#include <iostream>
#include <cmath>

int main() {
    using namespace std;

    double dX = 1.2;
    double dPower = 3.1;
    cout << "x = " << dX <<
        "  power = " << dPower <<
        "  pow(x, power) = " << pow(dX, dPower) << endl;

    dX = 6.9;
    dPower = 1.4;
    cout << "x = " << dX <<
        "  power = " << dPower <<
        "  pow(x, power) = " << pow(dX, dPower) << endl;

    return 0;
}

Output:

pow() Output