Defined in header
Raises a value to a power.
baseraised to the power specified by the corresponding element from the numeric array
The behavior is undefined if base.size() != exp.size().
baseraised to the power
vbaseraised to the power defined by the elements in the numeric array
|base||-||numeric array containing the values of the base|
|exp||-||numeric array containing the values of the exponent|
|vbase||-||a value defining the base|
|vexp||-||a value defining the exponent|
A numeric array containing the results of exponentiation.
Unqualified function (pow) is used to perform the computation. If such function is not available, std::pow is used due to argument dependent lookup.
The function can be implemented with the return type different from std::valarray. In this case, the replacement type has the following properties:
- All const member functions of std::valarray are provided.
- std::valarray, std::slice_array, std::gslice_array, std::mask_array and std::indirect_array can be constructed from the replacement type.
- All functions accepting an argument of type const std::valarray& except begin() and end() (since C++11) should also accept the replacement type.
- All functions accepting two arguments of type const std::valarray& should accept every combination of const std::valarray& and the replacement type.
- The return type does not add more than two levels of template nesting over the most deeply-nested argument type.
The following behavior-changing defect reports were applied retroactively to previously published C++ standards.
|DR||Applied to||Behavior as published||Correct behavior|
|| only deduce |
|This section is incomplete|
Reason: no example
| applies the function std::sqrt to each element of valarray |
| raises a number to the given power (xy) |
| complex power, one or both arguments may be a complex number |