({{, (RefLink[BitGet, paclet:ref/BitGet])[n,k] 
gets the bit corresponding to the coefficient of (2^k) in the integer n. }})

OpenersNotesSection(Spacer1)Details

(RefLink[BitGet, paclet:ref/BitGet])[n,k] gets the bit k places from the right.

(RefLink[BitGet, paclet:ref/BitGet]) represents the bits it retrieves as 0 or 1.

OpenersPrimaryExamplesSection(Spacer1)Examples  (1)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

Display coefficients at powers of 2 in the integer 42:

IntegerDigits[42,2]

Get the bit corresponding to the coefficient at (2^0):

BitGet[42,0]

Get the bit corresponding to the coefficient at (2^3):

BitGet[42,3]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[BitSet, paclet:ref/BitSet])  ▪  (RefLink[BitClear, paclet:ref/BitClear])  ▪  (RefLink[BitLength, paclet:ref/BitLength])  ▪  (RefLink[IntegerDigits, paclet:ref/IntegerDigits])  ▪  (RefLink[Part, paclet:ref/Part])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Integer and Number Theoretic Functions, paclet:tutorial/IntegerAndNumberTheoreticalFunctions])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Bitwise Operations, paclet:guide/BitwiseOperations])}, {▪(RefLinkPlain[Cryptographic Number Theory, paclet:guide/CryptographicNumberTheory])}})}})