This is bitwise AND. In fact, as written, what you return in the SELECT alternates between 0 and 64 and no other numbers.
This is verbatim from https://learn.microsoft.com/en-us/sql/t-sql/language-elements/bitwise-and-transact-sql :
The & bitwise operator performs a bitwise logical AND between the two
values, taking each corresponding bit for both expressions. The bits
in the result are set to 1 if and only if both bits (for the current
bit being resolved) in the input expressions have a value of 1;
otherwise, the bit in the result is set to 0.
Lets see what this does:
DECLARE @myint int = 16
SELECT @myint & 64 [myint 0] --0
/*
--This is the bitwise AND representation for 16 &64:
0000 0000 0100 0000 --&64
0000 0000 0001 0000 --@MyVar = 16
-------------------
0000 0000 0000 0000 -- = 0 = 'Yes'
*/
SET @myint = 64
SELECT @myint & 64 [myint 64] --64
/*
--This is the bitwise AND representation for 64 &64:
0000 0000 0100 0000 --&64
0000 0000 0100 0000 --@MyVar = 64
-------------------
0000 0000 0100 0000 -- = 64 = 'No'
*/
This applies for other numbers as well, try 127 and 128:
/*
0000 0000 0100 0000 --&64
0000 0000 0111 1111 --@MyVar = 127
-------------------
0000 0000 0100 0000 --64 = 'No'
0000 0000 0100 0000 --&64
0000 0000 1000 0001 --@MyVar = 128
-------------------
0000 0000 0000 0000 --0 = 'Yes'
*/
127 &64 = 64.
128 &64 = 0.