Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > Mathematics and Algorithms > Discrete Mathematics > Boolean Computation > Bitwise Operations > BitAnd >
Mathematica > Mathematics and Algorithms > Logic & Boolean Algebra > Boolean Computation > Bitwise Operations > BitAnd >
Mathematica > Mathematics and Algorithms > Graphs & Networks > Graph Programming > Boolean Computation > Bitwise Operations > BitAnd >

BitAnd

BitAnd
gives the bitwise AND of the integers .
  • Integer mathematical function, suitable for both symbolic and numerical manipulation.
  • BitAnd yields the integer whose binary bit representation has ones at positions where the binary bit representations of all of the have ones.
  • For negative integers BitAnd assumes a two's complement representation.
  • BitAnd automatically threads over lists.
In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
Use numbers of any size:
BitAnd takes any number of arguments:
Use negative numbers:
Basic symbolic simplifications are done automatically:
Extract the second-lowest-order bits in numbers:
"Mask" to test whether bits 3 or 4 are 1:
Make a nested pattern:
Test for powers of 2:
New in 4
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team
Format:   HTML  |  CDF