jax.numpy.signbit

jax.numpy.signbit(x)[source]

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

LAX-backend implementation of signbit(). Original docstring below.

signbit(x, /, out=None, *, where=True, casting=’same_kind’, order=’K’, dtype=None, subok=True[, signature, extobj])

Parameters

x (array_like) – The input value(s).

Returns

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

Return type

ndarray of bool

Examples

>>> np.signbit(-1.2)
True
>>> np.signbit(np.array([1, -2.3, 2.1]))
array([False,  True, False])