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.
More...
Functions |
unsigned int | sign (unsigned char u) |
unsigned int | sign (unsigned short u) |
unsigned int | sign (unsigned int u) |
unsigned int | sign (unsigned long u) |
unsigned int | sign (unsigned long long u) |
int | sign (signed char i) |
int | sign (short i) |
int | sign (int i) |
int | sign (long i) |
int | sign (long long i) |
int | sign (const float &x) |
int | sign (const double &x) |
int | sign (const long double &x) |
int | sign (const negator< float > &x) |
int | sign (const negator< double > &x) |
int | sign (const negator< long double > &x) |
Detailed Description
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.
Function Documentation
int SimTK::sign |
( |
const negator< long double > & |
x |
) |
[inline] |
int SimTK::sign |
( |
const negator< double > & |
x |
) |
[inline] |
int SimTK::sign |
( |
const negator< float > & |
x |
) |
[inline] |
int SimTK::sign |
( |
const long double & |
x |
) |
[inline] |
int SimTK::sign |
( |
const double & |
x |
) |
[inline] |
int SimTK::sign |
( |
const float & |
x |
) |
[inline] |
int SimTK::sign |
( |
long long |
i |
) |
[inline] |
int SimTK::sign |
( |
long |
i |
) |
[inline] |
int SimTK::sign |
( |
int |
i |
) |
[inline] |
int SimTK::sign |
( |
short |
i |
) |
[inline] |
int SimTK::sign |
( |
signed char |
i |
) |
[inline] |
unsigned int SimTK::sign |
( |
unsigned long long |
u |
) |
[inline] |
unsigned int SimTK::sign |
( |
unsigned long |
u |
) |
[inline] |
unsigned int SimTK::sign |
( |
unsigned int |
u |
) |
[inline] |
unsigned int SimTK::sign |
( |
unsigned short |
u |
) |
[inline] |
unsigned int SimTK::sign |
( |
unsigned char |
u |
) |
[inline] |