signbit#

ivy.signbit(x, /, *, out=None)[source]#

Return element-wise True where signbit is set (less than zero).

Parameters:
  • x (Union[Array, NativeArray, float, int, list, tuple]) – Array-like input.

  • out (Optional[Array], default: None) – optional output array, for writing the result to.

Return type:

Array

Returns:

ret – Output array, or reference to out if that was supplied. This is a scalar if x is a scalar.

Examples

>>> x = ivy.array([1, -2, 3])
>>> ivy.signbit(x)
ivy.array([False, True, False])
Array.signbit(self, /, *, out=None)[source]#

ivy.Array instance method variant of ivy.signbit. This method simply wraps the function, and so the docstring for ivy.signbit also applies to this method with minimal changes.

Parameters:
  • self (Union[Array, float, int, list, tuple]) – Array-like input.

  • out (Optional[Array], default: None) – optional output array, for writing the result to.

Return type:

Array

Returns:

ret – Element-wise signbit of x.

Examples

>>> x = ivy.array([1, -2, 3])
>>> x.signbit()
ivy.array([False, True, False])
Container.signbit(self, /, *, out=None)[source]#

ivy.Container instance method variant of ivy.signbit. This method simply wraps the function, and so the docstring for ivy.signbit also applies to this method with minimal changes.

Parameters:
  • self (Container) – input container with array-like items.

  • out (Optional[Container], default: None) – optional output container, for writing the result to.

Return type:

Container

Returns:

ret – Container including arrays with element-wise signbit of input arrays.

Examples

>>> x = ivy.Container(a=ivy.array([1, -2, 3]),                               b=-5)
>>> x.signbit()
{
    a: ivy.array([False, True, False])
    b: ivy.array([True])
}