A high-performance general-purpose compute library

- Main Page
- Tutorials
- Release Notes
- Examples

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

## Functions
array | trunc (const array &in)
| C++ Interface to truncate numbers.
af_err | af_trunc (af_array *out, const af_array in)
| C Interface to truncate numbers.

## Detailed Description

Truncate numbers to nearest integer.

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

## Function Documentation

## ◆ af_trunc()

af_err af_trunc | ( | af_array * | out,
|  | const af_array | in )

C Interface to truncate numbers.

Parameters

  [out] | out | nearest integer not greater in magnitude than `in`
  [in] | in | input array

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

## ◆ trunc()

array trunc | ( | const array & | in | ) |

C++ Interface to truncate numbers.

Parameters

  [in] | in | input array

Returns
  nearest integer not greater in magnitude than `in`