## You are here

Homebitwise AND

## Primary tabs

# bitwise AND

Bitwise AND is a bit-level operation on two binary values which indicates which bits are set in both values. For each position $i$, if and only if the bit $d_{i}$ in both values is 1, then $d_{i}$ of the result is also 1, othewise, itâ€™s 0. For example, given 50 and 163 in two unsigned bytes, a bitwise AND returns 34.

0 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | |

AND | 1 | 0 | 1 | 0 | 0 | 0 | 1 | 1 |
---|---|---|---|---|---|---|---|---|

= | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 |

In most high-level programming languages that offer bitwise AND, the usual operator is a single ampersand (&), not to be confused with a double ampersand (&&) which performs a Boolean AND, returning a True or False value.

The Windows Calculator offers bitwise AND in scientific calculator mode, while the Mac OS X Calculator offers it in programmer mode.

Related:

BitwiseOR, BitwiseXOR, BitwiseNOT

Type of Math Object:

Definition

Major Section:

Reference

## Mathematics Subject Classification

11A63*no label found*

- Forums
- Planetary Bugs
- HS/Secondary
- University/Tertiary
- Graduate/Advanced
- Industry/Practice
- Research Topics
- LaTeX help
- Math Comptetitions
- Math History
- Math Humor
- PlanetMath Comments
- PlanetMath System Updates and News
- PlanetMath help
- PlanetMath.ORG
- Strategic Communications Development
- The Math Pub
- Testing messages (ignore)

- Other useful stuff
- Corrections