A high-performance general-purpose compute library

- Main Page
- Tutorials
- Release Notes
- Examples

Functions
rem
ArrayFire Functions | ArrayFire Functions by Category » Mathematical functions » Numeric functions

## Functions
af_err | af_rem (af_array *out, const af_array lhs, const af_array rhs, const bool batch)
| C Interface to calculate the remainder.
array | rem (const array &lhs, const array &rhs)
array | rem (const array &lhs, const double rhs)
array | rem (const double lhs, const array &rhs)

## Detailed Description

Calculate the remainder of a division.

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

## Function Documentation

## ◆ af_rem()

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

C Interface to calculate the remainder.

Parameters

  [out] | out | remainder
  [in] | lhs | numerator
  [in] | rhs | denominator
  [in] | batch | batch mode

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

## ◆ rem() [1/3]

array rem | ( | const array & | lhs,
|  | const array & | rhs )

C++ Interface to calculate the remainder.

Parameters

  [in] | lhs | numerator; can be an array or a scalar
  [in] | rhs | denominator; can be an array or a scalar

Returns
  remainder

## ◆ rem() [2/3]

array rem | ( | const array & | lhs,
|  | const double | rhs )

C++ Interface to calculate the remainder.

Parameters

  [in] | lhs | numerator; can be an array or a scalar
  [in] | rhs | denominator; can be an array or a scalar

Returns
  remainder

## ◆ rem() [3/3]

array rem | ( | const double | lhs,
|  | const array & | rhs )

C++ Interface to calculate the remainder.

Parameters

  [in] | lhs | numerator; can be an array or a scalar
  [in] | rhs | denominator; can be an array or a scalar

Returns
  remainder