copapy.sign#

copapy.sign(x)#
Overloads:
  • x (U) → int

  • x (value[U]) → value[int]

  • x (vector[U]) → vector[int]

  • x (tensor[U]) → tensor[int]

Return 1 for positive numbers and -1 for negative numbers. For an input of 0 the return value is 0.

Parameters:

x (TypeVar(U, int, float) | value[TypeVar(U, int, float)] | vector[TypeVar(U, int, float)] | tensor[TypeVar(U, int, float)]) – Input value

Returns:

-1, 0 or 1