Simbody  3.6

signBit(i) provides a fast way to determine the value of the sign bit (as a bool) for integral and floating types. More...

Functions

bool SimTK::signBit (unsigned char u)
 
bool SimTK::signBit (unsigned short u)
 
bool SimTK::signBit (unsigned int u)
 
bool SimTK::signBit (unsigned long u)
 
bool SimTK::signBit (unsigned long long u)
 
bool SimTK::signBit (signed char i)
 
bool SimTK::signBit (short i)
 
bool SimTK::signBit (int i)
 
bool SimTK::signBit (long long i)
 
bool SimTK::signBit (long i)
 
bool SimTK::signBit (const float &f)
 
bool SimTK::signBit (const double &d)
 
bool SimTK::signBit (const negator< float > &nf)
 
bool SimTK::signBit (const negator< double > &nd)
 

Detailed Description

signBit(i) provides a fast way to determine the value of the sign bit (as a bool) for integral and floating types.

Note that this is significantly different than sign(x); be sure you know what you're doing if you use this method. signBit() refers to the underlying representation rather than the numerical value. For example, for floating types there are two zeroes, +0 and -0 which have opposite sign bits but the same sign (0). Also, unsigned types have sign() of 0 or 1, but they are considered here to have a sign bit of 0 always, since the stored high bit does not indicate a negative value.

Notes

See also
sign()

Function Documentation

◆ signBit() [1/14]

bool SimTK::signBit ( unsigned char  u)
inline

◆ signBit() [2/14]

bool SimTK::signBit ( unsigned short  u)
inline

◆ signBit() [3/14]

bool SimTK::signBit ( unsigned int  u)
inline

◆ signBit() [4/14]

bool SimTK::signBit ( unsigned long  u)
inline

◆ signBit() [5/14]

bool SimTK::signBit ( unsigned long long  u)
inline

◆ signBit() [6/14]

bool SimTK::signBit ( signed char  i)
inline

◆ signBit() [7/14]

bool SimTK::signBit ( short  i)
inline

◆ signBit() [8/14]

bool SimTK::signBit ( int  i)
inline

◆ signBit() [9/14]

bool SimTK::signBit ( long long  i)
inline

◆ signBit() [10/14]

bool SimTK::signBit ( long  i)
inline

◆ signBit() [11/14]

bool SimTK::signBit ( const float &  f)
inline

◆ signBit() [12/14]

bool SimTK::signBit ( const double &  d)
inline

◆ signBit() [13/14]

bool SimTK::signBit ( const negator< float > &  nf)
inline

◆ signBit() [14/14]

bool SimTK::signBit ( const negator< double > &  nd)
inline