Simbody  3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages

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

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