and_bits() usage

new topic     » topic index » view thread      » older message » newer message

I have a binary value such as this:

   myval = 1010 


and want to know if the second bit is set. Am I supposed to do this:

   if and_bits( myval, 2 ) = 2 then 
      ... 
   end if 


or what?

There's gotta be a better way. smile

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu