std::pow

From Cppreference

Jump to: navigation, search
Defined in header <cmath>

float       pow( float base, float exp );

double      pow( double base, double exp );

long double pow( long double base, long double exp );

float       pow( float base, int iexp );

double      pow( double base, int iexp );

long double pow( long double base, int iexp );

Computes the base raised by power exp or iexp.

[edit] Parameters

base - base as floating point value
exp - exponent as floating point value
iexp - exponent as integer value

[edit] Return value

base raised by power (exp or iexp).

Domain error occurs if base is 0 and exp is less than or equal to 0. NAN is returned in that case.

Domain error occurs if base is negative and exp is not an integer value. NAN is returned in that case.

Range error occurs if an overflow takes place. HUGEVAL is returned in that case.

[edit] See also

exp
returns e raised to the given power (ex)
(function)
log
computes natural (base e) logarithm (to base e) (ln(x))
(function)
sqrt
computes square root (x)
(function)
cbrt (C++11)
computes cubic root (3x)
(function)