Programming question

I am new to programming and I was reading a code from the internet.

I came across this function, I could not understand what does it do.

If i = 7 and bits is 255

#define BIT_IS_SET(i, bits) (1 << i & bits)

Can you please explain this code ?

and it’s used again here

if (BIT_IS_SET(i, bits))

“bits” has the value 0b11111111 (aka 25510)
1 shifted left 7 places (“1 << 7”) has the value 0b10000000

0b10000000 bitwise ANDed with 0b11111111 has the value 0b10000000, which is non-zero and hence “true”.