and_bits() usage
- Posted by euphoric (admin) Oct 06, 2009
- 1182 views
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.