- Thread starter Ryan$
- Start date

- Joined
- Mar 16, 2016

- Messages
- 1,238

The & symbol means "and".

- Joined
- Mar 16, 2016

- Messages
- 1,238

- Joined
- Mar 16, 2016

- Messages
- 1,238

What's 3 oranges and 4 oranges?

- Joined
- Mar 16, 2016

- Messages
- 1,238

7 or 12 ??

- Joined
- Mar 16, 2016

- Messages
- 1,238

So "and" doesn't mean multiply!

The difference between the symbols "**" and "&" depends entirely on what context we're operating in. In our usual mathematics, the asterisk (*) means multiplication. But in Boolean Algebra, an asterisk is sometimes used as a substitute for the logical and operator (\(\displaystyle \wedge\)), such that \(\displaystyle \text{TRUE} * \text{FALSE} = \text{TRUE} \wedge \text{FALSE} = \text{FALSE}\).

In some programming languages, such as Javascript, the ampersand (&) operator is defined as the "bitwise and" operator which "returns a 1 in each bit position for which the corresponding bits of both operands are 1s." For example, \(\displaystyle 5 \: \& \: 13 = 5\) because 5 is 0101 in binary and 13 is 1101 in binary and \(\displaystyle 0101 \: \& \: 1101 = 0101\).

In other contexts, each of these symbols may have other, alternate meanings. Some meanings are more "standard" than others, but it all depends on what the author wants them to mean.

In some programming languages, such as Javascript, the ampersand (&) operator is defined as the "bitwise and" operator which "returns a 1 in each bit position for which the corresponding bits of both operands are 1s." For example, \(\displaystyle 5 \: \& \: 13 = 5\) because 5 is 0101 in binary and 13 is 1101 in binary and \(\displaystyle 0101 \: \& \: 1101 = 0101\).

In other contexts, each of these symbols may have other, alternate meanings. Some meanings are more "standard" than others, but it all depends on what the author wants them to mean.

Last edited: