sign#

static vectorious.sign(x)#

Returns the sign of each element of x, indicating whether it is positive, negative or zero.

Arguments:
  • x (Number)

Returns:

NDArray

Examples:

import { sign } from 'vectorious/core/sign';

sign([1, 2, 3]); // => array([1, 1, 1])