Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*- Returns true if the left most (the most significant) bit of value is set and false otherwise*/
- bool IsLeftMostBitSet(unsigned int value)
- {
- //right shift value by 4 until it equals 8 or less
- //if it equals 8, the left most bit was set
- //if it was lower, the bit was not set
- while (value > 8)
- {
- value = value >> 4;
- }
- if (value == 8)
- return true;
- else
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement