Simbody  3.5

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 SimTK::sign (unsigned char u)
 
unsigned int SimTK::sign (unsigned short u)
 
unsigned int SimTK::sign (unsigned int u)
 
unsigned int SimTK::sign (unsigned long u)
 
unsigned int SimTK::sign (unsigned long long u)
 
int SimTK::sign (signed char i)
 
int SimTK::sign (short i)
 
int SimTK::sign (int i)
 
int SimTK::sign (long i)
 
int SimTK::sign (long long i)
 
int SimTK::sign (const float &x)
 
int SimTK::sign (const double &x)
 
int SimTK::sign (const long double &x)
 
int SimTK::sign (const negator< float > &x)
 
int SimTK::sign (const negator< double > &x)
 
int SimTK::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

unsigned int SimTK::sign ( unsigned char  u)
inline
unsigned int SimTK::sign ( unsigned short  u)
inline
unsigned int SimTK::sign ( unsigned int  u)
inline
unsigned int SimTK::sign ( unsigned long  u)
inline
unsigned int SimTK::sign ( unsigned long long  u)
inline
int SimTK::sign ( signed char  i)
inline
int SimTK::sign ( short  i)
inline
int SimTK::sign ( int  i)
inline
int SimTK::sign ( long  i)
inline
int SimTK::sign ( long long  i)
inline
int SimTK::sign ( const float &  x)
inline
int SimTK::sign ( const double &  x)
inline
int SimTK::sign ( const long double &  x)
inline
int SimTK::sign ( const negator< float > &  x)
inline
int SimTK::sign ( const negator< double > &  x)
inline
int SimTK::sign ( const negator< long double > &  x)
inline