The bitset() function takes a copy of the value supplied, sets the specified bit and returns the value.


bitset(value, pos)


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

pos – The position of the bit to be set. 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

The value supplied with the specified bit set.

Documentation Feedback