View Single Post
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 10-08-2010 , 15:24   Re: [TUT] Bits, Bit-fields, and Bit-wise Operators
Reply With Quote #29

8 = 1 << 3
1 = 1 << 0
8 = 1000
1 = 0001

7 = 1 << 0 | 1 << 1 | 1 << 2
7 = 0111

You could get 7 by doing ~8 but each situation will be different. You can't do addition or substation by 1 like that if thats what youre trying to do
__________________

Last edited by Bugsy; 10-08-2010 at 15:45.
Bugsy is offline