A high-performance general-purpose compute library

- Main Page
- Tutorials
- Release Notes
- Examples

Functions
pow
ArrayFire Functions | ArrayFire Functions by Category » Mathematical functions » Exponential and logarithmic functions

## Functions
af_err | af_pow (af_array *out, const af_array lhs, const af_array rhs, const bool batch)
| C Interface to raise a base to a power (or exponent).
array | pow (const array &base, const array &exponent)
| C++ Interface to raise a base to a power (or exponent).
array | pow (const array &base, const double exponent)
| C++ Interface to raise a base to a power (or exponent).
array | pow (const double base, const array &exponent)
| C++ Interface to raise a base to a power (or exponent).
array | pow2 (const array &in)
| C++ Interface to raise 2 to a power (or exponent).

## Detailed Description

Raise a base to a power (or exponent).

## Function Documentation

## ◆ af_pow()

af_err af_pow | ( | af_array * | out,
|  | const af_array | lhs,
|  | const af_array | rhs,
|  | const bool | batch )

C Interface to raise a base to a power (or exponent).

Parameters

  [out] | out | `lhs` raised to the power of `rhs`
  [in] | lhs | base
  [in] | rhs | exponent
  [in] | batch | batch mode

Returns
  AF_SUCCESS, if function returns successfully, else an af_err code is given

## ◆ pow() [1/3]

array pow | ( | const array & | base,
|  | const array & | exponent )

C++ Interface to raise a base to a power (or exponent).

Computes the value of `base` raised to the power of `exponent`. The inputs can be two arrays or an array and a scalar.

Parameters

  [in] | base | base
  [in] | exponent | exponent

Returns
  `base` raised to the power of `exponent`

## ◆ pow() [2/3]

array pow | ( | const array & | base,
|  | const double | exponent )

C++ Interface to raise a base to a power (or exponent).

Computes the value of `base` raised to the power of `exponent`. The inputs can be two arrays or an array and a scalar.

Parameters

  [in] | base | base
  [in] | exponent | exponent

Returns
  `base` raised to the power of `exponent`

## ◆ pow() [3/3]

array pow | ( | const double | base,
|  | const array & | exponent )

C++ Interface to raise a base to a power (or exponent).

Computes the value of `base` raised to the power of `exponent`. The inputs can be two arrays or an array and a scalar.

Parameters

  [in] | base | base
  [in] | exponent | exponent

Returns
  `base` raised to the power of `exponent`

## ◆ pow2()

array pow2 | ( | const array & | in | ) |

C++ Interface to raise 2 to a power (or exponent).

Parameters

  [in] | in | power

Returns
  2 raised to the power