505
CompareBooleans (sh.itjust.works)
you are viewing a single comment's thread
view the rest of the comments
[-] Xanvial@lemmy.world 9 points 1 month ago

you can also use XOR operation

return (X || Y) && !(X && Y)
[-] Acters@lemmy.world 2 points 1 month ago* (last edited 1 month ago)

I was debating on bitwise operations, but decided on super basic if statements which I think the compiler would optimize, happy to see the logical operation form too

this post was submitted on 28 Oct 2024
505 points (98.3% liked)

Programming Humor

2739 readers
2 users here now

Related Communities !programmerhumor@lemmy.ml !programmer_humor@programming.dev !programmerhumor@kbin.social !programming_horror@programming.dev

Other Programming Communities !programming@beehaw.org !programming@programming.dev !programming@lemmy.ml !programming@kbin.social !learn_programming@programming.dev !functional_programming@programming.dev !embedded_prog@lemmy.ml

founded 2 years ago
MODERATORS