the
sgn
of
factor
sgn
(
expression )
Factor and expression yield integer
s, number
s, or complex
es.
If its argument is an integer
or a number
, the sgn
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 sgn
function returns a complex
with the same complex argument but an absolute value of 1. For example,
returns sgn
(3,4)0.6,0.8
.
For nonzero values of n,
. sgn
(n) = n / abs
(n)