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

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

Check if input is negative. More...

## Functions
AFAPI array | sign (const array &in)
| C++ Interface for getting the sign of input. More...

## Detailed Description

Check if input is negative.

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

## Function Documentation

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

C++ Interface for getting the sign of input.

Parameters

  [in] | in | is input array

Returns
  the sign of each element of input

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

Examples:
  plot2d.cpp.