sign¶
- sign(x: array, /) array¶
Returns an indication of the sign of a number for each element
x_iof the input arrayx.Special cases
If
x_iis less than0, the result is-1.If
x_iis either-0or+0, the result is0.If
x_iis greater than0, the result is+1.
- Parameters:
x (array) – input array. Should have a numeric data type.
- Returns:
out (array) – an array containing the evaluated result for each element in
x. The returned array must have the same data type asx.