1130
Tell me the truth ... (piefed.jeena.net)
you are viewing a single comment's thread
view the rest of the comments
[-] NikkiDimes@lemmy.world 7 points 2 months ago* (last edited 2 months ago)

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 ๐Ÿ˜…

this post was submitted on 15 May 2025
1130 points (100.0% liked)

Programmer Humor

25540 readers
445 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS