this post was submitted on 22 Oct 2023
620 points (95.7% liked)
Programmer Humor
32710 readers
648 users here now
Post funny things about programming here! (Or just rant about your favourite programming language.)
Rules:
- Posts must be relevant to programming, programmers, or computer science.
- No NSFW content.
- Jokes must be in good taste. No hate speech, bigotry, etc.
founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
GNU C. Also works with Clang. Avoids evaluating the arguments multiple times. The optimizer will convert the branch into a conditional move, if it doesn't I'd replace the ternary with the "bit hacker 2" version.
__auto_type
is a compiler builtin, not a library function. It's not a function at all, the parentheses are for precedence & grouping.