When using the spotlight's calculator function, I noticed that & can be used as an operator. For example:
5 & 4 = 4
5 & 3 = 1
5 & 2 = 0
5 & 1 = 1
My question is what is this operator?
It’s a bitwise AND operator. Looking at your first example: 5 & 4 = 1. 101 (5 decimal) 100 (4 decimal) Answer has a 1 only in positions that have a 1 in both operands, which is just the most significant bit in this case: 100 (4 decimal)