BitGet

BitGet[n,k]

gets the bit corresponding to the coefficient of in the integer n.

Details

  • BitGet[n,k] gets the bit k places from the right.
  • BitGet represents the bits it retrieves as 0 or 1.

Examples

Basic Examples  (1)

Display coefficients at powers of 2 in the integer 42:

In[1]:=
Click for copyable input
Out[1]=

Get the bit corresponding to the coefficient at 20:

In[2]:=
Click for copyable input
Out[2]=

Get the bit corresponding to the coefficient at 23:

In[3]:=
Click for copyable input
Out[3]=

See Also

BitSet  BitClear  BitLength  IntegerDigits  Part

Tutorials

Introduced in 2007
(6.0)