John Weiss
Coder
I'm trying to understand the code here
View: https://www.youtube.com/watch?v=NLKQEOgBAnw&t=443s
I don't understand this notation:
I understand we want to AND the bit at i position with 1, and see if it's equal to 1. So i assume that's what the formula is doing. Is this C code?
What's
What's
Why don't we say
View: https://www.youtube.com/watch?v=NLKQEOgBAnw&t=443s
I don't understand this notation:
(x&(1<<i)) != 0I understand we want to AND the bit at i position with 1, and see if it's equal to 1. So i assume that's what the formula is doing. Is this C code?
& must mean ANDi must be the position, 6 in the example: (x&(1 << 6)) != 0. Correct?What's
x?What's
<<? Does it mean "get the digit at position i"?Why don't we say
= 1 instead of != 0?