| MATLAB Function Reference | Search  Help Desk |
| bitand | Examples See Also |
Syntax
C = bitand(A,B)
Description
C = bitand(A,B)
returns the bit-wise AND of two nonnegative integer arguments A and B. To ensure the operands are integers, use the ceil, fix, floor, and round functions.
Examples
The five-bit binary representations of the integers 13 and 27 are 01101 and 11011, respectively. Performing a bit-wise AND on these numbers yields 01001, or 9.C = bitand(13,27)
C =
9
See Also
bitcmp, bitget, bitmax, bitor, bitset, bitshift, bitxor