Simbody  3.6

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 negator< float > &x)
 
int SimTK::sign (const negator< 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

◆ sign() [1/14]

unsigned int SimTK::sign ( unsigned char  u)
inline

◆ sign() [2/14]

unsigned int SimTK::sign ( unsigned short  u)
inline

◆ sign() [3/14]

unsigned int SimTK::sign ( unsigned int  u)
inline

◆ sign() [4/14]

unsigned int SimTK::sign ( unsigned long  u)
inline

◆ sign() [5/14]

unsigned int SimTK::sign ( unsigned long long  u)
inline

◆ sign() [6/14]

int SimTK::sign ( signed char  i)
inline

◆ sign() [7/14]

int SimTK::sign ( short  i)
inline

◆ sign() [8/14]

int SimTK::sign ( int  i)
inline

◆ sign() [9/14]

int SimTK::sign ( long  i)
inline

◆ sign() [10/14]

int SimTK::sign ( long long  i)
inline

◆ sign() [11/14]

int SimTK::sign ( const float &  x)
inline

◆ sign() [12/14]

int SimTK::sign ( const double &  x)
inline

◆ sign() [13/14]

int SimTK::sign ( const negator< float > &  x)
inline

◆ sign() [14/14]

int SimTK::sign ( const negator< double > &  x)
inline