Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Well,
2b|!2b = 1011 | 0100 = 1111 = 15 = true
2b||!2b = ERROR: Illegal variable name!
;-)
(0x2b || !0x2b = true || false = true) -
@Yamakuzure didn't have to go that far.
For any Boolean variable X,
X + !X has to be true, where "+" denotes the OR operation and "!" is NOT.
Because you know, something can only either be true or not true.
Generalizes to multibit values too because each bit can be considered a Boolean variable and the operations happen element-wise.
Related Rants
I just noticed programmers can cite Shakespeare in 1 character.
"To be or not to be..." = 2b|!2b = true = 1
random
showerthought
succinct
abbreviation
shakespeare
citation