Simbody
3.8
|
s=sign(n) returns int -1,0,1 according to n<0, n==0, n>0 for any integer or real numeric type, unsigned 0 or 1 for any unsigned argument.
s=sign(n) returns int -1,0,1 according to n<0, n==0, n>0 for any integer or real numeric type, unsigned 0 or 1 for any unsigned argument.
This routine is specialized for each of the int, unsigned, and real types of all sizes. Sign is defined for "signed char" and "unsigned char" but not plain "char" since the language leaves unspecified whether that is a signed or unsigned type. Sign is not defined for complex or conjugate.