cm0002@lemmy.world to Programmer Humor@programming.dev · 1 个月前Tell me the truth ...imagemessage-square168linkfedilinkarrow-up11.18Karrow-down117
arrow-up11.16Karrow-down1imageTell me the truth ...cm0002@lemmy.world to Programmer Humor@programming.dev · 1 个月前message-square168linkfedilink
minus-squareNιƙƙιDιɱҽʂ@lemmy.worldlinkfedilinkarrow-up7·edit-21 个月前It’s called bitshifting and is used to select which bits you want to modify so you can toggle them individually. 1 << 0 is the flag for the first bit 1 << 1 for the second 1 << 2 for the third and so on I think that’s correct. It’s been years since I’ve used this technique tbh 😅
It’s called bitshifting and is used to select which bits you want to modify so you can toggle them individually.
1 << 0 is the flag for the first bit
1 << 1 for the second
1 << 2 for the third and so on
I think that’s correct. It’s been years since I’ve used this technique tbh 😅