首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

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_arraystd::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)

代码语言:txt
复制
 © cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

扫码关注腾讯云开发者

领取腾讯云代金券