this post was submitted on 15 May 2025
1158 points (98.6% liked)

Programmer Humor

23416 readers
1569 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
you are viewing a single comment's thread
view the rest of the comments
[–] anotherandrew@lemmy.mixdown.ca 1 points 1 week ago* (last edited 1 week ago)

Why not if (f & (F_1 | F_3)) {? I use this all the time in embedded code.

edit: never mind; you’re checking for both flags. I’d probably use (f & (F_1 | F_3)) == (F_1 | F_3) but that’s not much different than what you wrote.