the
signum
of
factor
signum
(
expression )
Factor and expression yield integer
s, number
s, or complex
es.
If its argument is an integer
or a number
, the signum
function returns -1 if the specified numeric value is negative, 1 if the specified numeric value is positive, 0 if the specified numeric value is zero, and NaN
if the specified numeric value is NaN
.
If its argument is a complex
, the signum
function returns a complex
with the same complex argument but an absolute value of 1. For example,
returns signum
(3,4)0.6,0.8
.
For nonzero values of n,
. signum
(n) = n / abs
(n)