The bittest() function tests the status of a bit.


bittest(value, pos)


value – A tiny integer, integer or long integer value for which a bit will be tested.

pos – The position of the bit to be tested. The value 1 indicates the least-significant bit (LSB). The position can be up to 8 for tiny integers, 16 for integers, and 32 for long integers.


Return value

A boolean. True indicates the bit was set. False indicates it was not.

Documentation Feedback