baseexponent
In C++, this function is overloaded in <complex> and <valarray> (see complex pow and valarray pow).
Parameters
- base
- Floating point value.
- exponent
- Floating point value.
Return Value
The result of raising base to the power exponent.If the magnitude of the result is so large that it cannot be represented in an object of the return type, a range error occurs, returning HUGE_VAL with the appropiate sign and setting the value of the global variable errno to the ERANGE value.
If base is negative and exponent is not an integral value, or if base is zero and exponent is negative, a domain error occurs, setting the global variable errno to the value EDOM.
Portability
In C, only the version taking two double parameters exists with this name. The other overloads are only available in C++.Example
| 1 2 3 4 5 6 7 8 9 10 11 |
|
Output:
7 ^ 3 = 343.000000 4.73 ^ 12 = 125410439.217423 32.01 ^ 1.54 = 208.036691 |
See also
| log | Compute natural logarithm (function) |
| exp | Compute exponential function (function) |
| sqrt | Compute square root (function) |
