std::pow(std::valarray)
Defined in header <valarray> | | |
|---|---|---|
template< class T > valarray<T> pow( const valarray<T>& base, const valarray<T>& exp ); | (1) | |
template< class T > valarray<T> pow( const valarray<T>& base, const T& vexp ); | (2) | |
template< class T > valarray<T> pow( const T& vbase, const valarray<T>& exp ); | (3) | |
使某一力量产生价值。
1%29计算数字数组中每个元素的值。base从数字数组中提升到相应元素指定的功率。exp...
如果base.size() != exp.size()...
2%29计算数字数组中每个元素的值。base升到权力vexp...
3%29计算vbase提升到数字数组中的元素定义的幂。exp...
参数
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 |
返回值
包含指数结果的数字数组。
注记
不合格职能%28pow%29用于执行计算。如果没有这样的功能,std::pow由于参数相关查找而使用。
函数的返回类型与std::valarray在这种情况下,替换类型具有以下属性:
- 全
const成员职能std::valarray提供。
std::valarray,,,std::slice_array,,,std::gslice_array,,,std::mask_array和std::indirect_array可以从替换类型构造。
- 所有接受类型参数的函数
conststd::valarray&除begin()和end()%28,因为C++14%29也应该接受替换类型。
- 接受两个类型参数的所有函数
conststd::valarray&应该接受每一个组合conststd::valarray&以及替代型。
- 返回类型不会在最嵌套的参数类型上添加两个以上的模板嵌套级别。
例
另见
sqrt(std::valarray) | applies the function std::sqrt to each element of valarray (function template) |
|---|---|
pow | raises a number to the given power (xy) (function) |
pow(std::complex) | complex power, one or both arguments may be a complex number (function template) |
© cppreference.com在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。
本文档系腾讯云开发者社区成员共同维护,如有问题请联系 cloudcommunity@tencent.com

