Doc: SetBit( )

SetBit - set a bit of a number

Syntax

Explanation

SetBit() sets a bit in a number.

Numbering of bits begins with 0 at the left, moving to the right.

Therefore, in the 8-bit number, 0110010, the bits are numbered :

Bit No. 7 6 5 4 3 2 1 0
8-Bit No. 0 1 1 0 0 1 0 1

Examples

Set a Bit in an 8-Bit Number

Related Pages

Reference

Tutorials

Categories: Binary : Functions : Math