Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C Programming
Bitwise question
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Eric Sosman, post: 3971296"] This does "something" if MASK and BIT_TO_CHECK have no 1-bits at corresponding positions, that is, if any 1-bit in MASK corresponds to a 0-bit in BIT_TO_CHECK. This does "something" if MASK has any 1-bit at the same position where BIT_TO_CHECK has a 0-bit. Same effect ... ... except that there's a small risk of trouble with the ~ operator if BIT_TO_CHECK is a signed type (best avoided when doing bit-fiddling) or if it promotes to a signed type (likely if BIT_TO_CHECK is an unsigned char, unsigned short, or unsigned bit-field). The first form has no such risk. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C Programming
Bitwise question
Top