atMostOneBitIsSet(i) provides an extremely fast way to determine whether an integral type is either zero or consists of a single set bit.
More...
atMostOneBitIsSet(i) provides an extremely fast way to determine whether an integral type is either zero or consists of a single set bit.
This question arises when using bits to represent set membership where one may wish to verify that an integer represents a single element rather than a set of elements.
- See also
- exactlyOneBitIsSet()
bool SimTK::atMostOneBitIsSet |
( |
unsigned char |
v | ) |
|
|
inline |
bool SimTK::atMostOneBitIsSet |
( |
unsigned short |
v | ) |
|
|
inline |
bool SimTK::atMostOneBitIsSet |
( |
unsigned int |
v | ) |
|
|
inline |
bool SimTK::atMostOneBitIsSet |
( |
unsigned long |
v | ) |
|
|
inline |
bool SimTK::atMostOneBitIsSet |
( |
unsigned long long |
v | ) |
|
|
inline |
bool SimTK::atMostOneBitIsSet |
( |
signed char |
v | ) |
|
|
inline |
bool SimTK::atMostOneBitIsSet |
( |
char |
v | ) |
|
|
inline |
bool SimTK::atMostOneBitIsSet |
( |
short |
v | ) |
|
|
inline |
bool SimTK::atMostOneBitIsSet |
( |
int |
v | ) |
|
|
inline |
bool SimTK::atMostOneBitIsSet |
( |
long |
v | ) |
|
|
inline |
bool SimTK::atMostOneBitIsSet |
( |
long long |
v | ) |
|
|
inline |