Namespaces
Variants
Views
Actions

pow

From cppreference.com
< c‎ | numeric‎ | math
Revision as of 21:39, 31 May 2013 by P12bot (Talk | contribs)

 
 
 
Common mathematical functions
Functions
Basic operations
(C99)
(C99)
(C99)
(C99)
(C99)
(C99)(C99)(C99)
Exponential functions
(C99)
(C99)
(C99)
(C99)
Power functions
(C99)
(C99)
pow
Trigonometric and hyperbolic functions
(C99)
(C99)
(C99)
Error and gamma functions
(C99)
(C99)
(C99)
(C99)
Nearest integer floating point operations
(C99)(C99)(C99)
(C99)
(C99)(C99)(C99)
Floating point manipulation functions
(C99)(C99)
(C99)
(C99)
Classification
(C99)
(C99)
(C99)
Macro constants
 
Defined in header <math.h>
float       powf( float base, float exp );
(since C99)
double      pow( double base, double exp );
long double powl( long double base, long double exp );
(since C99)

Computes the value of base raised to the power exp or iexp.

Parameters

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

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.

See also

(C99)(C99)
computes e raised to the given power (ex)
(function) [edit]
(C99)(C99)
computes natural (base-e) logarithm (ln(x))
(function) [edit]
(C99)(C99)
computes square root (x)
(function) [edit]
(C99)(C99)(C99)
computes cubic root (3x)
(function) [edit]