These are just some useful bit level functions
if your wondering "well what are these useful for, why would I want to do anything at the bit level"
well
1. some API's and such operate at the bitlevel for attributes and
2. you can store a lot of information in just 1 variable such as say you had an online game and in it you had a player TYPE that had all the info such as positions, health, and such
well in this game you had some attributes that are just rather yes or no
like "dead/respawning" and "has a weapon" and "is invincible(or some other powerup)" well instead of sending 3 variables(which are 4 bytes) you could use 1 variable(which has 32bits) and set or unset the bits accordingly instead
ok now the actual code(typed more here than in the code)
function GetBit(value,bit)`gets the bit value of the 'bit' in value
`C: ret=(value&(1<<bit))>>bit
ret=(value &&(1<<bit))>>bit
endfunction ret
function SetBit(value,bit) `sets the 'bit' in value
ret=value||(1<<bit)
endfunction ret
function UnsetBit(value,bit)
ret=value&&(0xFFFFFFFF~~(1<<bit))
endfunction ret