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

Functions
round
Complete List of ArrayFire Functions ArrayFire Functions by Category » Mathematical functions » | Numeric functions

Round to nearest integer. More...

## Functions
AFAPI array | round (const array &in)
| C++ Interface for rounding an array of numbers. More...
AFAPI af_err | af_sign (af_array *out, const af_array in)
| C Interface for finding the sign of the input. More...
AFAPI af_err | af_round (af_array *out, const af_array in)
| C Interface for rounding an array of numbers. More...

## Detailed Description

Round to nearest integer.

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

## Function Documentation

AFAPI af_err af_round | ( | af_array * | out,
|  | const af_array | in
| ) |  |

C Interface for rounding an array of numbers.

Parameters

  [out] | out | will contain values rounded to nearest integer
  [in] | in | is input array

Returns
  AF_SUCCESS if the execution completes properly

Note
  The values are rounded to nearest integer

AFAPI af_err af_sign | ( | af_array * | out,
|  | const af_array | in
| ) |  |

C Interface for finding the sign of the input.

Parameters

  [out] | out | will contain the sign of each element of the input arrays
  [in] | in | is input array

Returns
  AF_SUCCESS if the execution completes properly

Note
  output is 1 for negative numbers and 0 for positive numbers

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

C++ Interface for rounding an array of numbers.

Parameters

  [in] | in | is input array

Returns
  values rounded to nearest integer

Note
  The values are rounded to nearest integer

Examples:
  histogram.cpp, and rbm.cpp.