- Main Page
- Tutorials
- Functions
- Release Notes
- Examples

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

Raise an array to a power. More...

## Functions
AFAPI af_err | af_pow (af_array *out, const af_array lhs, const af_array rhs, const bool batch)
| C Interface for power. More...
AFAPI array | pow (const array &lhs, const array &rhs)
| C++ Interface for power. More...
AFAPI array | pow (const array &lhs, const double rhs)
| C++ Interface for power. More...
AFAPI array | pow (const double lhs, const array &rhs)
| C++ Interface for power. More...
AFAPI array | pow2 (const array &in)
| C++ Interface for power of 2. More...

## Detailed Description

Raise an array to a power.

Note
  This function supports real inputs only. Complex inputs are not yet supported.

## Function Documentation

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

C Interface for power.

Parameters

  [out] | out | will contain `lhs` raised to power `rhs`
  [in] | lhs | is base
  [in] | rhs | is exponent
  [in] | batch | specifies if operations need to be performed in batch mode

Returns
  AF_SUCCESS if the execution completes properly

AFAPI array af::pow | ( | const array & | lhs,
|  | const array & | rhs
| ) |  |

C++ Interface for power.

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

Parameters

  [in] | lhs | is base
  [in] | rhs | is exponent

Returns
  `lhs` raised to power `rhs`

Examples:
  brain_segmentation.cpp, and heston_model.cpp.

AFAPI array af::pow | ( | const array & | lhs,
|  | const double | rhs
| ) |  |

C++ Interface for power.

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

Parameters

  [in] | lhs | is base
  [in] | rhs | is exponent

Returns
  `lhs` raised to power `rhs`

AFAPI array af::pow | ( | const double | lhs,
|  | const array & | rhs
| ) |  |

C++ Interface for power.

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

Parameters

  [in] | lhs | is base
  [in] | rhs | is exponent

Returns
  `lhs` raised to power `rhs`

AFAPI array af::pow2 | ( | const array & | in | ) |

C++ Interface for power of 2.

Parameters

  [in] | in | is exponent

Returns
  2 raised to power of `in`