this post was submitted on 15 May 2025
        
      
      1155 points (98.6% liked)
      Programmer Humor
    27158 readers
  
      
      1178 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
- Keep content in english
 - No advertisements
 - Posts must be related to programming or programmer topics
 
        founded 2 years ago
      
      MODERATORS
      
    you are viewing a single comment's thread
view the rest of the comments
    view the rest of the comments
          
          
This was gonna be my response to OP so I'll offer an alternative approach instead:
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.