NAME

signum - compute the sign of a value

SYNOPSIS

val.signum()

DESCRIPTION

The signum() method computes the sign of the given val. It returns:

If val is an array, the operation is performed element-wise. All elements of val must be numeric.

RETURN VALUE

A value or array containing the sign of each element in val. The type of the result is the same as the type of val (or its elements).

ERRORS

TypeCheck if val (or any of its elements) is not numeric

EXAMPLE

    [ -5.5, 0, 10.5 ].signum()
-1. 0. 1.

    [ -5, 0, 10 ].signum()
-1 0 1

SEE ALSO

abs